[Samba] Can't change directory owner

Rowland Penny rpenny at samba.org
Tue Feb 7 17:08:08 UTC 2023



On 07/02/2023 15:35, Andrea Cucciarre wrote:
> Hello Rowland,
> 
> If has_restore_priv is true it runs SMB_VFS_FCHOWN as root:

Yes you are correct, I do not write 'C' and read it just a bit more :-D

> 
> ====
>    if (has_take_ownership_priv || has_restore_priv) {
> status = NT_STATUS_OK;
> become_root();
> ret = SMB_VFS_FCHOWN(fsp, uid, gid);
> if (ret != 0) {
> status = map_nt_error_from_unix(errno);
> }
> unbecome_root();
> return status;
> ====

The problem is that it should (by my reading) return either 
'NT_STATUS_OK' or what 'map_nt_error_from_unix(errno)' would return and 
as far as I can see, that cannot return 'NT_STATUS_INVALID_OWNER'

To me, this looks like,for some reason, the users restore privilege is 
being ignored, that block of code is being ignored and it is dropping 
down to the block of code where the user supplied is checked against the 
actually user that is connected and if they do not match, then you get 
the message 'NT_STATUS_INVALID_OWNER'.

> 
> It' Solaris Unix.
> 
>
What version of Samba is this ?

Rowland




More information about the samba mailing list