samba: fix code logic: $path was definetly not empty when checked

Assuming that path and dirpath are both empty, path becomes
	"/", which is not empty. The -z $path check after was useless.
	Changed the order of this two operations.
This commit is contained in:
Alex Oprea 2016-08-04 15:58:06 +02:00
parent 977657eefd
commit 203e252bae

View file

@ -124,10 +124,11 @@ smb_add_share() {
config_get dir_mask $1 dir_mask
config_get browseable $1 browseable
config_get dirpath $1 dirpath
path="$path/$dirpath"
[ -z "$name" -o -z "$path" ] && return
path="$path/$dirpath"
# restrict the shared paths to always be under /mnt/ tree
[ "${path:0:4}" == "/mnt" ] || path="/mnt/"$path