[tpm] using getpwnam() on a system with LDAP
J. Bobby Lopez
jbl at jbldata.com
Fri Jan 28 07:06:05 PST 2011
Thanks Indy for setting me straight off-list. I got the two functions
getpwuid() and getpwnam() mixed up. Will give it another go.
On Fri, Jan 28, 2011 at 12:58 AM, J. Bobby Lopez <jbl at jbldata.com> wrote:
> 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
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20110128/f095dcd4/attachment.html>
More information about the toronto-pm
mailing list