diff options
| author | Chong Yidong | 2011-01-23 17:58:52 -0500 |
|---|---|---|
| committer | Chong Yidong | 2011-01-23 17:58:52 -0500 |
| commit | fbf4af3a43b44258037dbd657efe828419f6ba45 (patch) | |
| tree | f3f2f73c542ae4544cbb589f212eeded068aee2d | |
| parent | 19634648a609af92c97a084cd4d3ad3b10113c1d (diff) | |
| download | emacs-fbf4af3a43b44258037dbd657efe828419f6ba45.tar.gz emacs-fbf4af3a43b44258037dbd657efe828419f6ba45.zip | |
* movemail.c (main): Use setregid, as setegid is missing on HP-UX (Bug#6811).
Suggested by Peter O'Gorman.
| -rw-r--r-- | lib-src/ChangeLog | 5 | ||||
| -rw-r--r-- | lib-src/movemail.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 421bdc06a43..aa5ae5ba7e6 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-01-23 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * movemail.c (main): Use setregid instead of setegid, which is | ||
| 4 | missing on older systems. Suggested by Peter O'Gorman (Bug#6811). | ||
| 5 | |||
| 1 | 2011-01-02 Glenn Morris <rgm@gnu.org> | 6 | 2011-01-02 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * ebrowse.c (version) <emacs_copyright>: | 8 | * ebrowse.c (version) <emacs_copyright>: |
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 3aebf79c6c8..5fcc6de17a6 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -360,7 +360,7 @@ main (argc, argv) | |||
| 360 | time_t touched_lock, now; | 360 | time_t touched_lock, now; |
| 361 | #endif | 361 | #endif |
| 362 | 362 | ||
| 363 | if (setuid (getuid ()) < 0 || setegid (real_gid) < 0) | 363 | if (setuid (getuid ()) < 0 || setregid (-1, real_gid) < 0) |
| 364 | fatal ("Failed to drop privileges", 0, 0); | 364 | fatal ("Failed to drop privileges", 0, 0); |
| 365 | 365 | ||
| 366 | #ifndef MAIL_USE_MMDF | 366 | #ifndef MAIL_USE_MMDF |
| @@ -387,7 +387,7 @@ main (argc, argv) | |||
| 387 | if (outdesc < 0) | 387 | if (outdesc < 0) |
| 388 | pfatal_with_name (outname); | 388 | pfatal_with_name (outname); |
| 389 | 389 | ||
| 390 | if (setegid (priv_gid) < 0) | 390 | if (setregid (-1, priv_gid) < 0) |
| 391 | fatal ("Failed to regain privileges", 0, 0); | 391 | fatal ("Failed to regain privileges", 0, 0); |
| 392 | 392 | ||
| 393 | /* This label exists so we can retry locking | 393 | /* This label exists so we can retry locking |
| @@ -484,7 +484,7 @@ main (argc, argv) | |||
| 484 | #endif | 484 | #endif |
| 485 | 485 | ||
| 486 | /* Prevent symlink attacks truncating other users' mailboxes */ | 486 | /* Prevent symlink attacks truncating other users' mailboxes */ |
| 487 | if (setegid (real_gid) < 0) | 487 | if (setregid (-1, real_gid) < 0) |
| 488 | fatal ("Failed to drop privileges", 0, 0); | 488 | fatal ("Failed to drop privileges", 0, 0); |
| 489 | 489 | ||
| 490 | /* Check to make sure no errors before we zap the inbox. */ | 490 | /* Check to make sure no errors before we zap the inbox. */ |
| @@ -519,7 +519,7 @@ main (argc, argv) | |||
| 519 | #endif /* not MAIL_USE_SYSTEM_LOCK */ | 519 | #endif /* not MAIL_USE_SYSTEM_LOCK */ |
| 520 | 520 | ||
| 521 | /* End of mailbox truncation */ | 521 | /* End of mailbox truncation */ |
| 522 | if (setegid (priv_gid) < 0) | 522 | if (setregid (-1, priv_gid) < 0) |
| 523 | fatal ("Failed to regain privileges", 0, 0); | 523 | fatal ("Failed to regain privileges", 0, 0); |
| 524 | 524 | ||
| 525 | #ifdef MAIL_USE_MAILLOCK | 525 | #ifdef MAIL_USE_MAILLOCK |