Anyone resolved "failed to lock SMB passwd file"?
Fulvio Corno
Fulvio.Corno at polito.it
Thu Oct 29 12:58:37 GMT 1998
Robert,
thank you for the very useful insight.
Robert Dahlem wrote:
> Samba locks smbpasswd when it runs with "update encryted = yes" and does not find
> the user to be updated in smbpasswd. Make sure you have *all* users in smbpasswd
> and the problem will disappear.
Indeed, it seems fixed now.
> Perhaps someone has a bit of spare time to proove this and report to samba-bugs. I
> feel discouraged to do so because I reported several problems and never got
> something back but the machine generated reply to be patient ...
I found the (possible) source of the error, in smbpass.c line 620+
/* We have a write lock on the file. */
/*
* Scan the file, a line at a time and check if the name matches.
*/
while (!feof(fp))
{
....omissis....
}
if (!found_entry) return False; /* line 707 */
If no entry is found, the procedure returns without releasing the lock.
I modified the last statement as:
if (!found_entry) /* line 707 */
{
fclose(fp);
pw_file_unlock(lockfd);
return False;
}
as it appears in other parts of the code. For now, it seems to have
corrected the problem.
thanks again, and happy sambing
Fulvio
More information about the samba
mailing list