Skip to main content

maybe_drop_privileges

Change process privileges to new user/group.

If UID and GID is specified, the real user/group is changed.

If only UID is specified, the real user is changed, and the group is
changed to the users primary group.

If only GID is specified, only the group is changed.
def maybe_drop_privileges(
uid: string|int|null = None,
gid: string|int|null = None
) - > null

Change process privileges to new user/group. If UID and GID is specified, the real user/group is changed. If only UID is specified, the real user is changed, and the group is changed to the users primary group. If only GID is specified, only the group is changed.

Parameters

NameTypeDescription
uid`stringint
gid`stringint

Returns

TypeDescription
nullNothing is returned; the process identity is modified in-place.