summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas François <nicolas.francois@centraliens.net>2013-08-13 22:29:16 +0200
committerNicolas François <nicolas.francois@centraliens.net>2013-08-13 22:29:16 +0200
commit0094abea6ec70a0946bbe8deb8683b55a96b0898 (patch)
tree9052220043f507f64920d08b693d73eceb50bef3
parent8781aff637739102ca0b00b0bbe006c2d35137a7 (diff)
Fix count for ranges truncated in remove_range().
* lib/subordinateio.c: Fix count for ranges truncated in remove_range().
-rw-r--r--ChangeLog5
-rw-r--r--lib/subordinateio.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 31251ac0..87f2c41d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2013-08-13 Nicolas François <nicolas.francois@centraliens.net>
+ * lib/subordinateio.c: Fix count for ranges truncated in
+ remove_range().
+
+2013-08-13 Nicolas François <nicolas.francois@centraliens.net>
+
* src/su.c: Terminate the child (if needed) before closing the PAM
session. This is probably more correct, and avoid reporting
termination from signals possibly sent by PAM modules (e.g. former
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;