Hi... On Fri, Jul 10, 2009 at 11:35 PM, SandeepKsinha<sandeepksi...@gmail.com> wrote: > > > On Thu, Jul 9, 2009 at 11:45 PM, Adrian Cornish <adri...@cqg.com> 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 ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ