[4724] in Kerberos
Re: Kerberos getpwnam() equivalent...
daemon@ATHENA.MIT.EDU (Asokan)
Thu Mar 2 23:30:23 1995
To: kerberos@MIT.EDU
Date: Thu, 2 Mar 1995 13:47:50 GMT
From: nasokan@math.uwaterloo.ca (Asokan)
In article <3j2qrp$5li@news.bu.edu>, Frank Lonigro <franco@bu.edu> wrote:
>Hi:
> I'm looking for an easy way from inside a 'C' program I'm
>writing to find out if a "username" already exists in the kerberos
>database. Sort of like the Unix "getpwnam()" function but I don't need
>any data structure returned, only a "yes" or a "no" answer to the
>question "does username exist in kerberos".
>
> Sample code or pointers to the proper functions will be
>greatly appreciated.
>
>Thanks,
>-franco
>---
>Frank Lonigro Senior Systems Programmer
>franco@bu.edu Boston University/Office of Information Technology
In v4, check out the princ_exists() function in kadmin.c.
Basically, it tries to get a ticket for the principal with a dummy
passsword and checks to see if the return code is KDC_PR_UNKNOWN;
it returns yes/no/unsure. I guess you can use a similar approach in v5.
- Asokan