Re: [Feature request] Find "sendmail" in $PATH at runtime

Bjørn Forsman <[email protected]>
Newsgroups gmane.comp.gnu.mailutils.bugs
Message-ID <CAEYzJUHyudobXZS+cb-Rk1a3S_26JXXDndekyz4v9bkwcRJi7A@mail.gmail.com>
Hi Sergey,

On 8 October 2017 at 14:56, Bjørn Forsman <[email protected]> wrote:
> Hi Sergey,
>
> On 8 October 2017 at 14:39, Sergey Poznyakoff <[email protected]> wrote:
>> Hi Bjørn,
>>
>>> For packaging mailutils in Nix/NixOS I/we would like to have the
>>> "mail" program lookup the path to "sendmail" at runtime via the $PATH
>>> environment variable.
>>
>> Have you considered the security implications of such a move?
>
> My reasoning is that as long as "mail" is not setuid root (or anything
> that elevates the privileges of the user invoking it), there is no
> security issue. But I'm actually not that familiar with "mail"... does
> it ever get installed setuid? (Currently it doesn't on NixOS.)
>
> Do you see any issues?

Can you confirm whether this is an issue?

I looked closer at how mailutils is built in Nixpkgs and noticed that
Makefile.in/am files are patched with "s/chmod [24]755/chmod 0755/".
(That's due to the multi-user (unprivileged) package manager security
model of Nixpkgs/NixOS; packages are built and installed unprivileged
and if a program needs setuid, a setuid wrapper program is made at the
OS level, which only an admin user is allowed to set up.)

Looking into which utils use setuid/gid I find:

$ grep -rn "chmod.*755" mailutils-3.2/
mailutils-3.2/maidag/Makefile.in:1514: chmod 4755 $(DESTDIR)$(sbindir)/$$i;\
mailutils-3.2/maidag/Makefile.am:64: chmod 4755 $(DESTDIR)$(sbindir)/$$i;\
mailutils-3.2/dotlock/Makefile.in:1335: chmod 2755 $(DESTDIR)$(bindir)/$$i;\
mailutils-3.2/dotlock/Makefile.am:30: chmod 2755 $(DESTDIR)$(bindir)/$$i;\

So in the end, only "maidag" and "dotlock" use setuid/gid, not "mail"?

Best regards,
Bjørn Forsman

_______________________________________________
Bug-mailutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-mailutils
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.