#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.
*/
tcpm_stream_read_sync,
tcpm_stream_read_cancel,
tcpm_close_connection,
+ NULL,
+ NULL
};
static int newhandle = 1;
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);
rh->hostname = NULL;
rh->rs = NULL;
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)