View | Details | Raw Unified | Return to bug 59
Collapse All | Expand All

(-)openssh-3.0.2p1/session.c.orig (+22 lines)
Lines 1038-1043 Link Here
1038
	struct stat st;
1038
	struct stat st;
1039
	char *argv[10];
1039
	char *argv[10];
1040
	int do_xauth;
1040
	int do_xauth;
1041
#ifdef HAVE_CHROOT
1042
	char *user_dir;
1043
	char *new_root;
1044
#endif /* HAVE_CHROOT */
1041
#ifdef WITH_IRIX_PROJECT
1045
#ifdef WITH_IRIX_PROJECT
1042
	prid_t projid;
1046
	prid_t projid;
1043
#endif /* WITH_IRIX_PROJECT */
1047
#endif /* WITH_IRIX_PROJECT */
Lines 1111-1116 Link Here
1111
1115
1112
			if (setlogin(pw->pw_name) < 0)
1116
			if (setlogin(pw->pw_name) < 0)
1113
				error("setlogin failed: %s", strerror(errno));
1117
				error("setlogin failed: %s", strerror(errno));
1118
#ifdef HAVE_CHROOT
1119
			user_dir = xstrdup(pw->pw_dir);
1120
			new_root = user_dir + 1;  										  
1121
			while((new_root = strchr(new_root, '.')) != NULL) {
1122
			  new_root--;
1123
			  if(strncmp(new_root, "/./", 3) == 0) {
1124
			    *new_root = '\0';
1125
			    new_root += 2;
1126
1127
			    if(chroot(user_dir) != 0)
1128
			      fatal("Couldn't chroot to user directory %s", user_dir);
1129
1130
			    pw->pw_dir = new_root;
1131
			    break;
1132
			  }
1133
			  new_root += 2;
1134
			}
1135
#endif /* HAVE_CHROOT */
1114
			if (setgid(pw->pw_gid) < 0) {
1136
			if (setgid(pw->pw_gid) < 0) {
1115
				perror("setgid");
1137
				perror("setgid");
1116
				exit(1);
1138
				exit(1);
(-)openssh-3.0.2p1/configure.ac.orig (+13 lines)
Lines 1721-1726 Link Here
1721
	]
1721
	]
1722
)
1722
)
1723
1723
1724
# Check whether to enable chroot support
1725
CHROOT_MSG="no" 
1726
AC_ARG_WITH(chroot,
1727
	[  --with-chroot           Enable use of chroot home directories],
1728
	[
1729
		if test "x$withval" != "xno" ; then
1730
			AC_DEFINE(HAVE_CHROOT)
1731
			MD5_MSG="yes"
1732
		fi
1733
	]
1734
)
1735
1724
# Whether to disable shadow password support
1736
# Whether to disable shadow password support
1725
AC_ARG_WITH(shadow,
1737
AC_ARG_WITH(shadow,
1726
	[  --without-shadow        Disable shadow password support],
1738
	[  --without-shadow        Disable shadow password support],
Lines 2207-2212 Link Here
2207
echo "                 S/KEY support: $SKEY_MSG"
2219
echo "                 S/KEY support: $SKEY_MSG"
2208
echo "          TCP Wrappers support: $TCPW_MSG"
2220
echo "          TCP Wrappers support: $TCPW_MSG"
2209
echo "          MD5 password support: $MD5_MSG"
2221
echo "          MD5 password support: $MD5_MSG"
2222
echo "                chroot support: $CHROOT_MSG"
2210
echo "   IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2223
echo "   IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2211
echo "      Use IPv4 by default hack: $IPV4_HACK_MSG"
2224
echo "      Use IPv4 by default hack: $IPV4_HACK_MSG"
2212
echo "       Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2225
echo "       Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
(-)openssh-3.0.2p1/config.h.in.orig (+3 lines)
Lines 780-785 Link Here
780
/* Define if you have the `__b64_ntop' function. */
780
/* Define if you have the `__b64_ntop' function. */
781
#undef HAVE___B64_NTOP
781
#undef HAVE___B64_NTOP
782
782
783
/* Define if you want the chroot capability */
784
#undef HAVE_CHROOT
785
783
/* The size of a `char', as computed by sizeof. */
786
/* The size of a `char', as computed by sizeof. */
784
#undef SIZEOF_CHAR
787
#undef SIZEOF_CHAR
785
788

Return to bug 59