]> diplodocus.org Git - nmh/commit
Removed all unnecessary setuid/setgid calls. Using setuid as an
authorDavid Levine <levinedl@acm.org>
Sun, 2 Feb 2014 15:58:45 +0000 (09:58 -0600)
committerDavid Levine <levinedl@acm.org>
Sun, 2 Feb 2014 15:58:45 +0000 (09:58 -0600)
commit05dba91fcb152e1941e7f7f145b1d830c5e8f6d0
treeb7592c6daeb0960df372d0496a4156f0d3b67c88
parentf02de746f64f0879e1d8dc754293a121b686646b
Removed all unnecessary setuid/setgid calls.  Using setuid as an
example and not showing the setgid analogues:

    1) setuid(getuid());
    This dropped privileges before an exec and is normally a
    good thing.  Except here, the return value isn't checked.
    And, we don't have any setuid programs in nmh now, so it was
    unnecessary.

    2) if (geteuid() == 0) setuid(pw->pw_uid);
    This would have been a security hole if the executable was
    setuid root because the user specifies the source of the pw
    data.  This was in slocal(1), which is not setuid, so this
    was certainly not needed.

    3) setuid(geteuid());
    This was in post(8) for when it called the sendmail
    executable directly (-mts sendmail or -mts sendmail/pipe.
    It's not necessary with modern sendmail or replacements.
mts/smtp/smtp.c
sbr/context_save.c
sbr/makedir.c
uip/popsbr.c
uip/slocal.c