New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mpack: Invoke /run/wrappers/bin/sendmail via execvp #46736
Conversation
@peterhoeg Since you helped me out with mpack last time, maybe you have time to review this as well? :) Thanks |
#else | ||
- execv("/usr/lib/sendmail", addr+start); | ||
- execv("/usr/sbin/sendmail", addr+start); | ||
+ execvp("sendmail", addr+start); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be sensible to fallback to the old behavior like this:
+ execvp("sendmail", addr+start);
execv("/usr/lib/sendmail", addr+start);
execv("/usr/sbin/sendmail", addr+start);
then it would almost behave the same on non-nixos platforms if PATH is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated PR
Calling /run/current-sw/bin/sendmail fails under postfix because setgid bits are not set. Switching the hardcoded path to an invocation via execvp should cover both cases, when the sendmail binary is setgid-wrapped and when it is not.
@GrahamcOfBorg build mpack |
Success on x86_64-linux (full log) Attempted: mpack Partial log (click to expand)
|
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: mpack Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: mpack Partial log (click to expand)
|
backport: f339ca5 |
Calling /run/current-sw/bin/sendmail fails under postfix because
setgid bits are not set. Switching the hardcoded path to an invocation
via execvp should cover both cases, when the sendmail binary is
setgid-wrapped and when it is not.
Motivation for this change
mpack can't send mails under a postfix installation, as the setgid bits are missing in postdrop.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)