mpack: Invoke /run/wrappers/bin/sendmail via execvp

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.

+13 -6
+1 -6
pkgs/tools/networking/mpack/default.nix
··· 8 sha256 = "0k590z96509k96zxmhv72gkwhrlf55jkmyqlzi72m61r7axhhh97"; 9 }; 10 11 - patches = [ ./build-fix.patch ]; 12 13 postPatch = '' 14 for f in *.{c,man,pl,unix} ; do 15 substituteInPlace $f --replace /usr/tmp /tmp 16 - done 17 - 18 - for f in unixpk.c ; do 19 - substituteInPlace $f \ 20 - --replace /usr/sbin /run/current-system/sw/bin 21 done 22 23 # this just shuts up some warnings
··· 8 sha256 = "0k590z96509k96zxmhv72gkwhrlf55jkmyqlzi72m61r7axhhh97"; 9 }; 10 11 + patches = [ ./build-fix.patch ./sendmail-via-execvp.diff ]; 12 13 postPatch = '' 14 for f in *.{c,man,pl,unix} ; do 15 substituteInPlace $f --replace /usr/tmp /tmp 16 done 17 18 # this just shuts up some warnings
+12
pkgs/tools/networking/mpack/sendmail-via-execvp.diff
···
··· 1 + --- mpack-1.6/unixpk.c 2003-07-21 22:50:41.000000000 +0200 2 + +++ mpack-1.6/unixpk.c 2018-09-16 12:57:14.104026964 +0200 3 + @@ -254,8 +254,9 @@ 4 + #ifdef SCO 5 + execv("/usr/lib/mail/execmail", addr+start); 6 + #else 7 + + execvp("sendmail", addr+start); 8 + execv("/usr/lib/sendmail", addr+start); 9 + execv("/usr/sbin/sendmail", addr+start); 10 + #endif 11 + perror("execv"); 12 + _exit(1);