Merge pull request #46736 from clefru/mpack

mpack: Invoke /run/wrappers/bin/sendmail via execvp
This commit is contained in:
Jörg Thalheim 2018-09-18 10:01:00 +01:00 committed by GitHub
commit baa8dc35d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 6 deletions

View File

@ -8,18 +8,13 @@ stdenv.mkDerivation rec {
sha256 = "0k590z96509k96zxmhv72gkwhrlf55jkmyqlzi72m61r7axhhh97";
};
patches = [ ./build-fix.patch ];
patches = [ ./build-fix.patch ./sendmail-via-execvp.diff ];
postPatch = ''
for f in *.{c,man,pl,unix} ; do
substituteInPlace $f --replace /usr/tmp /tmp
done
for f in unixpk.c ; do
substituteInPlace $f \
--replace /usr/sbin /run/current-system/sw/bin
done
# this just shuts up some warnings
for f in {decode,encode,part,unixos,unixpk,unixunpk,xmalloc}.c ; do
sed -i 'i#include <stdlib.h>' $f

View File

@ -0,0 +1,12 @@
--- mpack-1.6/unixpk.c 2003-07-21 22:50:41.000000000 +0200
+++ mpack-1.6/unixpk.c 2018-09-16 12:57:14.104026964 +0200
@@ -254,8 +254,9 @@
#ifdef SCO
execv("/usr/lib/mail/execmail", addr+start);
#else
+ execvp("sendmail", addr+start);
execv("/usr/lib/sendmail", addr+start);
execv("/usr/sbin/sendmail", addr+start);
#endif
perror("execv");
_exit(1);