test: use NOBODY_USER_NAME instead of hard-coded string "noody"

This commit is contained in:
Yu Watanabe 2017-12-07 15:48:44 +09:00
parent ea781d0dd8
commit a3d37fe9a3
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ static void test_add_acls_for_user(void) {
assert_se(system(cmd) == 0);
if (getuid() == 0) {
const char *nobody = "nobody";
const char *nobody = NOBODY_USER_NAME;
r = get_user_creds(&nobody, &uid, NULL, NULL, NULL);
if (r < 0)
uid = 0;

View File

@ -108,7 +108,7 @@ static int setup_tests(bool *run_ambient) {
struct passwd *nobody;
int r;
nobody = getpwnam("nobody");
nobody = getpwnam(NOBODY_USER_NAME);
if (!nobody) {
log_error_errno(errno, "Could not find nobody user: %m");
return -EXIT_TEST_SKIP;