SMB3 POSIX and deleting files with FILE_ATTRIBUTE_READONLY

Tom Talpey tom at talpey.com
Thu Apr 10 05:23:50 UTC 2025


On 4/9/2025 9:06 PM, Ralph Boehme wrote:
> On 4/9/25 8:43 PM, Steve French wrote:
>> On Wed, Apr 9, 2025 at 1:18 PM Ralph Boehme <slow at samba.org> wrote:
>>> what should be the behavior with SMB3 POSIX when a POSIX client tries to
>>> delete a file that has FILE_ATTRIBUTE_READONLY set?
>>>
>>> The major question that we must answer is, if this we would want to
>>> allow for POSIX clients to ignore this in some way: either completely
>>> ignore it on POSIX handles or first check if the handle has requested
>>> and been granted WRITE_ATTRIBUTES access.
>>
>> I agree that to delete a file with READ_ONLY set should by default 
>> require
>> WRITE_ATTRIBUTES (and delete)

Since when does Posix require this?? All that's required is that the
/directory/ is writable. The rm command will prompt if the /file/ is not
writable, but the unlink(2) itself is not denied.

https://pubs.opengroup.org/onlinepubs/9799919799/

Tom.

> 
> delete will be checked the usual way, so nothing special there.
> 
>> permission (better to be safe
>> in restricting a potential dangerous operation).
> 
> yes, that was my thought as well.
> 
>>
>> But this is a good question ...
> 
> That's why I brought it up :)))
> 
> Thanks!
> -slow
> 
> 




More information about the samba-technical mailing list