From aa96c6cb44a6eeccc506ae055aae2519a7f914e1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 29 Apr 2013 18:39:12 -0300 Subject: id128: when taking user input for a 128bit ID, validate syntax Also, always accept both our simple hexdump syntax and UUID syntax. --- src/nspawn/nspawn.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nspawn') diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index a49cbc2238..0a46313636 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -222,6 +222,11 @@ static int parse_argv(int argc, char *argv[]) { break; case ARG_UUID: + if (!id128_is_valid(optarg)) { + log_error("Invalid UUID: %s", optarg); + return -EINVAL; + } + arg_uuid = optarg; break; -- cgit v1.2.3-54-g00ecf