]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: use NOBODY_USER_NAME instead of hard-coded string "noody"
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 7 Dec 2017 06:48:44 +0000 (15:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 7 Dec 2017 08:12:09 +0000 (17:12 +0900)
src/test/test-acl-util.c
src/test/test-capability.c

index 7b66e189ba5a9ab1529196c10c907730763cf75d..70ffdbc519579d62f01b2980b441c456856d5914 100644 (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;
index 6c41e1ca1532833fe57bb93b4203f38c5da7bbc9..e5db52d4047cd8da8ce4b2597c55b2946941c5c8 100644 (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;