Josip Rodin writes:

On Wed, Jan 13, 2010 at 07:44:07PM -0500, Sam Varshavchik wrote:
Let's try the following patch. I do appreciate your help in testing it. It's not easy for me to test all possible permutations of distro-specific configurations, and platform-specific nuances, that float around.

diff -U3 -r1.58 main.C
--- maildrop/main.C     13 Jan 2010 01:32:02 -0000      1.58
+++ maildrop/main.C     14 Jan 2010 00:41:13 -0000
@@ -564,6 +564,8 @@

#if     RESET_GID
        setgroupid(getgid());
+#else
+       setgroupid(getegid());
#endif

uid_t   my_u=getuid();


OK, it works when I put it in the first block, where it first does setuid()
because of the delivery mode. Then the subprocess gets the group mail.

You must be referring to the following.

After giving this another good look-over, today, I agree. Works for me.

diff -U3 -r1.58 main.C
--- maildrop/main.C     13 Jan 2010 01:32:02 -0000      1.58
+++ maildrop/main.C     15 Jan 2010 03:49:01 -0000
@@ -476,6 +476,8 @@
                                        nouser();
#if     RESET_GID
                                setgroupid(my_pw->pw_gid);
+#else
+                               setgroupid(getegid());
#endif
                                setuid(my_pw->pw_uid);
                                if (getuid() != my_pw->pw_uid)

Attachment: pgpGb3Y5Bpa25.pgp
Description: PGP signature

Reply via email to