summaryrefslogtreecommitdiff
path: root/src/sysusers/sysusers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sysusers/sysusers.c')
-rw-r--r--src/sysusers/sysusers.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index ba09727080..547bd1b344 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -33,12 +33,14 @@
#include "hashmap.h"
#include "path-util.h"
#include "selinux-util.h"
+#include "smack-util.h"
#include "specifier.h"
+#include "string-util.h"
#include "strv.h"
#include "uid-range.h"
#include "utf8.h"
#include "util.h"
-#include "smack-util.h"
+#include "fd-util.h"
typedef enum ItemType {
ADD_USER = 'u',
@@ -1762,7 +1764,7 @@ static int parse_argv(int argc, char *argv[]) {
{}
};
- int c;
+ int c, r;
assert(argc >= 0);
assert(argv);
@@ -1779,12 +1781,9 @@ static int parse_argv(int argc, char *argv[]) {
return version();
case ARG_ROOT:
- free(arg_root);
- arg_root = path_make_absolute_cwd(optarg);
- if (!arg_root)
- return log_oom();
-
- path_kill_slashes(arg_root);
+ r = parse_path_argument_and_warn(optarg, true, &arg_root);
+ if (r < 0)
+ return r;
break;
case '?':