[Nmh-workers] setuid/setgid in nmh

2014-02-02 Thread David Levine
Hi, There are a few setuid/setgid calls remaining in nmh. They're of three types. Using setuid as an example and not showing the setgid analogues: 1) setuid(getuid()); This drops privileges before an exec and is normally a good thing. Except here, the return value isn't checked. And, we

Re: [Nmh-workers] setuid/setgid in nmh

2014-02-02 Thread Paul Vixie
David Levine wrote: ... As far as I know, those conditions don't apply to any platform that we might actively support, including: Linux, Cygwin, AIX: use fcntl (by default) FreeBSD, OpenBSD, Mac OS X: use flock (by default) Solaris: has world-writable mail spool Users on

[Nmh-workers] About mhshow tuning and replies to MIME messages with a attachments

2014-02-02 Thread Mikhail
Hello! I'd like to ask few questions: 1) when you use show on a range of emails, and if they're all non-mime ones, output is very pleasant and comfortable - every message is indented and given a nice header with its number (it's very useful for replies). It's very convenient to use with

Re: [Nmh-workers] extensions on tmp filenames?

2014-02-02 Thread Lyndon Nerenberg
On Feb 2, 2014, at 6:02, David Levine levin...@acm.org wrote: Well, that's the way it's documented. This is when an existing file is in the way of the new name. Documented where? SUSv3 calls out the behaviour explicitly, as inherited from the ISO C spec.

Re: [Nmh-workers] setuid/setgid in nmh

2014-02-02 Thread David Levine
Lyndon wrote: I would prefer to leave that bit of code in place. Presumably we can still build and run on older systems that still need this. It's a simple little snippet of code that's harmless even if left in unconditionally. OK. David ___

Re: [Nmh-workers] extensions on tmp filenames?

2014-02-02 Thread David Levine
Lyndon wrote: On Feb 2, 2014, at 6:02, David Levine levin...@acm.org wrote: Well, that's the way it's documented. This is when an existing file is in the way of the new name. Documented where? SUSv3 calls out the behaviour explicitly, as inherited from the ISO C spec. Well, the

Re: [Nmh-workers] extensions on tmp filenames?

2014-02-02 Thread Earl Hood
On Sun, Feb 2, 2014 at 4:43 PM, David Levine wrote: Documented where? SUSv3 calls out the behaviour explicitly, as inherited from the ISO C spec. Well, the SUSv2 spec says: If the link named by the new argument exists, it shall be removed and old renamed to new. In this case, a

Re: [Nmh-workers] About mhshow tuning and replies to MIME messages with a attachments

2014-02-02 Thread Ken Hornstein
1) when you use show on a range of emails, and if they're all non-mime ones, output is very pleasant and comfortable - every message is indented and given a nice header with its number (it's very useful for replies). It's very convenient to use with 'pick', for example to read whole

Re: [Nmh-workers] setuid/setgid in nmh

2014-02-02 Thread Robert Elz
Date:Sun, 02 Feb 2014 10:58:30 -0500 From:David Levine levin...@acm.org Message-ID: 21266-1391356710.058...@pwcr.arvw.l24H | 2) if (geteuid() == 0) setuid(pw-pw_uid); | | This would be a security hole if the executable was setuid root | because the user

Re: [Nmh-workers] setuid/setgid in nmh

2014-02-02 Thread David Levine
Robert wrote: And it is impossible for slocal to ever be used as the mail delivery agent (the way procmail can be, or example) - so it gets run as root, but told which user it is to deliver the mail for ? Good point: I restored the setuid/setgid to slocal and added checks of the return

Re: [Nmh-workers] extensions on tmp filenames?

2014-02-02 Thread David Levine
Earl wrote: On Sun, Feb 2, 2014 at 4:43 PM, David Levine wrote: Documented where? SUSv3 calls out the behaviour explicitly, as inherited from the ISO C spec. Well, the SUSv2 spec says: If the link named by the new argument exists, it shall be removed and old renamed to

Re: [Nmh-workers] extensions on tmp filenames?

2014-02-02 Thread Robert Elz
| If the link named by the new argument exists, it shall be removed | and old renamed to new. In this case, a link named new shall | remain visible to other processes throughout the renaming | operation and refer either to the file referred to by new or old |