Unverified Commit 0ef8bff5 by Tycho Andersen Committed by Christian Brauner

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: 's avatarTycho Andersen <tycho@tycho.ws>
parent e0419ca1
...@@ -59,8 +59,11 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, ...@@ -59,8 +59,11 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
goto on_error; goto on_error;
/* Validate type. */ /* Validate type. */
if (*slide != 'u' && *slide != 'g') if (*slide != 'u' && *slide != 'g') {
ERROR("invalid mapping type: %c", *slide);
goto on_error; goto on_error;
}
/* Assign type. */ /* Assign type. */
tmp_type = *slide; tmp_type = *slide;
...@@ -85,8 +88,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, ...@@ -85,8 +88,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
*slide = '\0'; *slide = '\0';
/* Parse nsuid. */ /* 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; goto on_error;
}
/* Move beyond \0. */ /* Move beyond \0. */
slide++; slide++;
...@@ -109,8 +114,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, ...@@ -109,8 +114,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
*slide = '\0'; *slide = '\0';
/* Parse hostid. */ /* 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; goto on_error;
}
/* Move beyond \0. */ /* Move beyond \0. */
slide++; slide++;
...@@ -139,8 +146,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, ...@@ -139,8 +146,10 @@ int parse_idmaps(const char *idmap, char *type, unsigned long *nsid,
*slide = '\0'; *slide = '\0';
/* Parse range. */ /* 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; goto on_error;
}
*type = tmp_type; *type = tmp_type;
*nsid = tmp_nsid; *nsid = tmp_nsid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment