- [ -n "$uuid" ] && _uid="-u '$uuid'"
- [ -n "$ulogingroup" ] && _group="-g '$ulogingroup'"
- [ -n "$ugroups" ] && _grouplist="-G '$ugroups'"
- [ -n "$ushell" ] && _shell="-s '$ushell'"
- [ -n "$uhome" ] && _home="-m -d '$uhome'"
- [ -n "$uclass" ] && _class="-L '$uclass'"
- [ -n "$ugecos" ] && _comment="-c '$ugecos'"
- [ -n "$udotdir" ] && _dotdir="-k '$udotdir'"
- [ -n "$uexpire" ] && _expire="-e '$uexpire'"
- [ -n "$upwexpire" ] && _pwexpire="-p '$upwexpire'"
+ [ -n "$uuid" ] && _uid='-u "$uuid"'
+ [ -n "$ulogingroup" ] && _group='-g "$ulogingroup"'
+ [ -n "$ugroups" ] && _grouplist='-G "$ugroups"'
+ [ -n "$ushell" ] && _shell='-s "$ushell"'
+ [ -n "$uclass" ] && _class='-L "$uclass"'
+ [ -n "$ugecos" ] && _comment='-c "$ugecos"'
+ [ -n "$udotdir" ] && _dotdir='-k "$udotdir"'
+ [ -n "$uexpire" ] && _expire='-e "$uexpire"'
+ [ -n "$upwexpire" ] && _pwexpire='-p "$upwexpire"'
+ if [ -z "$Dflag" -a -n "$uhome" ]; then
+ # The /nonexistent home directory is special. It
+ # means the user has no home directory.
+ if [ "$uhome" = "$NOHOME" ]; then
+ _home='-d "$uhome"'
+ else
+ # Use home directory permissions if specified
+ if [ -n "$uhomeperm" ]; then
+ _home='-m -d "$uhome" -M "$uhomeperm"'
+ else
+ _home='-m -d "$uhome"'
+ fi
+ fi
+ elif [ -n "$Dflag" -a -n "$uhome" ]; then
+ _home='-d "$uhome"'
+ fi