mirror of
https://github.com/bol-van/zapret.git
synced 2025-04-21 14:32:57 +03:00
Merge 4925c3cc1b8691bbbcaccb9d3ada709588974281 into 8c94e3230e2d94993e0085a4eda718c5a858c4fd
This commit is contained in:
commit
360d5c596c
@ -1,5 +1,6 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
|
#include <sys/param.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "sec.h"
|
#include "sec.h"
|
||||||
@ -279,12 +280,14 @@ bool droproot(uid_t uid, gid_t gid)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if !(defined(BSD) && !defined(__OpenBSD__) && !defined(__APPLE__))
|
||||||
// drop all SGIDs
|
// drop all SGIDs
|
||||||
if (setgroups(0,NULL))
|
if (setgroups(0,NULL))
|
||||||
{
|
{
|
||||||
DLOG_PERROR("setgroups");
|
DLOG_PERROR("setgroups");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (setgid(gid))
|
if (setgid(gid))
|
||||||
{
|
{
|
||||||
DLOG_PERROR("setgid");
|
DLOG_PERROR("setgid");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user