summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/session.c b/session.c
index 3e96557b8..54bac36a8 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.274 2014/07/15 15:54:14 millert Exp $ */ 1/* $OpenBSD: session.c,v 1.277 2015/01/16 06:40:12 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -60,6 +60,7 @@
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62#include <unistd.h> 62#include <unistd.h>
63#include <limits.h>
63 64
64#include "openbsd-compat/sys-queue.h" 65#include "openbsd-compat/sys-queue.h"
65#include "xmalloc.h" 66#include "xmalloc.h"
@@ -1437,7 +1438,7 @@ static void
1437safely_chroot(const char *path, uid_t uid) 1438safely_chroot(const char *path, uid_t uid)
1438{ 1439{
1439 const char *cp; 1440 const char *cp;
1440 char component[MAXPATHLEN]; 1441 char component[PATH_MAX];
1441 struct stat st; 1442 struct stat st;
1442 1443
1443 if (*path != '/') 1444 if (*path != '/')
@@ -1620,11 +1621,11 @@ launch_login(struct passwd *pw, const char *hostname)
1620static void 1621static void
1621child_close_fds(void) 1622child_close_fds(void)
1622{ 1623{
1623 extern AuthenticationConnection *auth_conn; 1624 extern int auth_sock;
1624 1625
1625 if (auth_conn) { 1626 if (auth_sock != -1) {
1626 ssh_close_authentication_connection(auth_conn); 1627 close(auth_sock);
1627 auth_conn = NULL; 1628 auth_sock = -1;
1628 } 1629 }
1629 1630
1630 if (packet_get_connection_in() == packet_get_connection_out()) 1631 if (packet_get_connection_in() == packet_get_connection_out())
@@ -2648,7 +2649,7 @@ session_setup_x11fwd(Session *s)
2648 debug("X11 forwarding disabled in server configuration file."); 2649 debug("X11 forwarding disabled in server configuration file.");
2649 return 0; 2650 return 0;
2650 } 2651 }
2651 if (!options.xauth_location || 2652 if (options.xauth_location == NULL ||
2652 (stat(options.xauth_location, &st) == -1)) { 2653 (stat(options.xauth_location, &st) == -1)) {
2653 packet_send_debug("No xauth program; cannot forward with spoofing."); 2654 packet_send_debug("No xauth program; cannot forward with spoofing.");
2654 return 0; 2655 return 0;