[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FIX: World-writeable files repair script



Ok, thanks for all the feedback on this one... 

Here's a script that should fix all the mis-permed files that may be
lurking out there...  Sending this out now to get feedback before I
unleash it on the world at large.

I'll probably re-spin the installer, but only with a quick tweak to
anaconda to squash this bug.  I really can't go down the path of fixing
all the buglets that have turned up since 1.0.1.  Those will get fixed
in the next "real" release.

-Eric


-- 
Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs
sandeen@sgi.com   SGI, Inc.
#!/bin/bash

echo
echo "This script will change permissions on many system config files."
echo "These files were set wrong during install due to a generic"
echo "kernel bug in 2.4.3."
echo
echo -n "Continue? (Y/N) "

read continue

case "$continue" in
	"Y" | "y" )
	;;

	* )
	echo "Ok, but you really should fix this... please take a look at the script"
	exit 
	;;
esac

FILES="/boot/initrd-2.4.3-SGI_XFS_1.0.1smp.img
/boot/initrd-2.4.3-SGI_XFS_1.0.1.img
/etc/sysconfig/i18n
/etc/sysconfig/mouse
/etc/sysconfig/keyboard
/etc/sysconfig/network
/etc/sysconfig/clock
/etc/sysconfig/desktop
/etc/sysconfig/hwconf
/etc/X11/XF86Config
/etc/X11/XF86Config-4
/etc/ld.so.conf
/etc/shells
/etc/syslog.conf
/etc/rndc.conf
/etc/resolv.conf
/etc/sgml/sgml-docbook-3.0.cat
/etc/sgml/catalog
/etc/sgml/sgml-docbook-3.1.cat
/etc/sgml/sgml-docbook-4.0.cat
/etc/sgml/sgml-docbook-4.1.cat
/etc/sgml/xml-docbook-4.1.cat
/etc/pango/pango.modules
/etc/hosts
/usr/share/doc/libtool-1.3.5/demo/config.h.in
/usr/share/fonts/default/TrueType/fonts.scale
/usr/share/fonts/fontmap
/usr/share/texmf/web2c/jadetex.log
/usr/share/texmf/web2c/pdfjadetex.log
/usr/share/texmf/web2c/jadetex.fmt
/usr/share/texmf/web2c/pdfjadetex.fmt
/usr/lib/mozilla/chrome/overlayinfo/communicator/content/overlays.rdf
/usr/lib/mozilla/chrome/overlayinfo/navigator/content/overlays.rdf
/usr/lib/mozilla/chrome/overlayinfo/messenger/content/overlays.rdf
/usr/lib/mozilla/chrome/overlayinfo/editor/content/overlays.rdf
/usr/lib/mozilla/chrome/all-packages.rdf
/usr/lib/mozilla/chrome/all-locales.rdf
/usr/lib/mozilla/chrome/all-skins.rdf
/usr/lib/mozilla/chrome/user-skins.rdf
/usr/lib/mozilla/chrome/user-locales.rdf
/usr/lib/mozilla/component.reg"

DIRS="/etc/sysconfig
/usr/lib/mozilla/chrome/overlayinfo"

# Fix files...
echo
echo "Fixing permissions on files:"

for FILE in $FILES
do
	if [ -e $FILE ]
	then
		echo "Setting $FILE to 644"
		chmod 644 $FILE
	fi
done

# And directories...
echo
echo "Fixing permissions on directories:"

for DIR in $DIRS
do
	if [ -e $DIR ]
	then
		echo "Setting $DIR/ to 755"
		chmod 755 $DIR
	fi
done

echo
echo "Done"