Proper check for success of `get_xsockets'
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1478 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -57,7 +57,7 @@ childhandler (int sig)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
pid = waitpid (-1, &status, WNOHANG|WUNTRACED);
|
pid = waitpid (-1, &status, WNOHANG|WUNTRACED);
|
||||||
if (pid > 0 && WIFEXITED(status) || WIFSIGNALED(status))
|
if (pid > 0 && (WIFEXITED(status) || WIFSIGNALED(status)))
|
||||||
if (--nchild == 0 && donep)
|
if (--nchild == 0 && donep)
|
||||||
exit (0);
|
exit (0);
|
||||||
} while(pid > 0);
|
} while(pid > 0);
|
||||||
@@ -397,11 +397,13 @@ doit_active (char *host, char *user, int debugpp, int tcpp, int port)
|
|||||||
des_key_schedule schedule;
|
des_key_schedule schedule;
|
||||||
des_cblock key;
|
des_cblock key;
|
||||||
int rendez_vous1 = 0, rendez_vous2 = 0;
|
int rendez_vous1 = 0, rendez_vous2 = 0;
|
||||||
|
int tmp;
|
||||||
|
|
||||||
display_num = get_xsockets (&rendez_vous1,
|
tmp = get_xsockets (&rendez_vous1,
|
||||||
tcpp ? &rendez_vous2 : NULL);
|
tcpp ? &rendez_vous2 : NULL);
|
||||||
if (display_num < 0)
|
if (tmp < 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
display_num = tmp;
|
||||||
strncpy(xauthfile, tempnam("/tmp", NULL), xauthfile_size);
|
strncpy(xauthfile, tempnam("/tmp", NULL), xauthfile_size);
|
||||||
if (create_and_write_cookie (xauthfile, cookie, cookie_len))
|
if (create_and_write_cookie (xauthfile, cookie, cookie_len))
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -258,9 +258,12 @@ doit(int sock, int tcpp)
|
|||||||
if (krb_net_read (sock, &passivep, sizeof(passivep)) != sizeof(passivep))
|
if (krb_net_read (sock, &passivep, sizeof(passivep)) != sizeof(passivep))
|
||||||
return 1;
|
return 1;
|
||||||
if (passivep) {
|
if (passivep) {
|
||||||
display_num = get_xsockets (&localx, tcpp ? &tcpx : NULL);
|
int tmp;
|
||||||
if (display_num < 0)
|
|
||||||
|
tmp = get_xsockets (&localx, tcpp ? &tcpx : NULL);
|
||||||
|
if (tmp < 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
display_num = tmp;
|
||||||
if (tcpp)
|
if (tcpp)
|
||||||
sprintf (display, "localhost:%u", display_num);
|
sprintf (display, "localhost:%u", display_num);
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user