[system-tools-backends-clone] Improve error checking against malformed /etc/group entries
- From: Milan Bouchet-Valat <milanbv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [system-tools-backends-clone] Improve error checking against malformed /etc/group entries
- Date: Wed, 10 Feb 2010 21:30:31 +0000 (UTC)
commit 5bad3f88f5e28fd9c1b62e1da6ff062d520ccc61
Author: Milan Bouchet-Valat <nalimilan club fr>
Date: Wed Feb 10 22:19:46 2010 +0100
Improve error checking against malformed /etc/group entries
When a group line contained an extra ':', the group struct contained 5 items instead of 4, leading D-Bus bindings to die unexpectedly. Clients did not receive any group struct, and could remove all groups on the system. This bug was mitigated by the move to individual commits, but this change will avoid dying for most cases. UsersConfig doesn't seem to suffer from the same problem.
https://bugs.launchpad.net/ubuntu/+source/gnome-system-tools/+bug/160862
Users/Groups.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/Users/Groups.pm b/Users/Groups.pm
index 4f5d718..aba40f3 100644
--- a/Users/Groups.pm
+++ b/Users/Groups.pm
@@ -271,7 +271,7 @@ sub get
# FreeBSD allows comments in the group file. */
next if &Utils::Util::ignore_line ($_);
- @line = split ':', $_, -1;
+ @line = split ':', $_, 4;
@a = split ',', pop @line;
push @line, [ a];
$copy = [ line];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]