.\" Copyright (C) 2001 Andries Brouwer (aeb@cwi.nl) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" [should really be seteuid.3] .\" Revisado por Miguel Pérez Ibars el 29-septiembre-2004 .\" .TH SETEUID 2 "17 mayo 2001" "Linux 2.4" "Manual del Programador de Linux" .SH NOMBRE seteuid, setegid \- establecen el identificador de usuario o de grupo .SH SINOPSIS .B #include .br .B #include .sp .BI "int seteuid(uid_t " euid ); .br .BI "int setegid(gid_t " egid ); .SH DESCRIPCIÓN .B seteuid establece el identificador de usuario efectivo del proceso actual. Los procesos de usuario no privilegiados solamente pueden establecer el identificador de usuario efectivo al identificador de usuario real, el identificador de usuario efectivo o el identificador de usuario guardado. Precisamente lo mismo puede decirse para .B setegid con "grupo" en lugar de "usuario". .\" Cuando .\" .I euid .\" es igual a \-1, nada cambia. .SH "VALOR DEVUELTO" En caso de éxito, se devuelve cero. En caso de error, se devuelve \-1, y .I errno se modifica apropiadamente. .SH ERRORES .\" .TP .\" .B EINVAL .TP .B EPERM El proceso actual no pertenece al super-usuario y .I euid (resp. .IR egid ) no es el identificador de usuario (grupo) real, el identificador de usuario (grupo) efectivo o el identificador de usuario (grupo) guardado. .SH OBSERVACIONES Establecer el identificador de usuario (grupo) efectivo al identificador de usuario (grupo) guardado es posible desde la versión 1.1.37 de Linux (1.1.38). En un sistema cualquiera debería comprobarse _POSIX_SAVED_IDS. .LP Bajo libc4, libc5 y glibc2.0 .BI seteuid( euid ) es equivalente a .BI setreuid(-1, " euid" ) y por tanto puede cambiar el identificador de usuario guardado. Bajo glibc2.1 es equivalente a .BI setresuid(-1, " euid" ,-1) y por tanto no modifica el identificador de usuario guardado. Las mismas anotaciones se aplican a .BR setegid . .SH "CONFORME A" BSD 4.3 .SH "VÉASE TAMBIÉN" .BR geteuid (2), .BR setuid (2), .BR setreuid (2), .BR setresuid (2)