*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> setruid (3)              
Title
Content
Arch
Section
 

SETRUID(3)

Contents


NAME    [Toc]    [Back]

     setruid, setrgid - set user and group ID

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>

     int
     setruid(uid_t uid);

     int
     setrgid(gid_t gid);

DESCRIPTION    [Toc]    [Back]

     This interface is  made  obsolete  by  setreuid(2).   It  is
available from the
     compatibility library, libcompat.

     The  setruid()  function  (setrgid())  sets the real user ID
(group ID) of
     the current process to the specified value.

RETURN VALUES    [Toc]    [Back]

     Upon success, these functions return 0; otherwise -1 is  returned.

     If  the  user is not the super user, or the UID (GID) specified is not the
     real or effective ID of the process, these functions  return
-1.

SEE ALSO    [Toc]    [Back]

      
      
     getgid(2), getuid(2), setegid(2), seteuid(2), setgid(2), setregid(2),
     setresgid(2), setresuid(2), setreuid(2), setuid(2)

HISTORY    [Toc]    [Back]

     The setruid() and setrgid() functions  appeared  in  4.2BSD.
Semantically
     different  versions  appeared  in  4.4BSD.  The current versions, with the
     original semantics restored, appeared in OpenBSD 3.3.

OpenBSD     3.6                          April      19,      1991
[ Back ]
 Similar pages
Name OS Title
setuid IRIX set user and group IDs
setgid HP-UX set user and group IDs
seteuid IRIX set user and group IDs
setuid HP-UX set user and group IDs
group Linux user group file
adduser Linux add a user or group to the system
id IRIX print the user name and ID, and group name and ID
seteuid Linux set effective user or group ID
cd_idmap Tru64 sets or gets mappings of User and Group IDs on
getegid HP-UX get real user, effective user, real group, and effective group IDs
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service