[Samba] Samba keeps resetting smbpasswd permissions

Jeremy Allison jra at samba.org
Fri Apr 11 17:05:55 GMT 2008


On Fri, Apr 11, 2008 at 02:19:02PM +0200, Martin v. Wittich wrote:
> 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 */
> #ifdef HAVE_FCHMOD
>     if(fchmod(fileno(fp), S_IRUSR|S_IWUSR) == -1) {
> #else
>     if(chmod(pfile, S_IRUSR|S_IWUSR) == -1) {
> #endif
>         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);
>         fclose(fp);
>         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

That's a little too heavyweight for what we need really. No one
ever complained about it before :-). I'd accept a patch to disable
that code with an option.

Jeremy.


More information about the samba mailing list