From 0094abea6ec70a0946bbe8deb8683b55a96b0898 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20Fran=C3=A7ois?= Date: Tue, 13 Aug 2013 22:29:16 +0200 Subject: [PATCH] Fix count for ranges truncated in remove_range(). * lib/subordinateio.c: Fix count for ranges truncated in remove_range(). --- ChangeLog | 5 +++++ lib/subordinateio.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31251ac0..87f2c41d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-08-13 Nicolas François + + * lib/subordinateio.c: Fix count for ranges truncated in + remove_range(). + 2013-08-13 Nicolas François * src/su.c: Terminate the child (if needed) before closing the PAM diff --git a/lib/subordinateio.c b/lib/subordinateio.c index 4e94104c..6ed95028 100644 --- a/lib/subordinateio.c +++ b/lib/subordinateio.c @@ -323,7 +323,7 @@ static int remove_range(struct commonio_db *db, } /* Is just the end of the entry removed? */ else if ((start > first) && (end >= last)) { - range->count = (start - range->start) + 1; + range->count = start - range->start; ent->changed = true; db->changed = true; @@ -338,7 +338,7 @@ static int remove_range(struct commonio_db *db, if (!commonio_append(db, &tail)) return 0; - range->count = (start - range->start) + 1; + range->count = start - range->start; ent->changed = true; db->changed = true; -- 2.40.0