[Samba] Samba keeps resetting smbpasswd permissions

Martin v. Wittich martin.von.wittich at iserv.eu
Fri Apr 11 12:19:02 GMT 2008

Volker Lendecke wrote:
> On Fri, Apr 11, 2008 at 11:58:12AM +0200, Martin v. Wittich wrote:
>> Is there a way to stop Samba from modifying the smbpasswd permissions? I
>> already googled and looked through the Samba manpages, but I can't
>> really find a solution.
> There is none, sorry.

Oh, I see... I've looked into the Samba source.
source/passdb/pdb_smbpasswd.c, in function startsmbfilepwent from line 317:

    /* Make sure it is only rw by the owner */
    if(fchmod(fileno(fp), S_IRUSR|S_IWUSR) == -1) {
    if(chmod(pfile, S_IRUSR|S_IWUSR) == -1) {
        DEBUG(0, ("startsmbfilepwent_internal: failed to set 0600
permissions on password file %s. \
Error was %s\n.", pfile, strerror(errno) ));
        pw_file_unlock(fileno(fp), lock_depth);
        return NULL;

Are there any plans to remove that code or at least make in
configurable? For example, there could be options like this in the
smb.conf file:

smb passwd owner = root
smb passwd group = freerad
smb passwd mode = 640

Martin v. Wittich

More information about the samba mailing list