]> diplodocus.org Git - nmh/commitdiff
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)
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.


No differences found