summaryrefslogtreecommitdiff
path: root/src/test/test-ipcrm.c
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-03-09 18:21:42 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2016-03-09 18:21:42 +0100
commitbd7e03af007c4e857ed0370eba9e903d6b561937 (patch)
tree23b7f66162ff1a45d29c5a03fe74c381ffec0ef3 /src/test/test-ipcrm.c
parent280d397ab313b647fbd824d1cb58eb8323c74501 (diff)
parent58015d7815bce405c7c0ac082d8c2f407ec07eeb (diff)
Merge pull request #2755 from keszybz/more-tests
Enable more tests by default, and even more with `--enable-tests=unsafe`
Diffstat (limited to 'src/test/test-ipcrm.c')
-rw-r--r--src/test/test-ipcrm.c11
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;
}