dovecot-1.2: dump-capability: Use nobody's group as process gid.

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 30 18:04:01 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/62b9661b4c7a
changeset: 9182:62b9661b4c7a
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 30 11:03:30 2009 -0400
description:
dump-capability: Use nobody's group as process gid.

diffstat:

1 file changed, 4 insertions(+), 5 deletions(-)
src/master/master-settings.c |    9 ++++-----

diffs (22 lines):

diff -r c2f6983a46c6 -r 62b9661b4c7a src/master/master-settings.c
--- a/src/master/master-settings.c	Mon Jun 29 12:37:10 2009 -0400
+++ b/src/master/master-settings.c	Tue Jun 30 11:03:30 2009 -0400
@@ -686,14 +686,13 @@ get_process_capability(enum process_type
 		/* try to use some existing user. at least osx launchd
 		   doesn't like non-existing users. */
 		struct passwd *pw;
-		struct group *gr;
 
 		pw = getpwnam("nobody");
-		if (pw != NULL)
+		if (pw != NULL && pw->pw_uid != (uid_t)-1 &&
+		    pw->pw_gid != (gid_t)-1) {
 			args[0] = t_strdup_printf("uid=%s", dec2str(pw->pw_uid));
-		gr = getgrnam("nogroup");
-		if (gr != NULL)
-			args[1] = t_strdup_printf("gid=%s", dec2str(gr->gr_gid));
+			args[1] = t_strdup_printf("gid=%s", dec2str(pw->pw_gid));
+		}
 	}
 
 	if (pipe(fd) < 0) {


More information about the dovecot-cvs mailing list