[K12OSN] PostSession script, rm command and user directories
Meelis
meelis at nlib.ee
Fri Dec 15 16:00:24 UTC 2006
Hi Petre !
This is the weird part of them all :
If I manually remove the directory everything is erased and no problems
occure.
Also if I make a seperate command for every dir and file in the script that
is not removed in the PostSession script they are erased.
For example :
rm -f /home/terminal1/.* <--- all files like .gnome etc. are removed
rm -f /home/terminal1/* <-- all regular files removed
rm -rf /home/terminal1/* <-- all directories that DO NOT contain files are
removed (note the -R parameter! weird ...)
So if a user creates a directory, then now I can remove it with the
PostSession script however if it contains files it's not removed. No problem
like that in old system.
permissions for terminal1 directory
***********************************************
drwx------ 19 terminal1 users 4096 13. dets 11:33 terminal1
***********************************************
it's the systems default permission set when I created a user.
I'll have to try the tar command with parameter -C tomorrow as I'm at home
now and have no access to my except terminal. So I can't test the
PostSession script :)
Meelis
---
meelis at nlib.ee
----- Original Message -----
From: "Petre Scheie" <petre at maltzen.net>
To: "Support list for open source software in schools." <k12osn at redhat.com>
Sent: Friday, December 15, 2006 5:34 PM
Subject: Re: [K12OSN] PostSession script, rm command and user directories
> Having occasionally run into problems with scripts that cd to a directory
> and then do something, but which create havoc when the cd part fails and
> so the next step fires off in the wrong directory, I like to specify the
> full path where the work should be done, all in the same command. So,
> rather than cd and then tar, I'd suggest this:
>
> rm -rf /home/terminal1
> tar -xv /usr/BACKUP/terminal1.tar -C /home
>
> This way, if /home were missing (which would have all sorts of other
> implications, but the principle is still valid), the tar won't happen and
> make a mess all over the root directory or elsewhere.
>
> As for root not being able to remove the directory that the user creates,
> something is amiss. What happens if root manually tries to remove the
> /home/terminal1 directory from the command line? What are the permissions
> on the files and directories that the user creates?
>
> Petre
More information about the K12OSN
mailing list