Thanks Indy for setting me straight off-list. I got the two functions getpwuid() and getpwnam() mixed up. Will give it another go.<br><br><div class="gmail_quote">On Fri, Jan 28, 2011 at 12:58 AM, J. Bobby Lopez <span dir="ltr"><<a href="mailto:jbl@jbldata.com">jbl@jbldata.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Actually, no - I'm trying to get the usernames/groupnames when I<br>
provide a uid/gid. Doesn't work as expected because accounts are<br>
provided via LDAP.<br>
<font color="#888888"><br>
-Bobby<br>
</font><div><div></div><div class="h5"><br>
On 1/27/11, Indy Singh <<a href="mailto:indy@indigostar.com">indy@indigostar.com</a>> wrote:<br>
>> When I do a getpwnam() on a UID, it reports the username/group as 'file'.<br>
> I think you should be calling getpwuid. Is that what you meant to say?<br>
><br>
> Indy Singh<br>
> IndigoSTAR Software -- <a href="http://www.indigostar.com" target="_blank">www.indigostar.com</a><br>
><br>
> ----- Original Message -----<br>
> From: J. Bobby Lopez<br>
> To: Toronto Perl Mongers<br>
> Sent: Thursday, January 27, 2011 4:52 PM<br>
> Subject: [tpm] using getpwnam() on a system with LDAP<br>
><br>
><br>
> I've got a system that serves as an LDAP client, so there are many<br>
> files/dirs with uid/gid information retrieved from LDAP.<br>
><br>
> When I do a getpwnam() on a UID, it reports the username/group as 'file'.<br>
><br>
> Is there any way to do the translation from UID to LDAP username without<br>
> loading LDAP modules? I'm guessing if 'ls' shows the correct name, there<br>
> must be some system call I can use to pull the same info.<br>
><br>
> Any insights?<br>
><br>
> Thanks,<br>
> Bobby<br>
><br>
><br>
><br>
> ------------------------------------------------------------------------------<br>
><br>
><br>
> _______________________________________________<br>
> toronto-pm mailing list<br>
> <a href="mailto:toronto-pm@pm.org">toronto-pm@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/toronto-pm" target="_blank">http://mail.pm.org/mailman/listinfo/toronto-pm</a><br>
><br>
</div></div></blockquote></div><br>