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_GETGRGID(3)							 1							 POSIX_GETGRGID(3)

posix_getgrgid - Return info about a group by group id

SYNOPSIS
array posix_getgrgid (int $gid) DESCRIPTION
Gets information about a group provided its id. PARAMETERS
o $gid - The group id. RETURN VALUES
The array elements returned are: The group information array +--------+---------------------------------------------------+ |Element | | | | | | | Description | | | | +--------+---------------------------------------------------+ | name | | | | | | | The name element contains the name of the group. | | | This is a short, usually less than 16 character | | | "handle" of the group, not the real, full name. | | | | |passwd | | | | | | | The passwd element contains the group's password | | | in an encrypted format. Often, for example on a | | | system employing "shadow" passwords, an asterisk | | | is returned instead. | | | | | gid | | | | | | | Group ID, should be the same as the $gid parame- | | | ter used when calling the function, and hence | | | redundant. | | | | |members | | | | | | | This consists of an array of string's for all | | | the members in the group. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 Example use of posix_getgrgid(3) <?php $groupid = posix_getegid(); $groupinfo = posix_getgrgid($groupid); print_r($groupinfo); ?> The above example will output something similar to: Array ( [name] => toons [passwd] => x [members] => Array ( [0] => tom [1] => jerry ) [gid] => 42 ) SEE ALSO
posix_getegid(3), posix_getgrnam(3), filegroup(3), stat(3), safe_mode_gid, POSIX man page GETGRNAM(3). PHP Documentation Group POSIX_GETGRGID(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