X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Frsh-security.c;h=c98aed744d5cadd2bcdfde852afc9f87f405f77f;hb=d3b2175e084f88c8736ad7073eacbf4670147aec;hp=4c626ac54fc18c6a631157e3ffdab51e42759bb1;hpb=34197d9f46a5f4e944378cbb65fca32ee0eec7b9;p=debian%2Famanda diff --git a/common-src/rsh-security.c b/common-src/rsh-security.c index 4c626ac..c98aed7 100644 --- a/common-src/rsh-security.c +++ b/common-src/rsh-security.c @@ -25,7 +25,7 @@ */ /* - * $Id: rsh-security.c,v 1.31.2.1 2006/10/25 19:13:11 martinea Exp $ + * $Id: rsh-security.c,v 1.31 2006/08/21 20:17:10 martinea Exp $ * * rsh-security.c - security and transport over rsh or a rsh-like command. * @@ -45,14 +45,6 @@ #ifdef RSH_SECURITY -/*#define RSH_DEBUG*/ - -#ifdef RSH_DEBUG -#define rshprintf(x) dbprintf(x) -#else -#define rshprintf(x) -#endif - /* * Path to the rsh binary. This should be configurable. */ @@ -103,6 +95,8 @@ const security_driver_t rsh_security_driver = { tcpm_stream_read_sync, tcpm_stream_read_cancel, tcpm_close_connection, + NULL, + NULL }; static int newhandle = 1; @@ -126,14 +120,13 @@ rsh_connect( void * datap) { struct sec_handle *rh; - struct hostent *he; char *amandad_path=NULL, *client_username=NULL; assert(fn != NULL); assert(hostname != NULL); - rshprintf(("%s: rsh: rsh_connect: %s\n", debug_prefix_time(NULL), - hostname)); + auth_debug(1, ("%s: rsh: rsh_connect: %s\n", debug_prefix_time(NULL), + hostname)); rh = alloc(SIZEOF(*rh)); security_handleinit(&rh->sech, &rsh_security_driver); @@ -142,14 +135,13 @@ rsh_connect( rh->ev_timeout = NULL; rh->rc = NULL; - - if ((he = gethostbyname(hostname)) == NULL) { + rh->hostname = NULL; + if (try_resolving_hostname(hostname, &rh->hostname)) { security_seterror(&rh->sech, "%s: could not resolve hostname", hostname); (*fn)(arg, &rh->sech, S_ERROR); return; } - rh->hostname = stralloc(he->h_name); /* will be replaced */ rh->rs = tcpma_stream_client(rh, newhandle++); if (rh->rs == NULL)