wrong error checking in kprop.c (bug?)

Ludek Finstrle ludek.finstrle at pzkagis.cz
Tue Oct 9 05:36:14 EDT 2007


Hello again,

  I've found the reason of the problem. It's simple reproducible
on linux with
chattr +i /etc/krb5.conf
(or some another way to disable write access to the file).

Regards,

Luf

Tue, Oct 09, 2007 at 09:38:29AM +0200, Ludek Finstrle napsal(a):
> Hello,
> 
>   suddenly I get "database locked" from kprop since there is no lock
> on the dump (even strace show fcntl returns 0 - success).
> I found the problem in src/slave/krpop.c. There are these lines:
> 
> err = krb5_lock_file(context, fd,
>     KRB5_LOCKMODE_SHARED|KRB5_LOCKMODE_DONTBLOCK);
> if (err == EAGAIN || err == EWOULDBLOCK || errno == EACCES) {
>     com_err(progname, 0, "database locked");
>     exit(1);
> } else if (err) {
>     com_err(progname, err, "while trying to lock '%s'", dbpathname);
>     exit(1);
> }	    
> 
> There is errno instead of err in the if statement. I see the same
> problem in ftp://athena-dist.mit.edu/pub/kerberos/dist/vaporware-r-us/krb5-1.6-current.tar.gz too.
> 
> Please could someone fix the problem? I'm unable to use krb5-send-pr
> due to problems.
> 
> If you want more information, please contact me directly as I'm not list
> member.
> 
> Thanks,
> 
> Ludek Finstrle
> 
> P.S. I'm going to trace down why krb5_init_context returns 0 and set
>   errno to EACCESS.



More information about the Kerberos mailing list