[Pkg-sysvinit-commits] r402 - in sysvinit/trunk/debian: . initscripts/etc/init.d

Thomas Hood jdthood-guest at costa.debian.org
Mon Dec 19 13:40:27 UTC 2005


Author: jdthood-guest
Date: 2005-12-19 13:40:26 +0000 (Mon, 19 Dec 2005)
New Revision: 402

Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs
Log:
Check for files under mountpoints more thoroughly

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2005-12-18 10:47:16 UTC (rev 401)
+++ sysvinit/trunk/debian/changelog	2005-12-19 13:40:26 UTC (rev 402)
@@ -1,4 +1,4 @@
-sysvinit (2.86.ds1-8~1) unstable; urgency=low
+sysvinit (2.86.ds1-8~2) unstable; urgency=low
 
   [ Petter Reinholdtsen ]
   * Upload to unstable  (Closes: #341075)
@@ -7,6 +7,7 @@
   * Last release also closes: #338736, #342160, #342744
   * Use /proc/mounts instead of /etc/mtab when unmounting  (Closes: #338801)
   * Override lintian warnings re: top-level dirs
+  * Check for files under mountpoints more thoroughly
 
  -- Thomas Hood <jdthood at yahoo.co.uk>  Sun, 18 Dec 2005 00:00:58 +0100
 

Modified: sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs	2005-12-18 10:47:16 UTC (rev 401)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/mountvirtfs	2005-12-19 13:40:26 UTC (rev 402)
@@ -42,6 +42,21 @@
 KERNEL="$(uname -s)"
 umask 022
 
+
+# $1: directory
+is_empty_dir() {
+	for FILE in $1/* $1/.*
+	do
+		case "$FILE" in
+		  "$1/.*") return 0 ;;
+		  "$1/*"|"$1/."|"$1/..") continue ;;
+		  *) return 1 ;;
+		esac
+	done
+	return 0
+}
+
+
 # $1: file system type
 # $2: alternative file system type (or empty string if none)
 # $3: mount point
@@ -114,7 +129,7 @@
 			mount -f -t $TYPE $OPTS $4 $TYPE $MTPT
 		fi
 	else
-		[ "$(echo $MTPT/*)" != "$MTPT/*" ] && log_warning_msg "Files under mount point '$MTPT' will be hidden."
+		is_empty_dir "$MTPT" >/dev/null 2>&1 || log_warning_msg "Files under mount point '$MTPT' will be hidden."
 		mount $MOUNT_N -t $TYPE $OPTS $4 $TYPE $MTPT
 	fi
 }




More information about the Pkg-sysvinit-commits mailing list