SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
77
mail/mailman/patches/patch-src_common_c
Normal file
77
mail/mailman/patches/patch-src_common_c
Normal file
|
@ -0,0 +1,77 @@
|
|||
--- src/common.c.orig Sun Feb 28 15:47:44 2016
|
||||
+++ src/common.c Sun Mar 20 16:22:35 2016
|
||||
@@ -119,45 +119,39 @@ fatal(const char* ident, int exitcode, char* format, .
|
||||
void
|
||||
check_caller(const char* ident, const char* parentgroup)
|
||||
{
|
||||
- GID_T mygid = getgid();
|
||||
- struct group *mygroup = getgrgid(mygid);
|
||||
- char* option;
|
||||
- char* server;
|
||||
+ struct passwd *pw;
|
||||
+ struct group *gr;
|
||||
+ char **g;
|
||||
+ int ok = 0;
|
||||
char* wrapper;
|
||||
|
||||
- if (running_as_cgi) {
|
||||
- option = "--with-cgi-gid";
|
||||
- server = "web";
|
||||
- wrapper = "CGI";
|
||||
- }
|
||||
- else {
|
||||
- option = "--with-mail-gid";
|
||||
- server = "mail";
|
||||
- wrapper = "mail";
|
||||
- }
|
||||
+ pw = getpwuid(getuid());
|
||||
+ if (pw == NULL)
|
||||
+ fatal(ident, USER_NAME_NOT_FOUND,
|
||||
+ "Failure to find username");
|
||||
|
||||
- if (!mygroup)
|
||||
- fatal(ident, GROUP_NAME_NOT_FOUND,
|
||||
- "Failure to find group name for GID %d. Mailman\n"
|
||||
- "expected the %s wrapper to be executed as group\n"
|
||||
- "\"%s\", but the system's %s server executed the\n"
|
||||
- "wrapper as GID %d for which the name could not be\n"
|
||||
- "found. Try adding GID %d to your system as \"%s\",\n"
|
||||
- "or tweak your %s server to run the wrapper as group\n"
|
||||
- "\"%s\".",
|
||||
- mygid, wrapper, parentgroup, server, mygid, mygid,
|
||||
- parentgroup, server, parentgroup);
|
||||
+ gr = getgrnam(parentgroup);
|
||||
+ if (gr == NULL)
|
||||
+ fatal(ident, GROUP_NAME_NOT_FOUND,
|
||||
+ "Failure to find \"%s\" group", parentgroup);
|
||||
|
||||
- if (strcmp(parentgroup, mygroup->gr_name))
|
||||
- fatal(ident, GROUP_MISMATCH,
|
||||
- "Group mismatch error. Mailman expected the %s\n"
|
||||
- "wrapper script to be executed as group \"%s\", but\n"
|
||||
- "the system's %s server executed the %s script as\n"
|
||||
- "group \"%s\". Try tweaking the %s server to run the\n"
|
||||
- "script as group \"%s\", or re-run configure, \n"
|
||||
- "providing the command line option `%s=%s'.",
|
||||
- wrapper, parentgroup, server, wrapper, mygroup->gr_name,
|
||||
- server, parentgroup, option, mygroup->gr_name);
|
||||
+ for (g = gr->gr_mem; *g; g++) {
|
||||
+ if (strcmp(pw->pw_name, *g) == 0) {
|
||||
+ ok = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (running_as_cgi)
|
||||
+ wrapper = "CGI";
|
||||
+ else
|
||||
+ wrapper = "mail";
|
||||
+
|
||||
+ if (ok == 0)
|
||||
+ fatal(ident, GROUP_MISMATCH,
|
||||
+ "Group mismatch error. Mailman expected the %s\n"
|
||||
+ "wrapper script to be executed by a member of\n"
|
||||
+ "\"%s\" group.", wrapper, parentgroup);
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue