GETGROUPLIST(3) BSD Library Functions Manual GETGROUPLIST(3)NAME
getgrouplist -- calculate group access list
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
int
getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroups);
DESCRIPTION
The getgrouplist() function reads through the group file and calculates the group access list for the user specified in name. The basegid is
automatically included in the groups list. Typically this value is given as the group number from the password file.
The resulting group list is returned in the array pointed to by groups. The caller specifies the size of the groups array in the integer
pointed to by ngroups; the actual number of groups found is returned in ngroups.
RETURN VALUES
The getgrouplist() function returns 0 on success and -1 if the size of the group list is too small to hold all the user's groups. Here, the
group array will be filled with as many groups as will fit.
FILES
/etc/group group membership list
SEE ALSO setgroups(2), initgroups(3)HISTORY
The getgrouplist() function first appeared in 4.4BSD.
BSD October 26, 2014 BSD
Check Out this Related Man Page
INITGROUPS(3) BSD Library Functions Manual INITGROUPS(3)NAME
initgroups -- initialize group access list
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
int
initgroups(const char *name, int basegid);
DESCRIPTION
The initgroups() function uses the getgrouplist(3) function to calculate the group access list for the user specified in name. This group
list is then setup for the current process using setgroups(2). The basegid is automatically included in the groups list. Typically this
value is given as the group number from the password file.
RETURN VALUES
The initgroups() function returns -1 if it was not invoked by the super-user.
SEE ALSO setgroups(2), getgrouplist(3)HISTORY
The initgroups() function appeared in 4.2BSD.
BUGS
The getgrouplist() function called by initgroups() uses the routines based on getgrent(3). If the invoking program uses any of these rou-
tines, the group structure will be overwritten in the call to initgroups().
BSD June 4, 1993 BSD
I am trying to find if the entered value is not in a group. Here is my code.
if
then
echo 'Sid is not in list. Try one of these in caps.'
echo 'LVCH, LVEI, LVMI, LVCH'
exit
fi;Any Ideas?
added code tags for readability --oombera (3 Replies)
Hi I have a user zak and
4 groups:-
oracle
stats
data
archive
I want user zak to be part of the oracle and stats group but not be able to view,list anything in data and archive. Also anyone in the data and archive group should not be able to view,list anything in oracle and stats....... (3 Replies)
Hello
A couple of weeks ago, I added a user to an AIX 5.3 system.
I go to add one today, and it appears that when creating a user in smit, I cannot see any groups.
No primary groups
No Group set
No Admin Groups
The /etc/group and etc/secuity/group files seem to be intact.
I did... (4 Replies)
All,
How i can add a user to a group so that the user will ahve all permsion on that directory .
(sys12:pnl:/work/cn/>) groups crcv1
canusr
and
(sys12:pnl:/work/cn/>) groups pfmgr
pfw users
i am having the .ssh in the directory /work/cn/ which has permision as drwx------ .
... (4 Replies)
I have some groups and when i issue a command like
groups $LOGNAME
it displays in one line
rfautosys c2ru cash2
I want to fetch only group starting with c2 but when i grep i am getting full line. Can someone advise
on this please as how i can get output as c2ru? (2 Replies)
Hello
They have ordered to me that makes several small utilities in C/C++ for the servants, among them a small program in C/C++ to generate a file HTML with the groups of that servant and in addition that is the corresponding users of that group.
For example of a group:
Group: Sys Members:... (2 Replies)
Hi,
cut -d: -f1,3 /etc/group >rpt.out
I have a doubt in above unix commands. right i am getting list of group user id into rpt.out file. instead i need to store it as an array. could you please tell me how can i get list of user into an array..
If u could tell me give me in perl script... (2 Replies)
What's the difference between groups and id-a.
We're using LDAP, rather than NIS+, and a user has been added to an extra Unix group. The groups command shows the new group but id -a doesn't!
Why would this be? (5 Replies)