Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Writeable yet undeletable Samba share? [Partially solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Elembis
n00b
n00b


Joined: 10 Jun 2003
Posts: 9

PostPosted: Tue Apr 05, 2005 1:58 am    Post subject: Writeable yet undeletable Samba share? [Partially solved] Reply with quote

For a fileserver I'm building, I'd like to have a public share so people can easily contribute their data without an administrator (me) needing to be on the scene. However, I'd also like to eliminate the possibility of a malicious guest rapidly deleting the product of hours (perhaps days) of uploading. As far as I know, doing this would mean monitoring traffic to the share and changing each file's permissions as they were added.

It'd be easy to get a script to change the permissions of everything in the guest share every X minutes, but someone could simply refresh the share repeatedly and delete any files before the script got around to protecting them. With this in mind, is it even possible for a script to be fast enough? If it is feasable, how might I go about scripting it? (I.e., how would I monitor the incoming traffic, and how would I pick out specific files?) It'd be nice if there were a way of setting "write" permissions to something like "add nomodify nodelete", but I don't think this is possible.

Thanks.

Update: That was easy. I found and experimented with Samba's "directory mask" and "create mask" options, and they do exactly what I want. I first thought setting each to 444 would work, but a directory with those permissions can't be filled, so I set them to 744 and 444, respectively. Note that if the share itself is writeable, these masks won't ever prevent a user from writing to it, because they only take effect once a file or directory is written.

Perfect.

Update 2: Oops. Written data can be renamed. It can't be deleted, and that's a good thing, but it can still be messed up. Even if I create a file in the public share as root and "chmod 000" it, any guest can rename it. Help?
Back to top
View user's profile Send private message
donjuan
l33t
l33t


Joined: 11 May 2004
Posts: 760
Location: At Uni

PostPosted: Tue Apr 05, 2005 4:52 am    Post subject: Reply with quote

Something like the drop boxes my university uses would probably work. All you do is give everybody write permission but don't give them read and execute permission. That way they can't find out what's in there.
_________________
Command-line ACCEPT_KEYWORDS is considered harmful, use the package.* files.

The Stage 1 on 3 Install
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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