Samba users deleting root files with permission 775

Issues related to software problems.
Post Reply
burak
Posts: 11
Joined: 2010/05/31 15:10:09

Samba users deleting root files with permission 775

Post by burak » 2014/01/27 14:57:53

Hi,

I have a serious problem. I do not know if it was there all the time, but I noticed today.

The OS is 64 bit Centos 5.5 with Samba 3.0.33 running.
I have some files in a share the has root:root ownership and 775 permissions.
The files are inside a folder which is owned by a user. Normally since there is no write permission for the files, they should not be deleted by the user. However , they can be deleted from the windows client.
Only when I could prevent deletion by using chattr +i , but I do not want to use it.
What is wrong , is this a bug or am I missing something here?

Thanks,
Burak

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Samba users deleting root files with permission 775

Post by gerald_clark » 2014/01/27 15:09:02

The files write permission has nothing to do with it.
It is the write permissions of the directory that matter.
A file is created or deleted by writing in the directory.

burak
Posts: 11
Joined: 2010/05/31 15:10:09

Re: Samba users deleting root files with permission 775

Post by burak » 2014/01/29 13:42:42

Hi,

Thank you for the reply.

Is there any workaround, other then using chattr +i ?

What I am trying is to create some files in a user's folder that the user can not modify or delete in anyway.
Using chattr +i is also preventing me (as root) from modifying it. I have to chattr -i the file everytime I need to make a modification.

Thanks,
Burak

Post Reply