[Samba] chmod of smbpasswd file

Jeremy Allison jra at samba.org
Fri Jan 12 17:43:49 UTC 2024


On Fri, Jan 12, 2024 at 07:17:36AM +0000, Jones Syue 薛懷宗 via samba wrote:
>> It's an easy fix to remove it. Just raise a bug, submit a merge and I'll get it
>> reviewed and pushed.
>>
>> Probably best thing to do is change this to do an fstat and
>> log a warning message if 'rw' is set for anything other than
>> owner.
>
>https://bugzilla.samba.org/show_bug.cgi?id=15555
>Filed a bug and a patch is proposed: add fstat() to bypass [f]chmod() if
>the password file has valid permissions 0600.
>
>We had a similar case before,
>a bit different is the password file is resident on a writable ext3/ext4,
>and contantly [f]chmod() might have a performance impact on entry-level
>systems since dirty pages syncing is expensive, hope this helps :)

Thanks a lot Jones. I did a minor change to
your code and pushed a version without the
goto to the MR :-). Let me know if you're
happy with that.



More information about the samba mailing list