pull/1508/merge
networkException 1 week ago committed by GitHub
commit eb74c62bc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      src/apps/relay/mainrelay.c

@ -2967,7 +2967,6 @@ static void drop_privileges(void) {
#if defined(WINDOWS)
// TODO: implement it!!!
#else
setgroups(0, NULL);
if (procgroupid_set) {
if (getgid() != procgroupid) {
if (setgid(procgroupid) != 0) {
@ -2983,6 +2982,11 @@ static void drop_privileges(void) {
if (procuserid_set) {
if (procuserid != getuid()) {
if (setgroups(0, NULL) != 0) {
perror("setgroups: Unable drop supplementary groups");
exit(-1);
}
if (setuid(procuserid) != 0) {
perror("setuid: Unable to change user privileges");
exit(-1);

Loading…
Cancel
Save