From: Tycho Andersen Date: Tue, 9 Jan 2018 00:07:50 +0000 (+0000) Subject: add some idmap parsing error messages X-Git-Tag: lxc-2.0.10~423 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ef8bff51fb922c981ef1ab203387cf106a4764c;p=thirdparty%2Flxc.git add some idmap parsing error messages otherwise, we just get a return value of false from setting config failure, with no indication as to what actually failed in the log. Signed-off-by: Tycho Andersen --- diff --git a/src/lxc/confile_utils.c b/src/lxc/confile_utils.c index 2156b759f..d3ba574be 100644 --- a/src/lxc/confile_utils.c +++ b/src/lxc/confile_utils.c @@ -59,8 +59,11 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, goto on_error; /* Validate type. */ - if (*slide != 'u' && *slide != 'g') + if (*slide != 'u' && *slide != 'g') { + ERROR("invalid mapping type: %c", *slide); goto on_error; + } + /* Assign type. */ tmp_type = *slide; @@ -85,8 +88,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, *slide = '\0'; /* Parse nsuid. */ - if (lxc_safe_ulong(window, &tmp_nsid) < 0) + if (lxc_safe_ulong(window, &tmp_nsid) < 0) { + ERROR("couldn't parse nsuid: %s", window); goto on_error; + } /* Move beyond \0. */ slide++; @@ -109,8 +114,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, *slide = '\0'; /* Parse hostid. */ - if (lxc_safe_ulong(window, &tmp_hostid) < 0) + if (lxc_safe_ulong(window, &tmp_hostid) < 0) { + ERROR("couldn't parse hostid: %s", window); goto on_error; + } /* Move beyond \0. */ slide++; @@ -139,8 +146,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, *slide = '\0'; /* Parse range. */ - if (lxc_safe_ulong(window, &tmp_range) < 0) + if (lxc_safe_ulong(window, &tmp_range) < 0) { + ERROR("couldn't parse range: %s", window); goto on_error; + } *type = tmp_type; *nsid = tmp_nsid;