Ispravke vezane za provjeru ispravnosti konfiguracije. etch
authorDragan Dosen <bane@nekkar.carnet.hr>
Tue, 19 May 2009 20:02:42 +0000 (22:02 +0200)
committerDragan Dosen <bane@nekkar.carnet.hr>
Tue, 19 May 2009 20:02:42 +0000 (22:02 +0200)
debian/postinst

index b6ff377..7e01fae 100644 (file)
@@ -182,29 +182,41 @@ if [ -n "$services_file_list" ]; then
                service_user="`echo "$service_block" | sed -nr "s/^[[:space:]]*user[[:space:]]*=[[:space:]]*(.*)[[:space:]]*$/\1/p"`"
                if [ -n "$service_user" ]; then
 
-                   service_user_chk="`getent passwd "$service_user"`" || true
-                   if [ -z "$service_user_chk" ]; then
-                       cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - user '$service_user' does not exist."
-                       service_disable=1
-                   fi
+                   for service_user_x in $service_user; do
+                       service_user_chk="`getent passwd $service_user_x`" || true
+                       if [ -z "$service_user_chk" ]; then
+                           cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - user '$service_user_x' does not exist."
+                           service_disable=1
+                           break
+                       fi
+                   done
                fi
 
                # Check service's group
                service_group="`echo "$service_block" | sed -nr "s/^[[:space:]]*group[[:space:]]*=[[:space:]]*(.*)[[:space:]]*$/\1/p"`"
                if [ -n "$service_group" ]; then
 
-                   service_group_chk="`getent passwd "$service_group"`" || true
-                   if [ -z "$service_group_chk" ]; then
-                       cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - group '$service_group' does not exist."
-                       service_disable=1
-                   fi
+                   for service_group_x in $service_group; do
+                       service_group_chk="`getent passwd $service_group_x`" || true
+                       if [ -z "$service_group_chk" ]; then
+                           cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - group '$service_group_x' does not exist."
+                           service_disable=1
+                           break
+                       fi
+                   done
                fi
 
                # Check service's binary
                service_server="`echo "$service_block" | sed -nr "s/^[[:space:]]*server[[:space:]]*=[[:space:]]*(.*)[[:space:]]*$/\1/p"`"
-               if [ -n "$service_server" ] && [ ! -x "$service_server" ]; then
-                   cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - server '$service_server' does not exist."
-                   service_disable=1
+               if [ -n "$service_server" ]; then
+
+                   for service_server_x in $service_server; do
+                       if [ ! -x "$service_server_x" ]; then
+                           cp_echo "CN: Error in /etc/xinetd.d/$services_file for service '$service' - server '$service_server_x' does not exist."
+                           service_disable=1
+                           break
+                       fi
+                   done
                fi
 
                if [ $service_disable -eq 1 ]; then