summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-06-05 19:29:20 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-06-05 19:29:20 +0000
commit7d68fbf4c53f9e2c9f16b8cd69bc07c377b114de (patch)
tree184309eaf4d90eba2ffdad8e157e2f790e751f83 /session.c
parent551ea37576333968c760f3f080a8dfe51ca9b06a (diff)
- djm@cvs.openbsd.org 2001/05/19 00:36:40
[session.c] Disable X11 forwarding if xauth binary is not found. Patch from Nalin Dahyabhai <nalin@redhat.com>; ok markus@
Diffstat (limited to 'session.c')
-rw-r--r--session.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/session.c b/session.c
index 62026c670..9aef6b022 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.75 2001/05/03 15:45:15 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.76 2001/05/19 00:36:40 djm Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -255,6 +255,7 @@ do_authenticated1(Authctxt *authctxt)
255 int success, type, fd, n_bytes, plen, screen_flag, have_pty = 0; 255 int success, type, fd, n_bytes, plen, screen_flag, have_pty = 0;
256 int compression_level = 0, enable_compression_after_reply = 0; 256 int compression_level = 0, enable_compression_after_reply = 0;
257 u_int proto_len, data_len, dlen; 257 u_int proto_len, data_len, dlen;
258 struct stat st;
258 259
259 s = session_new(); 260 s = session_new();
260 s->pw = authctxt->pw; 261 s->pw = authctxt->pw;
@@ -337,7 +338,8 @@ do_authenticated1(Authctxt *authctxt)
337 packet_send_debug("X11 forwarding disabled in server configuration file."); 338 packet_send_debug("X11 forwarding disabled in server configuration file.");
338 break; 339 break;
339 } 340 }
340 if (!options.xauth_location) { 341 if (!options.xauth_location ||
342 (stat(options.xauth_location, &st) == -1)) {
341 packet_send_debug("No xauth program; cannot forward with spoofing."); 343 packet_send_debug("No xauth program; cannot forward with spoofing.");
342 break; 344 break;
343 } 345 }
@@ -1752,6 +1754,7 @@ int
1752session_x11_req(Session *s) 1754session_x11_req(Session *s)
1753{ 1755{
1754 int fd; 1756 int fd;
1757 struct stat st;
1755 if (no_x11_forwarding_flag) { 1758 if (no_x11_forwarding_flag) {
1756 debug("X11 forwarding disabled in user configuration file."); 1759 debug("X11 forwarding disabled in user configuration file.");
1757 return 0; 1760 return 0;
@@ -1760,6 +1763,11 @@ session_x11_req(Session *s)
1760 debug("X11 forwarding disabled in server configuration file."); 1763 debug("X11 forwarding disabled in server configuration file.");
1761 return 0; 1764 return 0;
1762 } 1765 }
1766 if (!options.xauth_location ||
1767 (stat(options.xauth_location, &st) == -1)) {
1768 packet_send_debug("No xauth program; cannot forward with spoofing.");
1769 return 0;
1770 }
1763 if (xauthfile != NULL) { 1771 if (xauthfile != NULL) {
1764 debug("X11 fwd already started."); 1772 debug("X11 fwd already started.");
1765 return 0; 1773 return 0;