]> granicus.if.org Git - shadow/commitdiff
Fix boundary conditions.
authorNicolas François <nicolas.francois@centraliens.net>
Thu, 15 Aug 2013 15:03:18 +0000 (17:03 +0200)
committerNicolas François <nicolas.francois@centraliens.net>
Thu, 15 Aug 2013 15:30:19 +0000 (17:30 +0200)
* lib/subordinateio.c (find_free_range): max is allowed for new
ranges.

ChangeLog
lib/subordinateio.c

index 7ae37b1aa23b462079309cef59956a824a088074..910d02f14440e1c46d6550434f83b47e756f0ec1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-15  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * lib/subordinateio.c (find_free_range): max is allowed for new
+       ranges.
+
 2013-08-15  Nicolas François  <nicolas.francois@centraliens.net>
 
        * libmisc/find_new_sub_gids.c: Remove dead code.
index e79d9e57801a248ec5cbde8f3e50f50890aa2dc9..9eff5fbf4d83cca1a2a5c65bb323503bfe9f111f 100644 (file)
@@ -225,8 +225,11 @@ static unsigned long find_free_range(struct commonio_db *db,
 
                /* Find the top end of the hole before this range */
                high = first;
-               if (high > max)
-                       high = max;
+
+               /* Don't allocate IDs after max (included) */
+               if (high > max + 1) {
+                       high = max + 1;
+               }
 
                /* Is the hole before this range large enough? */
                if ((high > low) && ((high - low) >= count))