View previous topic :: View next topic |
Author |
Message |
m.b.j. Guru
Joined: 12 Sep 2003 Posts: 407 Location: Germany (Essen)
|
Posted: Wed Jul 21, 2004 5:25 pm Post subject: Problems with mount... (bug) ? |
|
|
The situartion:
(as root)
Code: |
cd home/someuser #Could be an other non root users usabel Place!
mkdir dir1 # Creating the dirs fir mount --bind
mkdir dir2 # ...
touch dir1/testfile
chown -R someuser dir*
mount --bind -r dir1/ dir2/ # Want to have appear the things from dir1 in dir2 readonly.....
su somesuser # Checking the situration as a normal user.....
cd dir2 # .....
rm testfile # It works anything wrong with my system?
|
This ist just a question Im not very good with linux, but should a mount by root with readonly option allow to remove|change the mounted files by users, I do not think so......, (Ok the source files are owned by the user) could anybody explain? _________________ root@mbj # echo "sys-pizza/calzone -tunfish" >> /etc/paludis/use.conf
root@mbj # paludis -i calzone --dl-blocks discard |
|
Back to top |
|
|
jdgill0 Veteran
Joined: 25 Mar 2003 Posts: 1366 Location: Lexington, Ky -- USA
|
Posted: Thu Jul 22, 2004 3:59 am Post subject: |
|
|
Code: | chown -R someuser dir* |
makes the directories dir1 and dir2 and their contents owned by someuser.
Since you
you can do what you want with those files and directories.
[edit]
as for the r mount option , it could be the --bind option causes mount to ignore it. |
|
Back to top |
|
|
m.b.j. Guru
Joined: 12 Sep 2003 Posts: 407 Location: Germany (Essen)
|
Posted: Thu Jul 22, 2004 9:32 am Post subject: |
|
|
Ok, i have to try an other way to let my users use some progs readonly inside a chroot, thx for the reply! _________________ root@mbj # echo "sys-pizza/calzone -tunfish" >> /etc/paludis/use.conf
root@mbj # paludis -i calzone --dl-blocks discard |
|
Back to top |
|
|
jdgill0 Veteran
Joined: 25 Mar 2003 Posts: 1366 Location: Lexington, Ky -- USA
|
Posted: Thu Jul 22, 2004 2:21 pm Post subject: |
|
|
You could try the following. It might not be the best or most elegant solution, but it would work.
Go ahead and mount --bind like you were doing. Instead of making the files owned by someuser:users, make them owned by root:users, i.e. chown -R root:users dir2. By default the files and subdirectories of dir2 should be read-only for group users.
[edit]
I just realized setting permissions on dir2/ will also set the permissions on dir1/. So you could do chown -R root:users dir1, then do [i]mount --bind dir1/ dir2/[i]. |
|
Back to top |
|
|
|