Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

posix_setgid(3) [php man page]

POSIX_SETGID(3) 							 1							   POSIX_SETGID(3)

posix_setgid - Set the GID of the current process

SYNOPSIS
bool posix_setgid (int $gid) DESCRIPTION
Set the real group ID of the current process. This is a privileged function and needs appropriate privileges (usually root) on the system to be able to perform this function. The appropriate order of function calls is posix_setgid(3) first, posix_setuid(3) last. Note If the caller is a super user, this will also set the effective group id. PARAMETERS
o $gid - The group id. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 posix_setgid(3) example This example will print out the effective group id, once it is changed. <?php echo 'My real group id is '.posix_getgid(); //20 posix_setgid(40); echo 'My real group id is '.posix_getgid(); //40 echo 'My effective group id is '.posix_getegid(); //40 ?> SEE ALSO
posix_getgrgid(3), posix_getgid(3). PHP Documentation Group POSIX_SETGID(3)

Check Out this Related Man Page

POSIX_GETEGID(3)							 1							  POSIX_GETEGID(3)

posix_getegid - Return the effective group ID of the current process

SYNOPSIS
int posix_getegid (void ) DESCRIPTION
Return the numeric effective group ID of the current process. RETURN VALUES
Returns an integer of the effective group ID. EXAMPLES
Example #1 posix_getegid(3) example This example will print out the effective group id, once it is changed with posix_setegid(3). <?php echo 'My real group id is '.posix_getgid(); //20 posix_setegid(40); echo 'My real group id is '.posix_getgid(); //20 echo 'My effective group id is '.posix_getegid(); //40 ?> NOTES
posix_getegid(3) is different than posix_getgid(3) because effective group ID can be changed by a calling process using posix_setegid(3). SEE ALSO
posix_getgrgid(3), posix_getgid(3), posix_setgid(3). PHP Documentation Group POSIX_GETEGID(3)
Man Page

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Set GID's

(0 Replies)
Discussion started by: securhack
0 Replies

2. Shell Programming and Scripting

mailx to to Dl

Is there any way that I can mailx to a distribution list without having a $HOME/.mailrc file? We have a distribution list in Outlook for our group say group@something.com. I am trting to do echo "Something"|mailx -s "Subject" group@something.com it doesnt work Any ideas? Thanks (1 Reply)
Discussion started by: sm321
1 Replies

3. AIX

Re: User assigned to privileged group

Hi! I need to know what is the risk involved if a user with UID >100 is attached to a group with gid =1 .i.e., a user is attached to a priviliged group in AIX . Kindly let me know what security implication can arise in this case? Early reply in this regard will be highly appreciated. (1 Reply)
Discussion started by: faraz82
1 Replies

4. Shell Programming and Scripting

Transfer output to empty file?

Hi all, I want transfer the echo data into file.txt.how? echo " $dir $group " >> ${file.txt} ---------- Post updated at 04:11 PM ---------- Previous update was at 03:10 PM ---------- anybody can help ? i mean in script output like echo " hello" i want transfer that output to file.txt. (4 Replies)
Discussion started by: proghack
4 Replies

5. AIX

Gid=0 and 7 + admin=FALSE

Checking configuration access files for an AIX server, left me wondering about this :confused:: If a user is added to system group, it gets gid=0 with some security risks because it gets some root kind of file access level. Is this insecure condition kept if the user has admin variable... (0 Replies)
Discussion started by: bkiddo
0 Replies

6. Shell Programming and Scripting

Replace values in a file with values from another file

Hi, I have 2 input files: File 1: echo Name > create_Name.txt echo Group /dir/group, Name >> create_Name.txt File 2: Name AAA BBB CCC group A B C dir A1 B1 C1 ................................ Need to replace the contents of File 1 with column 2, 3 & 4 values of File 2... (8 Replies)
Discussion started by: gctex
8 Replies