Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1491830
 поиск   регистрация   авторизация 
 
Группа :: Система/Серверы
Пакет: postfix

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: postfix-2.2.9-alt-check.patch


--- postfix-2.2.9/conf/postfix-script.orig	2005-02-04 01:05:21 +0000
+++ postfix-2.2.9/conf/postfix-script	2006-03-17 01:04:55 +0000
@@ -69,6 +69,23 @@ cd $queue_directory || {
 	exit 1
 }
 
+print_unknown_params()
+{
+	local cf="$config_directory/main.cf"
+	[ -s "$cf.params" ] || return
+
+	local p="$(sed -ne 's/^\([^[:space:]=#]\+\)[[:space:]]*=.*/\1/p' "$cf" |
+		LC_COLLATE=C sort -u |
+		LC_COLLATE=C comm -23 - "$cf.params" |
+		tr '\n' ' ' |
+		sed -e 's/ $//' -e 's/ /,&/g')"
+	if [ -n "$p" ]; then
+		local s=
+		[ -n "${p##* *}" ] || s=s
+		$WARN "$cf: unknown parameter$s: $p"
+	fi
+}
+
 #
 # Parse JCL
 #
@@ -214,11 +231,11 @@ check-warn)
 		-exec $WARN not owned by $mail_owner: {} \;
 
 	find $queue_directory/public $queue_directory/maildrop \
-	    $command_directory/postqueue $command_directory/postdrop \
+	    $daemon_directory/postqueue/postqueue $command_directory/postdrop \
 	    -prune ! -group $setgid_group \
 	    -exec $WARN not owned by group $setgid_group: {} \;
 
-	find $command_directory/postqueue $command_directory/postdrop \
+	find $daemon_directory/postqueue/postqueue $command_directory/postdrop \
 	    -prune ! -perm -02111 \
 	    -exec $WARN not set-gid or not owner+group+world executable: {} \;
 
@@ -239,10 +256,15 @@ check-warn)
 	do
 		test -d $dir && find $dir -type f -print | while read path
 		do
-			test -f /$path && {
-			    cmp -s $path /$path || 
-				$WARN $queue_directory/$path and /$path differ
-			}
+			if [ -e "/$path" ]; then
+				cmp -s "$path" "/$path" || 
+				    $WARN "$queue_directory/$path and /$path differ"
+			elif [ -e "/usr/$path" ]; then
+				cmp -s "$path" "/usr/$path" || 
+				    $WARN "$queue_directory/$path and /usr/$path differ"
+			else
+				$WARN "$queue_directory/$path has no original source"
+			fi
 		done
 	done
 
@@ -256,6 +278,7 @@ check-warn)
 		$WARN Replace one by a symbolic link to the other
 	    }
 	}
+	print_unknown_params
 	exit 0
 	;;
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005