summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-09-08 02:49:52 -0700
committerSerge Hallyn <serge.hallyn@ubuntu.com>2013-09-10 17:51:40 -0500
commit578947e6614aae91e2550c83790e79479b951e40 (patch)
tree143aab846699ab08dc61fa4d81c7c4f0d11a5cf1
parent5e87ff0615bbd8de2b709eb3d53d12dfaedb4dbc (diff)
newuidmap,newgidmap: Correct the range size sanity check in get_map_ranges4.2.1
The number of ranges should be the ceiling of the number of arguments divided by three. Without this fix newuidmap and newgidmap always report and error and fail, which is very much not what we want. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
-rw-r--r--libmisc/idmapping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmisc/idmapping.c b/libmisc/idmapping.c
index 81e85d5f..714c29eb 100644
--- a/libmisc/idmapping.c
+++ b/libmisc/idmapping.c
@@ -47,7 +47,7 @@ struct map_range *get_map_ranges(int ranges, int argc, char **argv)
return NULL;
}
- if (ranges != ((argc - 2) + 2) / 3) {
+ if (ranges != ((argc + 2) / 3)) {
fprintf(stderr, "%s: ranges: %u is wrong for argc: %d\n", Prog, ranges, argc);
return NULL;
}