Re: uid and gid ?

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

 



HI,


On Sat, Jul 11, 2009 at 7:45 AM, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
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...

Thanks. That woked out for me. Also, getgroups( ) worked in a similar manner for me.
 

--
regards,

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



--
Regards,
Sandeep.






“To learn is to change. Education is a process that changes the learner.”

[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