Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

setegid(3) [osf1 man page]

setrgid(3)						     Library Functions Manual							setrgid(3)

NAME
setrgid, setegid - Set the process's group IDs LIBRARY
Standard C Library (libc.a) SYNOPSIS
#include <sys/types.h> int setrgid( gid_t rgid); int setegid ( gid_t egid); PARAMETERS
Specifies the value of the real group ID to be set. Specifies the value of the effective group ID to be set. DESCRIPTION
The setegid() function sets the process's effective group ID to the value of the egid parameter if the egid parameter is equal to the cur- rent real, effective, or saved group ID. The setrgid() function sets the process's real group ID to the value of the rgid parameter. Only the superuser may change the real or effective group ID to a value other than the current real or saved group ID of the process. RETURN VALUES
Upon successful completion, the setegid() and setrgid() functions return a value of 0 (zero). If either function fails, a value of -1 is returned and errno is set to indicate the error. ERRORS
If the setrgid() or setegid() function fails, errno is set to one of the following values: The rgid or egid parameter is not equal to either the real or saved group IDs of the process and the calling process does not have superuser privilege. RELATED INFORMATION
Functions: getgroups(2), setgroups(2), setregid(2). Commands: groups(1). delim off setrgid(3)

Check Out this Related Man Page

setregid(2)							System Calls Manual						       setregid(2)

NAME
setregid - Sets the real and effective group ID SYNOPSIS
#include <unistd.h> setregid( gid_t rgid, gid_t egid ); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: setregid(): XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the new real group ID. Specifies the new effective group ID. DESCRIPTION
The setregid() function sets the real group ID of the current process to the value specified by the rgid parameter, and sets the effective group ID to the value specified by the egid parameter. If the value of rgid is -1, the real group ID is not changed; if the value of egid is -1, the effective group ID is not changed. The real and effective group IDs may be set to different values in the same call. Unprivileged users may change the effective group ID to the real group ID; only the superuser may make other changes. Any supplementary group IDs of the calling process remain unchanged. RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS
The setregid() function sets errno to the specified values for the following conditions: The value of the rgid egid parameter is invalid or out of range. The current process does not have superuser privilege and a change other than changing the effective group ID to the real group ID was specified. RELATED INFORMATION
Functions: getgid(2), setgid(2), setrgid(3), setreuid(2) Standards: standards(5) delim off setregid(2)
Man Page

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

command execution alert

hi Guys! My requirement is... I need to get notified if somebody executes a specific commands...like kill or httpd stop.... something like that.... can somebody help me out... Regards, kiran (8 Replies)
Discussion started by: dddkiran
8 Replies

2. Cybersecurity

the SUID of lpq

Hello My system is Debian-503-amd64. After I installed the "lpr" package, I found that some files with SUID bit come from this package. As: ls -l /usr/bin/lp* .... -rwsr-sr-x 1 root lp 31800 2008-05-20 /usr/bin/lpq -rwsr-sr-x 1 root lp 28504 2008-05-20 /usr/bin/lpr -rwsr-sr-x 1... (1 Reply)
Discussion started by: ZR_Lang
1 Replies

3. Shell Programming and Scripting

How to use newgrp or sg in user mode without password prompt?

Hi, Is it possible to call newgrp or sg from user mode without password prompt in a Linux script? Thank you. hce (2 Replies)
Discussion started by: hce
2 Replies

4. UNIX for Dummies Questions & Answers

Unable to write to a mounted NFS share

Hi All, I created a nfs share in the server(Solaris 10) with the following command and also updated the dfstab file share -F nfs -o rw=server_name2,anon=0 /to_share And then in the client(solaris 10) added the following command to mount the share mount -F nfs server_name1:/to_share... (4 Replies)
Discussion started by: Rossdba
4 Replies

5. UNIX for Dummies Questions & Answers

Combine Both Output from the awk Script

Hi, Is there anyway to combine output from the awk scripting. file01.txt: AUE_CHMOD AUE_CHOWN AUE_CHROOT AUE_CONNECT AUE_ACCEPT AUE_FCHOWN AUE_FCHMOD AUE_SETREUID AUE_SETREGID AUE_FCHROOT AUE_PFEXEC AUE_SETUID AUE_NICE AUE_SETGID (9 Replies)
Discussion started by: alvinoo
9 Replies

6. Programming

I can't compile (gcc) in Solaris 11.3 non global zone

I can't compile anything, the final make error says "Command failed for target `install-recursive'", but I am not able to identify the root cause of that error, I tried with cc, gcc 4.5, also gcc 5.2, using make, using gmake 3.82, ld 5.11, gld 2.31... and I am totally stuck yet... please help, to... (4 Replies)
Discussion started by: sugar222
4 Replies