This commit is contained in:
bol-van
2024-04-26 21:36:27 +03:00
parent 3098727f4c
commit 1a9a676c94
44 changed files with 1624 additions and 127 deletions

View File

@@ -270,17 +270,18 @@ bool dropcaps(void)
}
return true;
}
#else // __linux__
#endif // __linux__
#ifndef __CYGWIN__
#ifndef __linux__
bool sec_harden(void)
{
// noop
return true;
}
#endif // __linux__
#endif
bool can_drop_root(void)
{
@@ -329,6 +330,7 @@ void print_id(void)
{
int i,N;
gid_t g[128];
printf("Running as UID=%u GID=",getuid());
N=getgroups(sizeof(g)/sizeof(*g),g);
if (N>0)
@@ -341,6 +343,9 @@ void print_id(void)
printf("%u\n",getgid());
}
#endif
void daemonize(void)
{
int pid;