sss_ssh_knownhostsproxy.c revision 9e2c64c6d4f5560e27207193efea6536a566865e
/*
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 <stdio.h>
#include <talloc.h>
#include <unistd.h>
#include <fcntl.h>
#include <poll.h>
#include <netdb.h>
#include <popt.h>
#include "util/crypto/sss_crypto.h"
#include "sss_client/sss_cli.h"
#include "sss_client/ssh/sss_ssh_client.h"
#define BUFFER_SIZE 8192
/* connect to server using socket */
static int
{
int flags;
int sock = -1;
char buffer[BUFFER_SIZE];
int i;
int ret;
/* set O_NONBLOCK on standard input */
if (flags == -1) {
goto done;
}
if (ret == -1) {
goto done;
}
/* create socket */
if (sock == -1) {
goto done;
}
/* connect to the server */
if (ret == -1) {
goto done;
}
/* set O_NONBLOCK on the socket */
if (flags == -1) {
goto done;
}
if (ret == -1) {
goto done;
}
while (1) {
if (ret == -1) {
continue;
}
goto done;
}
/* read from standard input & write to socket */
/* read from socket & write to standard output */
for (i = 0; i < 2; i++) {
if (res == -1) {
continue;
}
goto done;
} else if (res == 0) {
goto done;
}
errno = 0;
if (res == -1) {
("sss_atomic_write_s() failed (%d): %s\n",
goto done;
goto done;
}
}
goto done;
}
}
}
done:
return ret;
}
/* connect to server using proxy command */
static int
connect_proxy_command(char **args)
{
int ret;
return ret;
}
{
int pc_debug = SSSDBG_DEFAULT;
int pc_port = 22;
struct poptOption long_options[] = {
_("The debug level to run with"), NULL },
_("The port to use to connect to the host"), NULL },
_("The SSSD domain to use"), NULL },
};
char strport[6];
char canonhost[NI_MAXHOST];
struct sss_ssh_ent *ent;
int ret;
debug_prg_name = argv[0];
ret = set_locale();
ret = EXIT_FAILURE;
goto fini;
}
if (!mem_ctx) {
ret = EXIT_FAILURE;
goto fini;
}
/* parse parameters */
;
if (ret != -1) {
}
}
}
_("The path to the proxy command must be absolute\n"),
}
/* canonicalize hostname */
if (ret) {
if (ret) {
} else {
}
} else {
if (ret) {
} else {
}
}
if (host) {
/* append domain to hostname if domain is specified */
if (pc_domain) {
if (!host) {
ret = EXIT_FAILURE;
goto fini;
}
}
/* look up public keys */
}
}
/* connect to server */
if (pc_args) {
} else if (ai) {
} else {
}
fini:
return ret;
}