LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-12-2011, 01:44 PM   #1
Mikey0727
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Rep: Reputation: 0
C++ determine if current user is member of a specific group -


Hi All -

What functions are available on linux for a c++ program to determine if the current user is a member of a specific user group?

Thanks -
 
Old 01-12-2011, 01:55 PM   #2
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
man 2 getgid
 
Old 01-13-2011, 10:09 AM   #3
Mikey0727
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Original Poster
Rep: Reputation: 0
actually, what I needed was getgroups, but looking at getgid led me the answer, thanks-
 
Old 01-13-2011, 10:21 AM   #4
dwhitney67
Senior Member
 
Registered: Jun 2006
Location: Maryland
Distribution: Kubuntu, Fedora, RHEL
Posts: 1,541

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by Mikey0727 View Post
actually, what I needed was getgroups, but looking at getgid led me the answer, thanks-
I'm glad you found your answer. I personally hadn't heard of getgroups() until today.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to kill pids for all sessions for a specific user except their current one? jasonws Programming 3 10-22-2010 03:39 PM
Can a security group be a member of another group? linux69 Linux - General 4 08-25-2010 12:17 AM
can i give directory permission to a group and not specific user? SamuraiCoder Linux - Newbie 5 05-26-2010 04:23 PM
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 05:22 PM
Why specific user/group for rpm installation alanbe Linux - Newbie 1 03-02-2005 04:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration