Scroll to navigation

SETGID(2) Linux Programmeurs Handleiding SETGID(2)

NAAM

setgid - zet groep identiteit

SAMENVATTING

#include <sys/types.h>
#include <unistd.h>

int setgid(gid_t gid);

BESCHRIJVING

setgid() sets the effective group ID of the calling process. If the calling process is privileged (more precisely: has the CAP_SETGID capability in its user namespace), the real GID and saved set-group-ID are also set.

Onder Linux is setgid() verwezenlijkt zoals de POSIX versie met de _POSIX_SAVED_IDS uitrusting. Dit status een zet-gid (anders dan root) toe al zijn groep privileges te laten vallen, wat ongepriveligieerd werk te doen en dan het originele geldende groep ID weer op te pakken op een veilige manier.

EIND WAARDE

Bij succes wordt nul teruggegeven. Bij falen wordt -1 teruggegeven en wordt errno naar behoren gezet.

FOUTEN

EINVAL
The group ID specified in gid is not valid in this user namespace.
EPERM
The calling process is not privileged (does not have the CAP_SETGID capability in its user namespace), and gid does not match the real group ID or saved set-group-ID of the calling process.

VOLDOET AAN

POSIX.1-2001, POSIX.1-2008, SVr4.

OPMERKINGEN

The original Linux setgid() system call supported only 16-bit group IDs. Subsequently, Linux 2.4 added setgid32() supporting 32-bit IDs. The glibc setgid() wrapper function transparently deals with the variation across kernel versions.

C library/kernel differences

At the kernel level, user IDs and group IDs are a per-thread attribute. However, POSIX requires that all threads in a process share the same credentials. The NPTL threading implementation handles the POSIX requirements by providing wrapper functions for the various system calls that change process UIDs and GIDs. These wrapper functions (including the one for setgid()) employ a signal-based technique to ensure that when one thread changes credentials, all of the other threads in the process also change their credentials. For details, see nptl(7).

ZIE OOK

getgid(2), setegid(2), setregid(2), capabilities(7), credentials(7), user_namespaces(7)

COLOFON

Deze pagina is onderdeel van release 5.04 van het Linux man-pages-project. Een beschrijving van het project, informatie over het melden van bugs en de nieuwste versie van deze pagina zijn op https://www.kernel.org/doc/man-pages/ te vinden.

VERTALING

De Nederlandse vertaling van deze handleiding is geschreven door Jos Boersema <joshb@xs4all.nl> en Mario Blättermann <mario.blaettermann@gmail.com>

Deze vertaling is vrije documentatie; lees de GNU General Public License Version 3 of later over de Copyright-voorwaarden. Er is geen AANSPRAKELIJKHEID.

Indien U fouten in de vertaling van deze handleiding zou vinden, stuur een e-mail naar <debian-l10n-dutch@lists.debian.org>.

6 maart 2019 Linux