SETUID(3) Library Functions Manual SETUID(3)NAME
setuid, seteuid, setruid, setgid, setegid, setrgid - set user and group ID
SYNOPSIS
#include <sys/types.h>
setuid(uid)
seteuid(euid)
setruid(ruid)
uid_t uid, euid, ruid;
setgid(gid)
setegid(egid)
setrgid(rgid)
gid_t gid, egid, rgid;
DESCRIPTION
Setuid (setgid) sets both the real and effective user ID (group ID) of the current process to as specified.
Seteuid (setegid) sets the effective user ID (group ID) of the current process.
Setruid (setrgid) sets the real user ID (group ID) of the current process.
These calls are only permitted to the super-user or if the argument is the real or effective ID.
SEE ALSO setreuid(2), setregid(2), getuid(2), getgid(2)DIAGNOSTICS
Zero is returned if the user (group) ID is set; -1 is returned otherwise.
4.2 Berkeley Distribution May 12, 1986 SETUID(3)
Check Out this Related Man Page
setuid(3) Library Functions Manual setuid(3)Name
setuid, seteuid, setruid, setgid, setegid, setrgid - set user and group ID
Syntax
#include <sys/types.h>
#include <unistd.h>
setuid(uid)
uid_t uid;
seteuid(euid)
uid_t euid;
setruid(ruid)
uid_t ruid;
setgid(gid)
gid_t gid;
setegid(egid)
gid_t egid;
setrgid(rgid)
gid_t rgid;
Description
The subroutine sets both the real and effective user ID of the current process to the ID specified. Likewise, the subroutine sets the real
and effective group ID of the current process to the ID specified.
The subroutine sets the effective user ID of the current process, while the subroutine sets the effective group ID of the current process.
The subroutine sets the real user ID of the current process, while the subroutine sets the real group ID of the current process.
These calls are only permitted to the super-user or if the argument is the real or effective ID.
Environment
POSIX
SYSTEM_FIVE
When your program is compiled in POSIX or System V mode the following semantics apply when using the or functions:
If the process is the super-user the real, effective, and saved set (as described in user/group ID are set to uid.
If the process is not the super-user, but uid is equal to the real or the saved set user/group ID, the effective user/group ID is set to
uid. The real and saved set user/group ID remain unchanged.
POSIX
In POSIX mode, the function returns a value of type uid_t. The function returns a value of type gid_t.
Return Values
Zero is returned if the user ID or group ID is set; -1 is returned otherwise.
See Alsosetreuid(2), setregid(2), getuid(2), getgid(2)setuid(3)
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)
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)
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)
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)