projects
/
sxemacs
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
e3d0801
)
Prevent movemail from proceeding when setuid fails
author
Nelson Ferreira
<nelson.ferreira@ieee.org>
Sun, 27 Sep 2015 21:10:45 +0000
(17:10 -0400)
committer
Nelson Ferreira
<nelson.ferreira@ieee.org>
Sun, 27 Sep 2015 21:10:45 +0000
(17:10 -0400)
* lib-src/movemail.c (main): Exit is setuid fails
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
lib-src/movemail.c
patch
|
blob
|
history
diff --git
a/lib-src/movemail.c
b/lib-src/movemail.c
index
9d75782
..
f6aa06d
100644
(file)
--- a/
lib-src/movemail.c
+++ b/
lib-src/movemail.c
@@
-344,14
+344,18
@@
int main(int argc, char *argv[])
int retcode = popmail(inname + 3, outname, poppass);
exit(retcode);
}
- setuid(getuid());
+ if (0 != setuid(getuid())) {
+ exit(1);
+ }
#endif /* MAIL_USE_POP */
#ifndef DISABLE_DIRECT_ACCESS
if (fork() == 0) {
- setuid(getuid());
+ if (0 != setuid(getuid())) {
+ exit(1);
+ }
VERBOSE(("opening input file\n"));