Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hey got a problem i backuped up /usr /var with just cp -R then recreated the parition then moved back all the files, but i guess when i backuped it up it didnt preserve the originial rwx/ownership modes so now the rwxrwxrwx modes are all messed up, and i cant run certain programs, only root can and ive been using chmod u+s program without really knowing what setuid does till i just saw that it changes the process id as root so thats not good =/ so yeah i need to restore the orginail default values for /usr /var and all the subdirectories, does anyone know where i can that info from or possibly could someone post here a ls -al /usr and /var or any other ideas? thanks
Originally posted by dmx9595 hey got a problem i backuped up /usr /var with just cp -R then recreated the parition then moved back all the files, but i guess when i backuped it up it didnt preserve the originial rwx/ownership modes so now the rwxrwxrwx modes are all messed up, and i cant run certain programs, only root can and ive been using chmod u+s program without really knowing what setuid does till i just saw that it changes the process id as root so thats not good =/ so yeah i need to restore the orginail default values for /usr /var and all the subdirectories, does anyone know where i can that info from or possibly could someone post here a ls -al /usr and /var or any other ideas? thanks
I once came across this script, googling. It restores the permissions
on a file-system in Slack from the MANIFEST.gz file of your installation
CD ;)
Code:
#!/bin/sh
#smprms
#Create a script to restore the filesystem permissions from the MANIFEST (stdin)
#
about_text='
# Author: Cameron Kerr
# Email: cameron.kerr@paradise.net.nz
# Website: http://homepages.paradise.net.nz/~cameronk/
# Version: 27 August 2001'
if [ $# -ne 0 ]; then
echo "USAGE: zcat MANIFEST.gz | `basename $0` > /tmp/longscript.sh" >&2
echo " su - (if not root already)" >&2
echo " /tmp/longscript.sh" >&2
exit 255
fi
echo "#!/bin/sh"
echo "#This script was generated by `basename $0` from a Slackware MANIFEST.gz"
echo "#It will restore permissions to all files listed in the MANIFEST.gz,"
echo "#even files not there, so you might like to filter out 'not found'"
echo "#messages"
echo "#"
echo "#About the generator ${about_text}"
cat | sed -e '
/^++==*/d
/^||/d
/^ *$/d
/^[-dlcbps]/{
s/^\(.*\) \(.*\)\/\(.*[^ ]\) *.* .* .* *\(.*\)$/\
chown \2.\3 \/\4\
chmod PERM\1PERM \/\4/
/PERM.*PERM/{
s/PERM.\(...\)\(...\)\(...\)PERM/u=PERM\1PERM,g=PERM\2PERM,o=PERM\3PERM/
}
/PERM.*[^ ]PERM/{
s/-//g
}
s/PERM//g
}
'
It shouldn't be too hard to make it modify only the ones under a given
subdirectory...
hmm this is not good after running that script i now get permission denied for anyone other then root while trying to access basic programs like ls or touch but looking at the permissions of /bin and /bin/ls for example seem correct i have r and x permission for all users
damn this sucks i think i might actually wipe everything and reinstall slack, i was thinking of doing that before to install current instead of 9.1 so this might actually just push me to do that =/ i also wanted to try LFS first but looks like ill just reinstall slack probably
oh wait rather it was i couldnt ls or touch in the directories i was in, which i should be able to
true yeah i know its not like linux to just reinstall but this is a ugly problem cause all of /usr and /var permissions are messed up and i cant really track every file/dir one by one or something, not too sure what else to do
The alternative is not to re-install Slack but just reinstall all
packages. That will preserve all your settings, "new" versions of
config-files would be called xxx.new
mount slack-cdrom
upgradelpkg --reinstall /<cdrom>/slackware/*/*.tgz
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.