Displaying 4 results from an estimated 4 matches for "chroot_init".
Did you mean:
chroot_in
2001 Dec 18
1
chroot howto for sftp-server
...Fri Nov 23 10:56:48 2001
@@ -33,6 +33,8 @@
#include "sftp.h"
#include "sftp-common.h"
+#define CHROOT
+
/* helper */
#define get_int64() buffer_get_int64(&iqueue);
#define get_int() buffer_get_int(&iqueue);
@@ -1008,6 +1010,36 @@
}
}
+#ifdef CHROOT
+void
+chroot_init(void)
+{
+ char *user_dir, *new_root;
+
+ user_dir = getenv("HOME");
+
+ if (!user_dir)
+ fatal("HOME isn't in environment");
+
+ new_root = user_dir + 1;
+
+ while ((new_root = strchr(new_root, '.')) != NULL) {
+ new_root--;
+ if (strncmp(new_root, "/./"...
2003 Aug 16
0
sftp-server (secure) chroot patch, comment fix
...>
+#include <sys/stat.h>
+#include <string.h>
+#include <unistd.h>
+#endif /* CHROOT */
+
/* helper */
#define get_int64() buffer_get_int64(&iqueue);
#define get_int() buffer_get_int(&iqueue);
@@ -62,6 +71,51 @@
Attrib attrib;
};
+#ifdef CHROOT
+static void
+chroot_init(void)
+{
+ gid_t gidset[1];
+ struct passwd *pw;
+ struct stat st;
+
+ /* Sanity checking before chroot */
+ if ((pw = getpwuid(getuid())) == NULL)
+ fatal("getpwuid failed for %u", (u_int)pw->pw_uid );
+
+ /* Sets passwd pointer to null */
+ memset(pw->pw_passwd, 0, strlen(...
2003 Sep 30
1
[PATCH] sftp-server (secure) chroot patch, 3.7.1p2 update
...>
+#include <sys/stat.h>
+#include <string.h>
+#include <unistd.h>
+#endif /* CHROOT */
+
/* helper */
#define get_int64() buffer_get_int64(&iqueue);
#define get_int() buffer_get_int(&iqueue);
@@ -62,6 +72,49 @@
Attrib attrib;
};
+#ifdef CHROOT
+static void
+chroot_init(void)
+{
+ struct passwd *pw;
+ struct stat st;
+
+ /* Sanity checking before chroot */
+ if ((pw = getpwuid(getuid())) == NULL)
+ fatal(\"getpwuid failed for %u\", (u_int)pw->pw_uid );
+
+ /* Sets passwd pointer to null */
+ memset(pw->pw_passwd, 0, strlen(pw->pw_passwd)...
2003 Aug 16
0
sftp-server (secure) chroot patch?
...de <string.h>
+#include <unistd.h>
+#endif /* CHROOT */
+
/* helper */
#define get_int64() buffer_get_int64(&iqueue);
#define get_int() buffer_get_int(&iqueue);
@@ -62,6 +71,51 @@
Attrib attrib;
};
+#ifdef CHROOT
+static void
+chroot_init(void)
+{
+ gid_t gidset[1];
+ struct passwd *pw;
+ struct stat st;
+
+ /* Sanity checking before chroot */
+ if ((pw = getpwuid(getuid())) == NULL)
+ fatal("getpwuid failed for %u", (u_int)pw->pw_uid );
+
+ /* Sets passwd pointer to nul...