base-files: the USERID code path did not check for duplicate groups
authorJohn Crispin <john@openwrt.org>
Tue, 14 Oct 2014 19:01:05 +0000 (19:01 +0000)
committerJohn Crispin <john@openwrt.org>
Tue, 14 Oct 2014 19:01:05 +0000 (19:01 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 42919

package/base-files/files/lib/functions.sh

index 6f22dd013a9548d3e53d5487f993164d9f2b06c4..b88d4d62175a785d5f0651ff127d2407ac09cb59 100755 (executable)
@@ -193,7 +193,7 @@ default_postinst() {
                                }
 
                                gid=$id
-                               [ -n "$gid" ] && group_add $name $gid
+                               [ -n "$gid" ] && group_exists $name || group_add $name $gid
                                [ -z "$gid" ] && {
                                        group_add_next $name
                                        gid=$?