Re: uid and gid ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi...

On Fri, Jul 10, 2009 at 11:35 PM, SandeepKsinha<sandeepksinha@xxxxxxxxx> wrote:
>
>
> On Thu, Jul 9, 2009 at 11:45 PM, Adrian Cornish <adrianc@xxxxxxx> wrote:
>>
>> Is there any inbuilt( ) c function which can validate if the passed
>> uid/gid exist's on the machine or not?
>> How about:-
>> struct passwd *getpwuid(uid_t uid);
>
> Thanks, but any for validating the gid ????

I think one of the way to do that is by calling getpwent() several
times until it returns NULL (meaning it hits the last record of
/etc/passwd). getpwent()  returns passwd struct and gid is in there.

What do you think? man getpwent for further info...

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux