sshsrv.c revision 0528fdec17d0031996e919fcd852459e86592c35
/*
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 <popt.h>
#include "monitor/monitor_interfaces.h"
#include "responder/common/responder.h"
#include "responder/common/responder_sbus.h"
#include "responder/ssh/sshsrv_private.h"
#include "providers/data_provider.h"
struct mon_cli_iface monitor_ssh_methods = {
{ &mon_cli_iface_meta, 0 },
.resetOffline = NULL,
.clearMemcache = NULL,
.clearEnumCache = NULL,
.sysbusReconnect = NULL,
};
static struct data_provider_iface ssh_dp_methods = {
{ &data_provider_iface_meta, 0 },
.RegisterService = NULL,
.pamHandler = NULL,
.sudoHandler = NULL,
.autofsHandler = NULL,
.hostHandler = NULL,
.getDomains = NULL,
.getAccountInfo = NULL,
};
{
int ret;
/* Did we reconnect successfully? */
if (status == SBUS_RECONNECT_SUCCESS) {
/* Identify ourselves to the data provider */
"SSH");
/* all fine */
return;
}
}
/* Failed to reconnect */
}
struct tevent_context *ev,
struct confdb_ctx *cdb)
{
struct sss_cmd_table *ssh_cmds;
int ret;
int max_retries;
ssh_cmds = get_ssh_cmds();
"SSH",
&rctx);
return ret;
}
if (!ssh_ctx) {
goto fail;
}
"(?P<name>[^@]+)@?(?P<domain>[^@]*$)",
goto fail;
}
/* Enable automatic reconnection to the Data Provider */
3, &max_retries);
"Failed to set up automatic reconnection\n");
goto fail;
}
}
/* Get responder options */
/* Get ssh_hash_known_hosts option */
goto fail;
}
/* Get ssh_known_hosts_timeout option */
goto fail;
}
goto fail;
}
return EOK;
fail:
return ret;
}
{
int opt;
struct main_context *main_ctx;
int ret;
struct poptOption long_options[] = {
};
/* Set debug level to invalid value so we can deside if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
/* set up things like debug, signals, daemonization, etc... */
debug_log_file = "sssd_ssh";
return 2;
}
ret = die_if_parent_died();
/* This is not fatal, don't return */
"when parent process does\n");
}
return 3;
}
/* loop on main */
return 0;
}