[tpm] using getpwnam() on a system with LDAP
J. Bobby Lopez
jbl at jbldata.com
Thu Jan 27 21:58:06 PST 2011
Actually, no - I'm trying to get the usernames/groupnames when I
provide a uid/gid. Doesn't work as expected because accounts are
provided via LDAP.
-Bobby
On 1/27/11, Indy Singh <indy at indigostar.com> wrote:
>> When I do a getpwnam() on a UID, it reports the username/group as 'file'.
> I think you should be calling getpwuid. Is that what you meant to say?
>
> Indy Singh
> IndigoSTAR Software -- www.indigostar.com
>
> ----- Original Message -----
> From: J. Bobby Lopez
> To: Toronto Perl Mongers
> Sent: Thursday, January 27, 2011 4:52 PM
> Subject: [tpm] using getpwnam() on a system with LDAP
>
>
> I've got a system that serves as an LDAP client, so there are many
> files/dirs with uid/gid information retrieved from LDAP.
>
> When I do a getpwnam() on a UID, it reports the username/group as 'file'.
>
> Is there any way to do the translation from UID to LDAP username without
> loading LDAP modules? I'm guessing if 'ls' shows the correct name, there
> must be some system call I can use to pull the same info.
>
> Any insights?
>
> Thanks,
> Bobby
>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm
>
More information about the toronto-pm
mailing list