Displaying 4 results from an estimated 4 matches for "unixerrno".
2003 Aug 16
0
sftp-server (secure) chroot patch, comment fix
...pw->pw_gid;
+ if (setgid(pw->pw_gid) < 0)
+ fatal("setgid failed for %u", (u_int)pw->pw_gid );
+ if (setgroups(1, gidset) < 0)
+ fatal("setgroups: %.100s", strerror(errno));
+ permanently_set_uid(pw);
+}
+#endif /* CHROOT */
+
static int
errno_to_portable(int unixerrno)
{
@@ -1028,15 +1082,19 @@
int in, out, max;
ssize_t len, olen, set_size;
+#ifdef DEBUG_SFTP-SERVER
+ log_init("sftp-server", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0);
+#endif
+
+#ifdef CHROOT
+ chroot_init();
+#endif
+
/* XXX should use getopt */
__progname = get_progna...
2003 Sep 30
1
[PATCH] sftp-server (secure) chroot patch, 3.7.1p2 update
...dir(\"/\") == -1)
+ fatal(\"chdir(\\\"/\\\"): %s\", strerror(errno));
+
+ if (setgid(pw->pw_gid) < 0)
+ fatal(\"setgid failed for %u\", (u_int)pw->pw_gid );
+
+ permanently_set_uid(pw);
+
+}
+#endif /* CHROOT */
+
static int
errno_to_portable(int unixerrno)
{
@@ -1028,15 +1081,19 @@
int in, out, max;
ssize_t len, olen, set_size;
+#ifdef DEBUG_SFTP_SERVER
+ log_init(\"sftp-server\", SYSLOG_LEVEL_DEBUG1, SYSLOG_FACILITY_AUTH,
0);
+#endif
+
+#ifdef CHROOT
+ chroot_init();
+#endif
+
/* XXX should use getopt */
__progname = ssh_get_...
2003 Aug 16
0
sftp-server (secure) chroot patch?
..._gid) < 0)
+ fatal("setgid failed for %u", (u_int)pw->pw_gid );
+ if (setgroups(1, gidset) < 0)
+ fatal("setgroups: %.100s", strerror(errno));
+ permanently_set_uid(pw);
+}
+#endif /* CHROOT */
+
static int
errno_to_portable(int unixerrno)
{
@@ -1028,15 +1082,17 @@
int in, out, max;
ssize_t len, olen, set_size;
- /* XXX should use getopt */
+#ifdef DEBUG_SFTP-SERVER
+ log_init("sftp-server", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0);
+#endif
+
+#ifdef CHROOT
+ chroot_init();
+#endif...
2007 Nov 11
1
ftp-server patch - restrict user to directory
...will allow access to ~freddy.
+ */
+ if( ! strncmp(resolvedname, RestrictDirectory, restlen) &&
+ resolvedname[restlen] == '/')
+ return(1);
+
+ error("Restricted access, %s disallowed for %.100s", reason, path);
+
+ return(0);
+}
+
static int
errno_to_portable(int unixerrno)
{
@@ -813,20 +948,24 @@
id = get_int();
path = get_string(NULL);
debug3("request %u: opendir", id);
- logit("opendir \"%s\"", path);
- dirp = opendir(path);
- if (dirp == NULL) {
- status = errno_to_portable(errno);
- } else {
- handle = handle_new(HANDLE_DIR...