about summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-01-09 03:35:40 +0300
committerNikolay Amiantov <ab@fmap.me>2016-01-12 16:41:35 +0300
commit57c1d09857d826e2774e20d28783299f1f7ac6ca (patch)
tree12730ac8bd11229d5439c1f4c86d0595f2a5dfb7 /pkgs/servers
parent22fb0cb058d5f2362565bd384d8612b547231947 (diff)
downloadnixlib-57c1d09857d826e2774e20d28783299f1f7ac6ca.tar
nixlib-57c1d09857d826e2774e20d28783299f1f7ac6ca.tar.gz
nixlib-57c1d09857d826e2774e20d28783299f1f7ac6ca.tar.bz2
nixlib-57c1d09857d826e2774e20d28783299f1f7ac6ca.tar.lz
nixlib-57c1d09857d826e2774e20d28783299f1f7ac6ca.tar.xz
nixlib-57c1d09857d826e2774e20d28783299f1f7ac6ca.tar.zst
nixlib-57c1d09857d826e2774e20d28783299f1f7ac6ca.zip
postfix30: add patch to silence setuid-in-nix-store related warnings
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/mail/postfix/3.0.nix2
-rw-r--r--pkgs/servers/mail/postfix/postfix-3.0-no-warnings.patch86
2 files changed, 87 insertions, 1 deletions
diff --git a/pkgs/servers/mail/postfix/3.0.nix b/pkgs/servers/mail/postfix/3.0.nix
index 8c625da2c9e2..93084f3ba609 100644
--- a/pkgs/servers/mail/postfix/3.0.nix
+++ b/pkgs/servers/mail/postfix/3.0.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ makeWrapper gnused db openssl cyrus_sasl icu ];
 
-  patches = [ ./postfix-script-shell.patch ];
+  patches = [ ./postfix-script-shell.patch ./postfix-3.0-no-warnings.patch ];
 
   preBuild = ''
     sed -e '/^PATH=/d' -i postfix-install
diff --git a/pkgs/servers/mail/postfix/postfix-3.0-no-warnings.patch b/pkgs/servers/mail/postfix/postfix-3.0-no-warnings.patch
new file mode 100644
index 000000000000..d93eaf0aaa0d
--- /dev/null
+++ b/pkgs/servers/mail/postfix/postfix-3.0-no-warnings.patch
@@ -0,0 +1,86 @@
+diff -ru3 postfix-3.0.3/conf/postfix-script postfix-3.0.3-new/conf/postfix-script
+--- postfix-3.0.3/conf/postfix-script	2014-06-27 18:05:15.000000000 +0400
++++ postfix-3.0.3-new/conf/postfix-script	2016-01-09 17:51:38.545733631 +0300
+@@ -84,24 +84,6 @@
+ 	exit 1
+ }
+ 
+-# If this is a secondary instance, don't touch shared files.
+-
+-instances=`test ! -f $def_config_directory/main.cf ||
+-    $command_directory/postconf -c $def_config_directory \
+-    -h multi_instance_directories | sed 's/,/ /'` || {
+-	$FATAL cannot execute $command_directory/postconf!
+-	exit 1
+-}
+-
+-check_shared_files=1
+-for name in $instances
+-do
+-    case "$name" in
+-    "$def_config_directory") ;;
+-    "$config_directory") check_shared_files=; break;;
+-    esac
+-done
+-
+ #
+ # Parse JCL
+ #
+@@ -262,22 +244,6 @@
+ 	    -prune \( -perm -020 -o -perm -002 \) \
+ 	    -exec $WARN group or other writable: {} \;
+ 
+-	# Check Postfix root-owned directory tree owner/permissions.
+-
+-	todo="$config_directory/."
+-	test -n "$check_shared_files" && {
+-		todo="$daemon_directory/. $meta_directory/. $todo"
+-		test "$shlib_directory" = "no" || 
+-		    todo="$shlib_directory/. $todo"
+-	}
+-	todo=`echo "$todo" | tr ' ' '\12' | sort -u`
+-
+-	find $todo ! -user root \
+-	    -exec $WARN not owned by root: {} \;
+-
+-	find $todo \( -perm -020 -o -perm -002 \) \
+-	    -exec $WARN group or other writable: {} \;
+-
+ 	# Check Postfix mail_owner-owned directory tree owner/permissions.
+ 
+ 	find $data_directory/. ! -user $mail_owner \
+@@ -302,18 +268,11 @@
+ 	# Check Postfix setgid_group-owned directory and file group/permissions.
+ 
+ 	todo="$queue_directory/public $queue_directory/maildrop"
+-	test -n "$check_shared_files" && 
+-	   todo="$command_directory/postqueue $command_directory/postdrop $todo"
+ 
+ 	find $todo \
+ 	    -prune ! -group $setgid_group \
+ 	    -exec $WARN not owned by group $setgid_group: {} \;
+ 
+-	test -n "$check_shared_files" &&
+-	find $command_directory/postqueue $command_directory/postdrop \
+-	    -prune ! -perm -02111 \
+-	    -exec $WARN not set-gid or not owner+group+world executable: {} \;
+-
+ 	# Check non-Postfix root-owned directory tree owner/content.
+ 
+ 	for dir in bin etc lib sbin usr
+@@ -334,15 +293,6 @@
+ 
+ 	find corrupt -type f -exec $WARN damaged message: {} \;
+ 
+-	# Check for non-Postfix MTA remnants.
+-
+-	test -n "$check_shared_files" -a -f /usr/sbin/sendmail -a \
+-		-f /usr/lib/sendmail && {
+-	    cmp -s /usr/sbin/sendmail /usr/lib/sendmail || {
+-		$WARN /usr/lib/sendmail and /usr/sbin/sendmail differ
+-		$WARN Replace one by a symbolic link to the other
+-	    }
+-	}
+ 	exit 0
+ 	;;
+