diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-03-12 18:05:40 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-03-12 18:05:40 -0700 |
commit | 9e3edd30c34a2b6bfa031f301e9660ca8665462e (patch) | |
tree | 90f6a88f8b578047c99db3e71a556845ec749844 /lib-src/movemail.c | |
parent | f58afc72bd0fd54189c2ca66b9907ca0d338de75 (diff) | |
download | emacs-9e3edd30c34a2b6bfa031f301e9660ca8665462e.tar.gz |
* movemail.c: Don't grant more read permissions than necessary.
The old 0333 dates back to before we called setuid,
so it was needed back then to ensure user-readability,
but 0377 should suffice now.
Diffstat (limited to 'lib-src/movemail.c')
-rw-r--r-- | lib-src/movemail.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 386e28de711..190937d762b 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -380,9 +380,9 @@ main (int argc, char **argv) if (indesc < 0) pfatal_with_name (inname); - /* In case movemail is setuid to root, make sure the user can - read the output file. */ - umask (umask (0) & 0333); + /* Make sure the user can read the output file. */ + umask (umask (0) & 0377); + outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666); if (outdesc < 0) pfatal_with_name (outname); |