#include <freeradius-devel/util/hw.h>
#include <freeradius-devel/util/perm.h>
#include <freeradius-devel/util/sem.h>
-#include <freeradius-devel/util/cap.h>
#include <freeradius-devel/util/pair_legacy.h>
#include <freeradius-devel/unlang/xlat_func.h>
config->name, group->gr_name, fr_syserror(errno));
return -1;
}
-
- if ((fr_cap_disable(CAP_SETGID, CAP_EFFECTIVE) < 0) ||
- (fr_cap_disable(CAP_SETGID, CAP_INHERITABLE) < 0) ||
- (fr_cap_disable(CAP_SETGID, CAP_PERMITTED) < 0)) {
- fprintf(stderr, "Failed disabling CAP_SGID - %s", fr_syserror(errno));
- return -1;
- }
}
#endif
fr_exit_now(EXIT_FAILURE);
}
+#ifdef HAVE_GRP_H
+ if ((fr_cap_disable(CAP_SETGID, CAP_EFFECTIVE) < 0) ||
+ (fr_cap_disable(CAP_SETGID, CAP_INHERITABLE) < 0) ||
+ (fr_cap_disable(CAP_SETGID, CAP_PERMITTED) < 0)) {
+ ERROR("Failed disabling CAP_SGID");
+ fr_exit_now(EXIT_FAILURE);
+ }
+#endif
+
fr_reset_dumpable();
suid_down_permanent = true;