1 .\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Fri Jul 29th 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
24 .\" Translated into german by Stefan Janke (gonzo@burg.studfb.unibw-muenchen.de)
26 .TH SETGID 2 "2. September 1996" "Linux 1.1.36" "Systemaufrufe"
28 setgid \- setzt die Gruppenidentität (GID)
30 .B #include <unistd.h>
32 .BI "int setgid(gid_t " gid )
35 setzt die effektive Gruppen-ID des aktuellen Prozesses. Wird diese
36 Funktion durch den Superuser aufgerufen, dann wird auch die reale und
37 die gesicherte Gruppen-ID gesetzt.
41 wie unter SYSV, mit SAVED_IDS implementiert.
42 Dies erlaubt einem setgid-Programm (für Nicht-Superuser), alle
43 Gruppenprivilegien abzugeben, einige nichtprivilegierte Arbeiten zu
44 erledigen und dann, auf sichere Art und Weise, die orginale effektive
45 Gruppen-ID zurückzuerhalten.
47 Wenn es sich um den Superuser oder um ein Programm handelt, bei
48 welchem das Set-GID-Bit auf root gesetzt ist, ist besondere Sorgfalt
51 Funktion überprüft die effektive GID des aufrufenden Prozesses und
52 wenn es die des Superusers ist, werden alle diesen Prozess
53 betreffenden Gruppen-IDs auf
55 gesetzt. Nachdem dies geschehen ist, ist es für das Programm
56 unmöglich wieder Superuser-Privilegien zu erhalten.
58 Im Erfolgsfall wird 0 zurückgeliefert. Im Fehlerfall wird \-1
61 wird entsprechend gesetzt.
65 Der Benutzer ist nicht der Superuser und
67 entspricht nicht der effektiven oder gesicherten Gruppen-ID des
68 aufrufenden Prozesses.