Added display' and
display_size'
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@958 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -43,6 +43,8 @@ RCSID("$Id$");
|
||||
char x_socket[MaxPathLen];
|
||||
|
||||
u_int32_t display_num;
|
||||
char display[MaxPathLen];
|
||||
int display_size = sizeof(display);
|
||||
char xauthfile[MaxPathLen];
|
||||
int xauthfile_size = sizeof(xauthfile);
|
||||
u_char cookie[16];
|
||||
|
@@ -188,11 +188,11 @@ connect_host (char *host, des_cblock *key, des_key_schedule schedule,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (krb_net_read (s, tmp, sizeof(tmp)) != sizeof(tmp)) {
|
||||
fprintf (stderr, "%s: read %s\n", prog, strerror(errno));
|
||||
if (krb_net_read (s, display, display_size) != display_size) {
|
||||
fprintf (stderr, "%s: read: %s\n", prog, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
sscanf (tmp, "%u", &display_num);
|
||||
|
||||
if (krb_net_read (s, xauthfile, xauthfile_size) != xauthfile_size) {
|
||||
fprintf (stderr, "%s: read: %s\n", prog,
|
||||
strerror(errno));
|
||||
|
@@ -114,6 +114,8 @@ int copy_encrypted (int fd1, int fd2, des_cblock *iv,
|
||||
|
||||
extern char x_socket[];
|
||||
extern u_int32_t display_num;
|
||||
extern char display[];
|
||||
extern int display_size;
|
||||
extern char xauthfile[];
|
||||
extern int xauthfile_size;
|
||||
extern u_char cookie[];
|
||||
|
@@ -227,13 +227,14 @@ doit(int sock, int tcpp)
|
||||
if (krb_net_read (sock, &passivep, sizeof(passivep)) != sizeof(passivep))
|
||||
return 1;
|
||||
if (passivep) {
|
||||
char tmp[16];
|
||||
|
||||
display_num = get_xsockets (&localx, tcpp ? &tcpx : NULL);
|
||||
if (display_num < 0)
|
||||
return 1;
|
||||
sprintf (tmp, "%u", display_num);
|
||||
if (krb_net_write (sock, tmp, sizeof(tmp)) != sizeof(tmp))
|
||||
if (tcpp)
|
||||
sprintf (display, "localhost:%u", display_num);
|
||||
else
|
||||
sprintf (display, ":%u", display_num);
|
||||
if (krb_net_write (sock, display, display_size) != display_size)
|
||||
return 1;
|
||||
strncpy(xauthfile, tempnam("/tmp", NULL), xauthfile_size);
|
||||
if (krb_net_write (sock, xauthfile, xauthfile_size) !=
|
||||
|
Reference in New Issue
Block a user