sysdb_ssh.c revision 770896b194b7b66b09c2a30545b4d091fd86b1f4
/*
Authors:
Jan Cholasta <jcholast@redhat.com>
Copyright (C) 2012 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <talloc.h>
#include "db/sysdb_ssh.h"
#include "db/sysdb_private.h"
static errno_t
const char *name,
struct sysdb_attrs *attrs)
{
return ret;
}
return EOK;
}
const char *name,
const char *alias,
struct sysdb_attrs *attrs)
{
bool in_transaction = false;
bool new_alias;
struct ldb_message_element *el;
unsigned int i;
if (!tmp_ctx) {
return ENOMEM;
}
goto done;
}
in_transaction = true;
goto done;
}
goto done;
}
goto done;
}
if (alias) {
new_alias = true;
/* copy aliases from the existing entry */
if (host) {
if (el) {
for (i = 0; i < el->num_values; i++) {
new_alias = false;
}
("Could not add name alias %s [%d]: %s\n",
goto done;
}
}
}
}
/* add alias only if it is not already present */
if (new_alias) {
("Could not add name alias %s [%d]: %s\n",
goto done;
}
}
}
/* make sure sshPublicKey is present when modifying an existing host */
if (host) {
("Could not get sysdb sshPublicKey [%d]: %s\n",
goto done;
}
}
("Could not set sysdb lastUpdate [%d]: %s\n",
goto done;
}
goto done;
}
goto done;
}
in_transaction = false;
done:
if (in_transaction) {
}
}
return ret;
}
const char *name,
int known_hosts_timeout)
{
struct sysdb_attrs *attrs;
("Updating known_hosts expire time of host %s\n", name));
if (!tmp_ctx) {
return ENOMEM;
}
if (!attrs) {
goto done;
}
("Could not set known_hosts expire time [%d]: %s\n",
goto done;
}
goto done;
}
done:
return ret;
}
const char *name)
{
}
static errno_t
const char *filter,
const char **attrs,
struct ldb_message ***hosts,
{
struct ldb_message **results;
if (!tmp_ctx) {
return ENOMEM;
}
&num_results, &results);
("Error looking up host [%d]: %s\n",
goto done;
*num_hosts = 0;
goto done;
}
*num_hosts = num_results;
done:
return ret;
}
const char *name,
const char **attrs,
struct ldb_message **host)
{
const char *filter;
struct ldb_message **hosts;
if (!tmp_ctx) {
return ENOMEM;
}
if (!filter) {
goto done;
}
goto done;
}
if (num_hosts > 1) {
("Found more than one host with name %s\n", name));
goto done;
}
done:
return ret;
}
const char **attrs,
struct ldb_message ***hosts,
{
const char *filter;
if (!tmp_ctx) {
return ENOMEM;
}
SYSDB_SSH_KNOWN_HOSTS_EXPIRE, (long)now);
if (!filter) {
goto done;
}
done:
return ret;
}