Skip to content
Snippets Groups Projects
  • John Crispin's avatar
    666659fb
    default_postinst() fix wrong call of group_add · 666659fb
    John Crispin authored
    
    [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: default avatarBastian Bittorf <bittorf@bluebottle.com>
    
    SVN-Revision: 42926
    666659fb
    History
    default_postinst() fix wrong call of group_add
    John Crispin authored
    
    [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: default avatarBastian Bittorf <bittorf@bluebottle.com>
    
    SVN-Revision: 42926