]> git.ipfire.org Git - thirdparty/systemd.git/commit
nspawn: fix parsing of numeric arguments for --private-users
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 9 Oct 2016 15:44:03 +0000 (11:44 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 9 Oct 2016 15:52:35 +0000 (11:52 -0400)
commitbfd292ec35c7b768f9fb5cff4d921f3133e62b19
treec2aa779347a994149882c6898a9875eaf38b6226
parent27eb8e90285f5af26c95ce1566c37d4b0efcdeb3
nspawn: fix parsing of numeric arguments for --private-users

The documentation says lists "yes", "no", "pick", and numeric arguments.
But parse_boolean was attempted first, so various numeric arguments were
misinterpreted.

In particular, this fixes --private-users=0 to mean the same thing as
--private-users=0:65536.

While at it, use strndupa to avoid some error handling.
Also give a better error for an empty UID range. I think it's likely that
people will use --private-users=0:0 thinking that the argument means UID:GID.
src/nspawn/nspawn.c