Unbecome Root in VFS Module

Jeremy Allison jra at samba.org
Thu Jan 6 02:41:54 UTC 2022


On Wed, Jan 05, 2022 at 02:56:58PM -0700, Orion via samba-technical wrote:
>Hello,
>
>While adding NFS RQUOTA V2 support to Samba, the request is being made 
>as root and is thus root squashed by the server and fails.
>
>The reason for the issue is source3/smbd/quotas.c executing 
>become_root() before calling the VFS module.
>
>I tried calling unbecome_root() within the module, but it did not 
>work.

It most certainly should work - if you notice, it's
very common for Samba to do:

become_root()
... do privileged operation..
unbecome_root()

>Is there another way to change back to normal UID/GID from 
>within the VFS module?

Explain "but it did not work" more completely please :-).



More information about the samba-technical mailing list