Project

General

Profile

Actions

Bug #3403

closed

PrivilegeHelper unit tests fail on Fedora/CentOS due to missing group "nogroup"

Added by susmit shannigrahi almost 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Core
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

Fedora and CentOS don't have "nogroup" by default. They use "nobody" user and "nobody" group.

Running 57 test cases...
../tests/core/privilege-helper.t.cpp(45): error in "DropRaise": exception thrown by PrivilegeHelper::initialize("nobody", "nogroup")
1452288247.361558 INFO: [PrivilegeHelper] dropped to effective uid=0 gid=0
../tests/core/privilege-helper.t.cpp(49): error in "DropRaise": check ::geteuid() != 0 failed [0 == 0]
1452288247.361627 INFO: [PrivilegeHelper] elevated to effective uid=0 gid=0
1452288247.361674 INFO: [PrivilegeHelper] dropped to effective uid=0 gid=0
1452288247.361716 INFO: [PrivilegeHelper] elevated to effective uid=0 gid=0
1452288247.361758 INFO: [PrivilegeHelper] dropped to effective uid=0 gid=0
../tests/core/privilege-helper.t.cpp(56): error in "DropRaise": check ::geteuid() != 0 failed [0 == 0]
1452288247.361812 INFO: [PrivilegeHelper] elevated to effective uid=0 gid=0
1452288248.050340 INFO: [VersionTest] NFD_VERSION 4000
1452288248.050605 INFO: [VersionTest] NFD_VERSION_STRING 0.4.0

*** 3 failures detected in test suite "NFD Core Tests"

Related issues 1 (0 open1 closed)

Blocks NFD - Task #4610: Make CentOS 7 an official (CI-tested) platformClosedMd Ashiqur Rahman

Actions
Actions #1

Updated by Alex Afanasyev almost 9 years ago

Is there equivalent for nouser/nogroup in Fedora?

Actions #2

Updated by susmit shannigrahi almost 9 years ago

Alex Afanasyev wrote:
Is there equivalent for nouser/nogroup in Fedora?

Yes, "nobody:nobody"

Actions #3

Updated by Alex Afanasyev over 8 years ago

What about we change the places where we explicitly use user and group name with something that obtains a first available non-root user. For example, for group it would be

  group nonRootGroup;
  bool found = false;
  char buffer[1024];
  for (gid_t gid = 100; gid < 7000; ++gid) {
    group* groupResult = nullptr;
    if (getgrgid_r(gid, &nonRootGroup, buffer, 1024, &groupResult) == 0) {
      if (groupResult != nullptr) {
        std::cerr << "gid: " << gid << std::endl;
        std::cout << nonRootGroup.gr_name << std::endl;
        found = true;
      }
    }
  }
Actions #4

Updated by susmit shannigrahi over 8 years ago

  • Subject changed from Privilege unit tests fail on Fedora due to missing nogroup to Privileged unit tests fail on Fedora due to missing nogroup
Actions #5

Updated by susmit shannigrahi over 8 years ago

Alex Afanasyev wrote:
What about we change the places where we explicitly use user and group name with something that obtains a first available non-root user.

If this is just for the unit-tests, it should be fine.

Actions #6

Updated by Junxiao Shi over 8 years ago

  • Category set to Core
  • Estimated time set to 3.00 h
Actions #7

Updated by Davide Pesavento about 6 years ago

  • Blocks Task #4610: Make CentOS 7 an official (CI-tested) platform added
Actions #8

Updated by Davide Pesavento about 6 years ago

  • Subject changed from Privileged unit tests fail on Fedora due to missing nogroup to PrivilegeHelper unit tests fail on Fedora/CentOS due to missing nogroup
  • Description updated (diff)
Actions #9

Updated by Davide Pesavento about 6 years ago

  • Subject changed from PrivilegeHelper unit tests fail on Fedora/CentOS due to missing nogroup to PrivilegeHelper unit tests fail on Fedora/CentOS due to missing group "nogroup"
  • Status changed from New to In Progress
  • Assignee set to Davide Pesavento
  • Target version set to v0.7
  • Estimated time changed from 3.00 h to 1.00 h
Actions #10

Updated by Davide Pesavento about 6 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100

https://gerrit.named-data.net/c/NFD/+/4963

I've decided to use "daemon" both as user name and group name. It seems to be in more widespread use than nobody/nogroup. Debian, Ubuntu, RHEL and derivatives (including Fedora and CentOS), and macOS all have it by default.

Actions #11

Updated by Davide Pesavento about 6 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF