Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

setreuid(2) [bsd man page]

SETREUID(2)							System Calls Manual						       SETREUID(2)

NAME
setreuid - set real and effective user ID's SYNOPSIS
setreuid(ruid, euid) int ruid, euid; DESCRIPTION
The real and effective user ID's of the current process are set according to the arguments. If ruid or euid is -1, the current uid is filled in by the system. Unprivileged users may change the real user ID to the effective user ID and vice-versa; only the super-user may make other changes. RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. ERRORS
[EPERM] The current process is not the super-user and a change other than changing the effective user-id to the real user-id was specified. SEE ALSO
getuid(2), setregid(2), setuid(3) 4th Berkeley Distribution May 9, 1985 SETREUID(2)

Check Out this Related Man Page

SETREUID(2)						      BSD System Calls Manual						       SETREUID(2)

NAME
setreuid -- set real and effective user IDs LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <unistd.h> int setreuid(uid_t ruid, uid_t euid); DESCRIPTION
The real and effective user IDs of the current process are set according to the arguments. If ruid or euid is -1, the current uid is filled in by the system. Unprivileged users may change the real user ID to the effective user ID and vice-versa; only the super-user may make other changes. The setreuid() function has been used to swap the real and effective user IDs in set-user-ID programs to temporarily relinquish the set-user- ID value. This purpose is now better served by the use of the seteuid() function (see setuid(2)). When setting the real and effective user IDs to the same value, the standard setuid() function is preferred. RETURN VALUES
The setreuid() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indi- cate the error. ERRORS
[EPERM] The current process is not the super-user and a change other than changing the effective user-id to the real user-id was specified. SEE ALSO
getuid(2), issetugid(2), seteuid(2), setuid(2) HISTORY
The setreuid() system call appeared in 4.2BSD. BSD
February 8, 2001 BSD
Man Page

3 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Running a Unix command as a different user

hi, I wrote a C program (runas.c) that runs a command as a different user. The problem I'm having is that the new user's group membership isn't going into effect. Take the following scenario: I login as "kirk". I need to run some commands as "spock". kirk and spock belong to these... (4 Replies)
Discussion started by: Andrewkl
4 Replies

2. Solaris

Rpcbind service not starting

Hello all, I have read just about every rpcbind not starting thread and article on the internet it seems, but I have not found a solution to my problem as of yet. I have a solaris 10 server that has been running with no problems for a while. The other day it crashed and would not boot to the gui... (2 Replies)
Discussion started by: Madrox72
2 Replies

3. 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