From 203e252baed53f542bc0fb1f68dda63c2f794f0b Mon Sep 17 00:00:00 2001 From: Alex Oprea Date: Thu, 4 Aug 2016 15:58:06 +0200 Subject: [PATCH] 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. --- samba3/files/samba.init | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samba3/files/samba.init b/samba3/files/samba.init index 670281197..80db13b3a 100755 --- a/samba3/files/samba.init +++ b/samba3/files/samba.init @@ -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