.\" 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, seteuid \- definir el ID de usuario real y/o efectivo .SH SINOPSIS .B #include .sp .BI "int setreuid(uid_t " ruid ", uid_t " euid ); .br .BI "int seteuid(uid_t " euid ); .SH DESCRIPCIÓN .B setreuid define el ID de usuario real y efectivo del proceso actual. Los usuarios sin privilegios pueden cambiar el ID de usuario del efectivo al real y viceversa. Anteriormente a Linux 1.1.37, el paradigma del ID guardado, se rompía al ser usado con .B setreuid o .BR seteuid . Empezando en la 1.1.37, también es posible definir el ID de usuario efectivo con el ID de usuario guardado. Solo el superusuario puede realizar otros cambios. Dando el valor \-1 para el valor del ID de usuario ya sea el real o el efectivo, fuerza al sistema a dejar dicho ID sin cambios. Actualmente, .BI seteuid( euid ) es funcionalmente equivalente a .BI setreuid( -1 , " euid" ) \fR. Si el ID de usuario real es cambiado, o el ID de usuario efectivo se pone a un valor distinto del ID de usuario real previo, el ID de usuario guardado será puesto al nuevo ID de usuario efectivo. .SH "VALOR REGRESADO" 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 ID de usuario efectivo con el real, o (2) poner el valor de uno al del otro, o (3) poner el ID de usuario efectivo al valor del ID de usuario guardado. .SH "CONFORME A" BSD 4.3 (la función .B setreuid apareció por primera vez en 4.2BSD.) .SH "VÉASE TAMBIÉN" .BR getuid (2), .BR setuid (2)