Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

posix_setuid(3) [php man page]

POSIX_SETUID(3) 							 1							   POSIX_SETUID(3)

posix_setuid - Set the UID of the current process

SYNOPSIS
bool posix_setuid (int $uid) DESCRIPTION
Set the real user ID of the current process. This is a privileged function that needs appropriate privileges (usually root) on the system to be able to perform this function. PARAMETERS
o $uid - The user id. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 posix_setuid(3) example This example will show the current user id and then set it to a different value. <?php echo posix_getuid()." "; //10001 echo posix_geteuid()." "; //10001 posix_setuid(10000); echo posix_getuid()." "; //10000 echo posix_geteuid()." "; //10000 ?> SEE ALSO
posix_setgid(3), posix_seteuid(3), posix_getuid(3), posix_geteuid(3). PHP Documentation Group POSIX_SETUID(3)

Check Out this Related Man Page

POSIX_GETEUID(3)							 1							  POSIX_GETEUID(3)

posix_geteuid - Return the effective user ID of the current process

SYNOPSIS
int posix_geteuid (void ) DESCRIPTION
Return the numeric effective user ID of the current process. See also posix_getpwuid(3) for information on how to convert this into a use- able username. RETURN VALUES
Returns the user id, as an integer EXAMPLES
Example #1 posix_geteuid(3) example This example will show the current user id then set the effective user id to a separate id using posix_seteuid(3), then show the difference between the real id and the effective id. <?php echo posix_getuid()." "; //10001 echo posix_geteuid()." "; //10001 posix_seteuid(10000); echo posix_getuid()." "; //10001 echo posix_geteuid()." "; //10000 ?> SEE ALSO
posix_getpwuid(3), posix_getuid(3), posix_setuid(3), POSIX man page GETEUID(2). PHP Documentation Group POSIX_GETEUID(3)
Man Page

13 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

file name Manipulation using sed

Hi, I have a file name, for which I want to strip out the first bit and leave the rest... So I want to take the file name .lockfile-filename.10001 ,strip it and have only filename.10001 ... Thanking you all inadvance, Zak (6 Replies)
Discussion started by: Zak
6 Replies

2. Shell Programming and Scripting

Dummy need help :(

This drive me nut, any can show me how to do it ?? str1='Case Modify 10001 20002 30003 40004|Report Create 3417176211|Case Modify 10002 20002 30003 40004' and str2='Case Modify 10001' if str1 ~ str2 then str1='Report Create 3417176211|Case Modify 10002 20002 30003 40004' Thanks, (8 Replies)
Discussion started by: sabercats
8 Replies

3. Shell Programming and Scripting

UNIX shell scripting for retrieving from oracle

Hello folks, Please find the below code:(sample5.sh -> filename) echo "Selecting dat afrom Cause code" echo "set appinfo Causecode $preamble set serveroutput on size 10000 select * from RMI003_CAUSE_CODE /" | sqlplus -S $username@$hoststring/$password >> test2.dat When i tried executing... (5 Replies)
Discussion started by: sundar_ravi4
5 Replies

4. Shell Programming and Scripting

problem in arithmetic operations

hello all, i am having a variable with a value of 0000010000 and if i add the variable with some no: suppose i=0000010000 n=`expr $i + 1` echo $n the output i am reciving is 10001 .it deletes all the zeros but i need result as 0000010001.. please help me... thanks in... (3 Replies)
Discussion started by: ithirak17
3 Replies

5. UNIX for Dummies Questions & Answers

Prompting for Input - Getting Undefined Variable

#!/bin/csh -f echo "Enter MEUPS User Id :-" read UID echo "You entered $UID" --------------------------------------- Whn executed, I get an error message "UID: Undefined variable" (1 Reply)
Discussion started by: Kartheg
1 Replies

6. Shell Programming and Scripting

checking uid

How do i go about getting the uid of the user and verify ? if then echo "You are not a superuser, please login as a superuser" exit1; fi the above code doesn't work. can some guru please help me. 1. how to get the uid of the user ? i know by typing id but how to... (7 Replies)
Discussion started by: filthymonk
7 Replies

7. Shell Programming and Scripting

comparing files - adding/subtracting/formating columns

I have two files: file1.txt: FS Total Used Free Used% /u01 10000 8000 2000 80% /u02 10000 8000 2000 80% /u03 10000 8000 2000 80% /u04 10000 8000 2000 80% /u05 10000 8000 2000 80% /u06 10000 8000 2000 80% /u07 10000 8000 2000 80% /u10 10000 5000 5000 50% file2.txt:... (7 Replies)
Discussion started by: oabdalla
7 Replies

8. Shell Programming and Scripting

assigning counter to same keys in a file

Hi, I've a data file with similar keys coming in. I want to assign an incremental counter to those records and attach to a file for example File 10001 ABCD 10002 PQRS 10001 ABCD 10003 QWER 10001 ABCD 10002 PQRS 10004 POIU output as 10001 ABCD 1 10002 PQRS 1 10001 ABCD 2 10003... (3 Replies)
Discussion started by: rudoraj
3 Replies

9. UNIX for Dummies Questions & Answers

Help with grepping and line number

I need help with extracting data from a large file ~900mb. Below is how the data looks like, line number value 1001 10000 ... ... 5001 50000 6001 60000 ... ... 10001 100000 ... ... 100001 ... (3 Replies)
Discussion started by: shabs1985
3 Replies

10. UNIX for Dummies Questions & Answers

help pls! need to move and copy pattern...

Help please... Need to convert below: Subcase ID : 10001 210000 0 1.22049E+01 220000 0 6.29560E+00 Subcase ID : 20703 210000 0 2.76398E+00 220000 0 2.43183E+00 230000 0 -1.87728E+01 Subcase ID : 13703 210000 0 ... (2 Replies)
Discussion started by: lakanino
2 Replies

11. Shell Programming and Scripting

To fetch specific words from a file

Hi All, I have a file like this,(This is a sql output file) cat query_file 200000029 12345 10001 0.2 0 I want to fetch the values 200000029,10001,0.2 .I tried using the below code but i could get... (2 Replies)
Discussion started by: girish.raos
2 Replies

12. Shell Programming and Scripting

getting the sum of numbers

I basically have a file where I had to do a bunch of greps to get a list of numbers example: a file called numbers.txt 10000 10000 superman 10000 batman 10000 10000 grep '100' * | 10000 10000 10000 10000 10000 (2 Replies)
Discussion started by: zerofire123
2 Replies

13. Shell Programming and Scripting

Remove Double Value at Latest Output

Hello all, I have file like this: input.dat: 3778 10000 25 3778 10001 26 3778 10002 29 3779 10000 30 3779 10010 31 ... (2 Replies)
Discussion started by: attila
2 Replies