diff options
author | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-02-10 22:19:46 +0100 |
---|---|---|
committer | Milan Bouchet-Valat <nalimilan@club.fr> | 2010-02-10 22:30:08 +0100 |
commit | 5bad3f88f5e28fd9c1b62e1da6ff062d520ccc61 (patch) | |
tree | 29bf2a870c22cc540ce6918fe41c87cf895852e9 | |
parent | 8ce805ff65770b0ddc45148cbe07cd6a3f1b6449 (diff) |
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
-rw-r--r-- | 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]; |