summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2001-05-19 00:36:41 +0000
committerDamien Miller <djm@cvs.openbsd.org>2001-05-19 00:36:41 +0000
commit90357f6f9effcfc40622d23d02439f539d773307 (patch)
tree8b2604068c82de73b13c612e9be37b1f15fc38e7
parent99bb64031e92228cd3c9f319a66e500f59422873 (diff)
Disable X11 forwarding if xauth binary is not found. Patch from Nalin
Dahyabhai <nalin@redhat.com>; ok markus@
-rw-r--r--usr.bin/ssh/session.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index 4505c7031af..af4fffabde0 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.75 2001/05/03 15:45:15 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.76 2001/05/19 00:36:40 djm Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -212,6 +212,7 @@ do_authenticated1(Authctxt *authctxt)
int success, type, fd, n_bytes, plen, screen_flag, have_pty = 0;
int compression_level = 0, enable_compression_after_reply = 0;
u_int proto_len, data_len, dlen;
+ struct stat st;
s = session_new();
s->pw = authctxt->pw;
@@ -294,7 +295,8 @@ do_authenticated1(Authctxt *authctxt)
packet_send_debug("X11 forwarding disabled in server configuration file.");
break;
}
- if (!options.xauth_location) {
+ if (!options.xauth_location ||
+ (stat(options.xauth_location, &st) == -1)) {
packet_send_debug("No xauth program; cannot forward with spoofing.");
break;
}
@@ -1374,6 +1376,7 @@ int
session_x11_req(Session *s)
{
int fd;
+ struct stat st;
if (no_x11_forwarding_flag) {
debug("X11 forwarding disabled in user configuration file.");
return 0;
@@ -1382,6 +1385,11 @@ session_x11_req(Session *s)
debug("X11 forwarding disabled in server configuration file.");
return 0;
}
+ if (!options.xauth_location ||
+ (stat(options.xauth_location, &st) == -1)) {
+ packet_send_debug("No xauth program; cannot forward with spoofing.");
+ return 0;
+ }
if (xauthfile != NULL) {
debug("X11 fwd already started.");
return 0;