.\" Copyright (c) 1983, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)setregid.2 6.4 (Berkeley) 3/10/91 .\" .\" Modified Sat Jul 24 09:08:49 1993 by Rik Faith .\" Portions extracted from linux/kernel/sys.c: .\" Copyright (C) 1991, 1992 Linus Torvalds .\" May be distributed under the GNU General Public License .\" Changes: Fri Jul 29 10:56:01 BST 1994 by Wilf. .\" Tue Aug 2 14:56:48 BST 1994 by Wilf due to change in kernel. .\" Translated 29 Jan 1998 by Vicente Pastor Gómez .\" .TH SETREUID 2 "2 agosto 1994" "Linux 1.1.38" "Manual del Programador de Linux" .SH NOMBRE setreuid, setregid \- definir el identificador de usuario o de grupo real y/o efectivo .SH SINOPSIS .B #include .br .B #include .sp .BI "int setreuid(uid_t " ruid ", uid_t " euid ); .br .BI "int setregid(gid_t " rgid ", gid_t " egid ); .SH DESCRIPCIÓN .B setreuid define el identificador de usuario real y efectivo del proceso actual. Los usuarios sin privilegios solamente pueden cambiar el identificador de usuario real por el identificador de usuario real o el identificador de usuario efectivo, y el identificador de usuario efectivo por el identificador de usuario real, el identificador de usuario efectivo o el identificador de usuario guardado. Dando el valor \-1 para el valor del identificador de usuario ya sea el real o el efectivo, fuerza al sistema a dejar dicho identificador sin cambios. Si el identificador de usuario real es cambiado, o el identificador de usuario efectivo se pone a un valor distinto del identificador de usuario real previo, el identificador de usuario guardado será puesto al nuevo identificador de usuario efectivo. De manera completamente análoga, .B setregid define el identificador de grupo real y efectivo del proceso actual, aplicándose todo lo comentado arriba con "grupo" en lugar de "usuario". .SH "VALOR DEVUELTO" Si hay éxito, se devuelve cero. Si hay error, se devuelve \-1, y .I errno se actualiza de la forma apropiada. .SH ERRORES .TP .B EPERM El proceso actual no es el superusuario y especifica un cambio que no es (1) intercambiar el identificador de usuario (grupo) efectivo con el real, o (2) poner el valor de uno al del otro, o (3) poner el identificador de usuario (grupo) efectivo al valor del identificador de usuario (grupo) guardado. .SH OBSERVACIONES Establecer el identificador de usuario (grupo) efectivo al identificador de usuario guardado es posible desde la versión 1.1.37 de Linux (1.1.38). .SH "CONFORME A" BSD 4.3 (las funciones .B setreuid y .B setregid aparecieron por primera vez en 4.2BSD.) .SH "VÉASE TAMBIÉN" .BR getuid (2), .BR getgid (2), .BR setuid (2), .BR setgid (2), .BR seteuid (2), .BR setresuid (2)