From d9d1bb4acbacaccb53831ef95365ddba5a32ef73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Fran=C3=A7ois?= Date: Mon, 12 Aug 2013 23:57:32 +0200 Subject: [PATCH] Fix removal of ranges. * lib/subordinateio.c: Fix removal of ranges. The database needs to be marked as changed or commonio_close will discard any change. --- ChangeLog | 5 +++++ lib/subordinateio.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index aa482afd..42483eb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-08-12 Nicolas François + + * lib/subordinateio.c: Fix removal of ranges. The database needs + to be marked as changed or commonio_close will discard any change. + 2013-08-11 Nicolas François * man/newusers.8.xml: Include documentation of SUB_GID_MIN, diff --git a/lib/subordinateio.c b/lib/subordinateio.c index 4196434b..34630f2c 100644 --- a/lib/subordinateio.c +++ b/lib/subordinateio.c @@ -319,12 +319,14 @@ static int remove_range(struct commonio_db *db, range->count = (last - range->start) + 1; ent->changed = true; + db->changed = true; } /* Is just the end of the entry removed? */ else if ((start > first) && (end >= last)) { range->count = (start - range->start) + 1; ent->changed = true; + db->changed = true; } /* The middle of the range is removed */ else { @@ -339,6 +341,7 @@ static int remove_range(struct commonio_db *db, range->count = (start - range->start) + 1; ent->changed = true; + db->changed = true; } }