Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems with mount... (bug) ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
m.b.j.
Guru
Guru


Joined: 12 Sep 2003
Posts: 407
Location: Germany (Essen)

PostPosted: Wed Jul 21, 2004 5:25 pm    Post subject: Problems with mount... (bug) ? Reply with quote

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
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Thu Jul 22, 2004 3:59 am    Post subject: Reply with quote

Code:
chown -R someuser dir*

makes the directories dir1 and dir2 and their contents owned by someuser.

Since you
Code:
su someuser

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
View user's profile Send private message
m.b.j.
Guru
Guru


Joined: 12 Sep 2003
Posts: 407
Location: Germany (Essen)

PostPosted: Thu Jul 22, 2004 9:32 am    Post subject: Reply with quote

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
View user's profile Send private message
jdgill0
Veteran
Veteran


Joined: 25 Mar 2003
Posts: 1366
Location: Lexington, Ky -- USA

PostPosted: Thu Jul 22, 2004 2:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum