diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test-ipcrm.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/test/test-ipcrm.c b/src/test/test-ipcrm.c index 2464d32458..47b1c4443d 100644 --- a/src/test/test-ipcrm.c +++ b/src/test/test-ipcrm.c @@ -23,9 +23,14 @@ int main(int argc, char *argv[]) { uid_t uid; - - assert_se(argc == 2); - assert_se(parse_uid(argv[1], &uid) >= 0); + int r; + const char* name = argv[1] ?: "nfsnobody"; + + r = get_user_creds(&name, &uid, NULL, NULL, NULL); + if (r < 0) { + log_error("Failed to resolve \"nobody\": %m"); + return EXIT_FAILURE; + } return clean_ipc(uid) < 0 ? EXIT_FAILURE : EXIT_SUCCESS; } |