0
Assume am in directory /home/userA
There is an environment variabe $XMLFILES that points to /u/xml/xmlfiles. The $XMLFILES environment variable is in userA's environment/profile
I log on as userA then 'su' into userB and i cd into /home/userB/testdata.
I didnt realise that i was userB so i issued the command
rm $XMLFILES/*
And suddenly i see this
bash-3.00$ rm $XMLFILES/*
rm: /bin not removed: Permission denied
rm: /boot is a directory
rm: /cdrom is a directory
rm: /dev is a directory
rm: /devices is a directory
rm: /etc is a directory
rm: /export is a directory
rm: /home is a directory
rm: /kernel is a directory
rm: /lib is a directory
rm: /lost+found is a directory
rm: /mnt is a directory
rm: /net is a directory
rm: /noffprotect: override protection 644 (yes/no)? ^C
I pressed [CTRL+C] as soon as i saw that override protection message. I think since $XMLFILES was null because i was logged on as userB the command that was issued was actually
rm *
Now what i dont understand is why did it try tro delete everything from the root folder? since i was in /home/userB, should it have just tried to delete everything in 'top level of '/home/userB'? the rm command was not even a recursive delete.
Given that the user i was logged on as was not the root user, would this have caused any damage?
But there was no / when i issued the command. Shouldnt it have converted to rm * rather than rm /* – ziggy – 2010-11-13T19:02:17.803
The
/
is right there, in between the$XMLFILES
and the*
. – Ignacio Vazquez-Abrams – 2010-11-13T19:03:05.263Ok i see it. Its the / before the *. Stupid me. – ziggy – 2010-11-13T19:03:09.580
Do you think this would have caused any damage even though i was not logged on as root? – ziggy – 2010-11-13T19:03:32.137
1No, since no normal user is supposed to have write access to
/
regardless. – Ignacio Vazquez-Abrams – 2010-11-13T19:04:22.750