From c0841ca57c76621111ed163448a0625c8c9c3256 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Fri, 19 Aug 2005 00:37:34 +0000 Subject: [PATCH] * Detect AFS caches on non-ext2/ext3 file systems and abort AFS client initialization. (Closes: #249315) --- debian/changelog | 2 ++ debian/openafs-client.init | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8cdb4d293..5e81cf8f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ openafs (1.3.87-2) unstable; urgency=low dynroot. afs-newcell generates the server CellServDB directly to work around oddities with bos addhost. Thanks to Fahemm Mitha and Sergio Gelato for analysis and patches. (Closes: #322638) + * Detect AFS caches on non-ext2/ext3 file systems and abort AFS client + initialization. (Closes: #249315) * Redo how library object files are found for the PAM module build to avoid assuming C locale character set behavior. (Closes: #323582) * Remove the openafs-client warning against dynroot for the first system diff --git a/debian/openafs-client.init b/debian/openafs-client.init index a271fbfce..ce8caad88 100755 --- a/debian/openafs-client.init +++ b/debian/openafs-client.init @@ -121,6 +121,21 @@ choose_afsd_options() { fi } +# Make sure that the cache file system type is ext2 or ext3. No other file +# system is supported for the cache, and generally bad things happen if a +# different one is used. +check_cache_fstype() { + CACHEPATH=`awk -F: '{print $2}' < /etc/openafs/cacheinfo` + FSTYPE=`stat -f -c '%T' "$CACHEPATH"` + if [ x"$FSTYPE" != x"ext2/ext3" ] ; then + echo "" + echo "ERROR: AFS cache at $CACHEPATH is on a $FSTYPE file system" >&2 + echo "ERROR: Only ext2 or ext3 may be used for an AFS cache" >&2 + echo "Aborting startup of AFS" >&2 + exit 1 + fi +} + # Start afsd. Be careful not to start it if another one is already running, # as that has a bad tendency to hang the system. start_client() { @@ -128,6 +143,7 @@ start_client() { echo "." else choose_afsd_options + check_cache_fstype echo " afsd." start-stop-daemon --start --quiet --exec /usr/sbin/afsd \ -- $AFSD_OPTIONS -- 2.39.5