]> git.pld-linux.org Git - packages/openssh.git/commitdiff
- chrootssh patch (http://chrootssh.sourceforge.net)
authorpius <pius@pld-linux.org>
Mon, 6 Oct 2003 12:27:53 +0000 (12:27 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    openssh-chroot.patch -> 1.1

openssh-chroot.patch [new file with mode: 0644]

diff --git a/openssh-chroot.patch b/openssh-chroot.patch
new file mode 100644 (file)
index 0000000..23f1d8d
--- /dev/null
@@ -0,0 +1,53 @@
+diff -uNr openssh-3.7p1/session.c openssh-3.7p1-chroot/session.c
+--- openssh-3.7p1/session.c    Mon Sep 15 21:52:19 2003
++++ openssh-3.7p1-chroot/session.c     Tue Sep 16 14:23:34 2003
+@@ -62,6 +62,8 @@
+ #include "ssh-gss.h"
+ #endif
++#define CHROOT
++
+ /* func */
+ Session *session_new(void);
+@@ -1227,6 +1229,12 @@
+ void
+ do_setusercontext(struct passwd *pw)
+ {
++
++#ifdef CHROOT
++      char *user_dir;
++      char *new_root;
++#endif /* CHROOT */
++
+ #ifndef HAVE_CYGWIN
+       if (getuid() == 0 || geteuid() == 0)
+ #endif /* HAVE_CYGWIN */
+@@ -1264,6 +1272,27 @@
+                       exit(1);
+               }
+               endgrent();
++
++#ifdef CHROOT
++              user_dir = xstrdup(pw->pw_dir);
++              new_root = user_dir + 1;
++
++              while((new_root = strchr(new_root, '.')) != NULL) {
++                      new_root--;
++                      if(strncmp(new_root, "/./", 3) == 0) {
++                              *new_root = '\0';
++                              new_root += 2;
++
++                              if(chroot(user_dir) != 0)
++                                      fatal("Couldn't chroot to user directory % s", user_dir);
++                                      pw->pw_dir = new_root;
++                                      break;
++                              }
++                              new_root += 2;
++              }
++#endif /* CHROOT */
++
++
+ # ifdef USE_PAM
+               /*
+                * PAM credentials may take the form of supplementary groups. 
This page took 0.278078 seconds and 4 git commands to generate.