+2011-01-23 Chong Yidong <cyd@stupidchicken.com>
+
+ * movemail.c (main): Use setregid instead of setegid, which is
+ missing on older systems. Suggested by Peter O'Gorman (Bug#6811).
+
2011-01-02 Glenn Morris <rgm@gnu.org>
* ebrowse.c (version) <emacs_copyright>:
time_t touched_lock, now;
#endif
- if (setuid (getuid ()) < 0 || setegid (real_gid) < 0)
+ if (setuid (getuid ()) < 0 || setregid (-1, real_gid) < 0)
fatal ("Failed to drop privileges", 0, 0);
#ifndef MAIL_USE_MMDF
if (outdesc < 0)
pfatal_with_name (outname);
- if (setegid (priv_gid) < 0)
+ if (setregid (-1, priv_gid) < 0)
fatal ("Failed to regain privileges", 0, 0);
/* This label exists so we can retry locking
#endif
/* Prevent symlink attacks truncating other users' mailboxes */
- if (setegid (real_gid) < 0)
+ if (setregid (-1, real_gid) < 0)
fatal ("Failed to drop privileges", 0, 0);
/* Check to make sure no errors before we zap the inbox. */
#endif /* not MAIL_USE_SYSTEM_LOCK */
/* End of mailbox truncation */
- if (setegid (priv_gid) < 0)
+ if (setregid (-1, priv_gid) < 0)
fatal ("Failed to regain privileges", 0, 0);
#ifdef MAIL_USE_MAILLOCK