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];
|
char x_socket[MaxPathLen];
|
||||||
|
|
||||||
u_int32_t display_num;
|
u_int32_t display_num;
|
||||||
|
char display[MaxPathLen];
|
||||||
|
int display_size = sizeof(display);
|
||||||
char xauthfile[MaxPathLen];
|
char xauthfile[MaxPathLen];
|
||||||
int xauthfile_size = sizeof(xauthfile);
|
int xauthfile_size = sizeof(xauthfile);
|
||||||
u_char cookie[16];
|
u_char cookie[16];
|
||||||
|
@@ -187,12 +187,12 @@ connect_host (char *host, des_cblock *key, des_key_schedule schedule,
|
|||||||
fprintf (stderr, "%s: write: %s\n", prog, strerror(errno));
|
fprintf (stderr, "%s: write: %s\n", prog, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (krb_net_read (s, tmp, sizeof(tmp)) != sizeof(tmp)) {
|
if (krb_net_read (s, display, display_size) != display_size) {
|
||||||
fprintf (stderr, "%s: read %s\n", prog, strerror(errno));
|
fprintf (stderr, "%s: read: %s\n", prog, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
sscanf (tmp, "%u", &display_num);
|
|
||||||
if (krb_net_read (s, xauthfile, xauthfile_size) != xauthfile_size) {
|
if (krb_net_read (s, xauthfile, xauthfile_size) != xauthfile_size) {
|
||||||
fprintf (stderr, "%s: read: %s\n", prog,
|
fprintf (stderr, "%s: read: %s\n", prog,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
@@ -114,6 +114,8 @@ int copy_encrypted (int fd1, int fd2, des_cblock *iv,
|
|||||||
|
|
||||||
extern char x_socket[];
|
extern char x_socket[];
|
||||||
extern u_int32_t display_num;
|
extern u_int32_t display_num;
|
||||||
|
extern char display[];
|
||||||
|
extern int display_size;
|
||||||
extern char xauthfile[];
|
extern char xauthfile[];
|
||||||
extern int xauthfile_size;
|
extern int xauthfile_size;
|
||||||
extern u_char cookie[];
|
extern u_char cookie[];
|
||||||
|
@@ -227,13 +227,14 @@ 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) {
|
||||||
char tmp[16];
|
|
||||||
|
|
||||||
display_num = get_xsockets (&localx, tcpp ? &tcpx : NULL);
|
display_num = get_xsockets (&localx, tcpp ? &tcpx : NULL);
|
||||||
if (display_num < 0)
|
if (display_num < 0)
|
||||||
return 1;
|
return 1;
|
||||||
sprintf (tmp, "%u", display_num);
|
if (tcpp)
|
||||||
if (krb_net_write (sock, tmp, sizeof(tmp)) != sizeof(tmp))
|
sprintf (display, "localhost:%u", display_num);
|
||||||
|
else
|
||||||
|
sprintf (display, ":%u", display_num);
|
||||||
|
if (krb_net_write (sock, display, display_size) != display_size)
|
||||||
return 1;
|
return 1;
|
||||||
strncpy(xauthfile, tempnam("/tmp", NULL), xauthfile_size);
|
strncpy(xauthfile, tempnam("/tmp", NULL), xauthfile_size);
|
||||||
if (krb_net_write (sock, xauthfile, xauthfile_size) !=
|
if (krb_net_write (sock, xauthfile, xauthfile_size) !=
|
||||||
|
Reference in New Issue
Block a user