Please forgive me, I know *VERY* little about C... I can hack out enough to do what I need to do for the most part but I'm absolutely lost on a project I need to finish.

I am writing a wrapper for common RHEL commands so that our helpdesk technicians can assist the SAs in day to day functions and the part I am stuck at is the passwd command. What I need to do is evaluate group memberships for the specified username. The end goal is for the program to terminate if they attempt to change the password for any member of the wheel group. I've narrowed it down to getgrouplist() but have no clue how to use this properly in my code. If someone could provide a snippet to evaluate a specified username and fail they are a member of wheel (gid 10) or continue on ( i.e. printf("Success!"); ) if it returns false I would greatly appreciate it.

Thanks in advance!

I managed to achieve what I was looking for through PERL. Not what I wanted but it's tolerable. Thanks for looking however.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.