xref: /dragonfly/lib/libc/sys/setresuid.2 (revision c9f721c2)
1.\" Copyright (c) 2000
2.\"      Sheldon Hearn.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES
19.\"
20.\" $FreeBSD: src/lib/libc/sys/setresuid.2,v 1.2.2.8 2001/12/14 18:34:01 ru Exp $
21.\" $DragonFly: src/lib/libc/sys/setresuid.2,v 1.3 2004/03/11 12:28:51 hmp Exp $
22.\"
23.Dd January 17, 2000
24.Dt SETRESUID 2
25.Os
26.Sh NAME
27.Nm setresgid ,
28.Nm setresuid
29.Nd set real, effective and saved user or group ID
30.Sh LIBRARY
31.Lb libc
32.Sh SYNOPSIS
33.In sys/types.h
34.In unistd.h
35.Ft int
36.Fn setresgid "gid_t rgid" "gid_t egid" "gid_t sgid"
37.Ft int
38.Fn setresuid "uid_t ruid" "uid_t euid" "uid_t suid"
39.Sh DESCRIPTION
40The
41.Fn setresuid
42system call sets the real,
43effective and saved user IDs of the current process.
44The analogous
45.Fn setresgid
46sets the real, effective and saved group IDs.
47.Pp
48Privileged processes may set these IDs
49to arbitrary values.
50Unprivileged processes are restricted
51in that each of the new IDs must match one of the current IDs.
52.Pp
53Passing -1 as an argument causes the corresponding value
54to remain unchanged.
55.Sh RETURN VALUES
56.Rv -std
57.Sh ERRORS
58.Bl -tag -width Er
59.It Bq Er EPERM
60The calling process was not privileged
61and tried to change one or more IDs to a value
62which was not the current real ID, the current effective ID
63nor the current saved ID.
64.El
65.Sh SEE ALSO
66.Xr getegid 2 ,
67.Xr geteuid 2 ,
68.Xr getgid 2 ,
69.Xr getuid 2 ,
70.Xr issetugid 2 ,
71.Xr setgid 2 ,
72.Xr setregid 2 ,
73.Xr setreuid 2 ,
74.Xr setuid 2
75.Sh STANDARDS
76These system calls are not available on many platforms.
77They exist in
78.Dx
79to support Linux binaries linked against GNU libc2.
80.Sh HISTORY
81These system calls first appeared in HP-UX.
82