1 diff -ur pure-ftpd-1.0.21/pure-config/pure-config.h pure-ftpd-1.0.21.new/pure-config/pure-config.h
2 --- pure-ftpd-1.0.21/pure-config/pure-config.h 2005-06-18 12:39:55.000000000 +0200
3 +++ pure-ftpd-1.0.21.new/pure-config/pure-config.h 2009-02-03 15:00:10.358021471 +0100
5 { NULL, '\0', /* 'I' */ "MaxIdleTime", CFG_STR, (void*) &opt[I], 0 },
6 { NULL, '\0', /* 'k' */ "MaxDiskUsage", CFG_STR, (void*) &opt[I], 0 },
7 { NULL, '\0', /* 'a' */ "TrustedGID", CFG_STR, (void*) &opt[I], 0 },
8 +{ NULL, '\0', /* '2' */ "AdditionalGID", CFG_STR, (void*) &opt[I], 0 },
9 { NULL, '\0', /* 'c' */ "MaxClientsNumber", CFG_STR, (void*) &opt[I], 0 },
10 { NULL, '\0', /* 'C' */ "MaxClientsPerIP", CFG_STR, (void*) &opt[I], 0 },
11 { NULL, '\0', /* 'm' */ "MaxLoad", CFG_STR, (void*) &opt[I], 0 },
13 { "-I", "--maxidletime=" },
14 { "-k", "--maxdiskusage=" },
15 { "-a", "--trustedgid=" },
16 + { "-2", "--additionalgid=" },
17 { "-c", "--maxclientsnumber=" },
18 { "-C", "--maxclientsperip=" },
19 { "-m", "--maxload=" },
20 diff -ur pure-ftpd-1.0.21/src/ftpd.c pure-ftpd-1.0.21.new/src/ftpd.c
21 --- pure-ftpd-1.0.21/src/ftpd.c 2009-02-03 15:37:58.538020766 +0100
22 +++ pure-ftpd-1.0.21.new/src/ftpd.c 2009-02-03 15:41:41.582021928 +0100
23 @@ -1104,7 +1104,10 @@
26 # ifdef HAVE_SETGROUPS
27 - if (setgroups(1U, &gid) != 0) {
30 + gids[1] = chroot_additionalgid;
31 + if (setgroups(want_additionalgid ? 2L : 1L, gids) != 0) {
35 @@ -5078,6 +5081,19 @@
45 + chroot_additionalgid = strtoul(nptr, &endptr, 0);
46 + if (!nptr || !*nptr || !endptr || *endptr) {
47 + die(421, LOG_ERR, MSG_CONF_ERR ": " MSG_ILLEGAL_TRUSTED_GID " (XXX: additional): %s" , optarg);
49 + want_additionalgid = 1;
55 diff -ur pure-ftpd-1.0.21/src/ftpd_p.h pure-ftpd-1.0.21.new/src/ftpd_p.h
56 --- pure-ftpd-1.0.21/src/ftpd_p.h 2006-02-06 22:57:21.000000000 +0100
57 +++ pure-ftpd-1.0.21.new/src/ftpd_p.h 2009-02-03 15:35:47.946311240 +0100
61 static const char *GETOPT_OPTIONS =
68 static struct option long_options[] = {
69 { "notruncate", 0, NULL, '0' },
70 { "logpid", 0, NULL, '1' },
71 + { "additionalgid", 1, NULL, '2' },
72 { "ipv4only", 0, NULL, '4' },
73 { "ipv6only", 0, NULL, '6' },
75 diff -ur pure-ftpd-1.0.21/src/globals.h pure-ftpd-1.0.21.new/src/globals.h
76 --- pure-ftpd-1.0.21/src/globals.h 2006-02-15 09:55:00.000000000 +0100
77 +++ pure-ftpd-1.0.21.new/src/globals.h 2009-02-03 15:13:13.234021509 +0100
79 GLOBAL0(signed char userchroot); /* don't chroot() by default for regular users */
80 GLOBAL0(signed char chrooted); /* if we already chroot()ed */
81 GLOBAL0(uid_t chroot_trustedgid);
82 +GLOBAL(int want_additionalgid, 0);
83 +GLOBAL0(gid_t chroot_additionalgid);
84 GLOBAL0(signed char broken_client_compat); /* don't enable workarounds by default */
85 GLOBAL0(uid_t warez); /* don't guard against warez */
86 GLOBAL0(signed char debug); /* don't give debug output */
87 --- pure/configuration-file/pure-config.pl.in~ 2009-02-03 15:47:24.346020364 +0100
88 +++ pure/configuration-file/pure-config.pl.in 2009-02-03 15:48:34.678184463 +0100
90 my %numeric_switch_for = (
93 + AdditionalGID => "-2",
95 MaxClientsNumber => "-c",
96 MaxClientsPerIP => "-C",