Openwrt/package/base-files/files
John Crispin 666659fb31 default_postinst() fix wrong call of group_add
[base-files] default_postinst() fix wrong call of group_add
after 12bae65d07d29854204715cebc1ef1eae237fd9b group_add is
always called. shell scripting can be tricky...

wrong call:
[ -n "$gid" ] && group_exists $name || group_add $name $gid

this leads to a call of 'group_add' when $gid is emtpy, proof:

root@box:~ functionA() { echo A; }
root@box:~ functionB() { echo B; }
root@box:~ VAR=
root@box:~ [ -n "$VAR" ] && functionA || functionB
B
root@box:~ # functionB was called, but VAR is not filled
root@box:~ VAR=filled
root@box:~ [ -n "$VAR" ] && functionA || functionB
A

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 42926
2014-10-15 17:55:13 +00:00
..
bin network: Unbind DHCPv6 from underlying interfaces 2014-10-08 13:08:05 +00:00
etc network: Unbind DHCPv6 from underlying interfaces 2014-10-08 13:08:05 +00:00
lib default_postinst() fix wrong call of group_add 2014-10-15 17:55:13 +00:00
rom
sbin scripts: fix wrong usage of '==' operator 2014-10-14 12:21:11 +00:00