View | Details | Raw Unified | Return to bug 2458 | Differences between
and this patch

Collapse All | Expand All

(-)a/session.c (-3 / +10 lines)
Lines 160-165 login_cap_t *lc; Link Here
160
#endif
160
#endif
161
161
162
static int is_child = 0;
162
static int is_child = 0;
163
static int in_chroot = 0;
163
164
164
/* Name and directory of socket for authentication agent forwarding. */
165
/* Name and directory of socket for authentication agent forwarding. */
165
static char *auth_sock_name = NULL;
166
static char *auth_sock_name = NULL;
Lines 1529-1534 do_setusercontext(struct passwd *pw) Link Here
1529
			safely_chroot(chroot_path, pw->pw_uid);
1530
			safely_chroot(chroot_path, pw->pw_uid);
1530
			free(tmp);
1531
			free(tmp);
1531
			free(chroot_path);
1532
			free(chroot_path);
1533
1534
			/*
1535
			 * Remember we are inside a chroot. We need this later
1536
			 * to know whether or not to print a warning about
1537
			 * missing home directory.
1538
			 */
1539
			in_chroot = 1;
1540
1532
			/* Make sure we don't attempt to chroot again */
1541
			/* Make sure we don't attempt to chroot again */
1533
			free(options.chroot_directory);
1542
			free(options.chroot_directory);
1534
			options.chroot_directory = NULL;
1543
			options.chroot_directory = NULL;
Lines 1790-1797 do_child(Session *s, const char *command) Link Here
1790
#ifdef HAVE_LOGIN_CAP
1799
#ifdef HAVE_LOGIN_CAP
1791
		r = login_getcapbool(lc, "requirehome", 0);
1800
		r = login_getcapbool(lc, "requirehome", 0);
1792
#endif
1801
#endif
1793
		if (r || options.chroot_directory == NULL ||
1802
		if (r || in_chroot == 0)
1794
		    strcasecmp(options.chroot_directory, "none") == 0)
1795
			fprintf(stderr, "Could not chdir to home "
1803
			fprintf(stderr, "Could not chdir to home "
1796
			    "directory %s: %s\n", pw->pw_dir,
1804
			    "directory %s: %s\n", pw->pw_dir,
1797
			    strerror(errno));
1805
			    strerror(errno));
1798
- 

Return to bug 2458