Error "File exists" from krb5_init_context

Curtis Robinson curtis at
Wed May 15 13:19:00 EDT 2002

I went threw the code by hand and I think I found the problem.

Environment:  uname -a
SunOS sword 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Blade-100
gcc -v
gcc version 2.95.3 20010315 (release)

In src/util/profile/prof_file.c, the function ,errcode_t
profile_update_file(prf), uses the stat command.  But, for some reason
it reports that a success is a failure:
        if (stat(prf->filespec, &st))
                return errno;

I got the man page telling me that on a success stat returns 0 and
a failure returns -1, so this statement will always be false.  So, I did
        if (stat(prf->filespec, &st) != 0)
                return errno;

And, the function is still bailing out and reporting file exists
So, any suggestions would be helpful.

On Tue, May 14, 2002 at 11:16:23AM -0400, eichin-krb at wrote:
> A common problem with debugging kerberos errors is that the
> com_err/errno value only gives you "what", and you really need "where"
> as well... ie. "what were you doing when that broke".  If you're on a
> platform with ltrace, I'd suggest trying it, to see what krb5 library
> call was in progress (*within* krb5_init_context) when you got that
> error; if not, at least try a truss or ktrace and see what syscall
> returned EEXIST, and see why it might have failed... 
> However, a quick look (with emacs and etags -- rigor would need a real
> call graph, and you can do that yourself, probably with a debugger
> handy) at krb5_init_context shows it can return, even including
> children:
> any errno from gettimeofday
> I don't see any other obvious returns -- most things init does either
> can't fail, or the failure is not reported (due to not being important
> at that time), or the failure is translated as above...
> _______________________________________________
> krbdev mailing list             krbdev at

Curtis Robinson
crobinso at

More information about the krbdev mailing list