tor-hs: tor-hs.init skip onion service when Name empty
authorSergey Ponomarev <[email protected]>
Fri, 4 Aug 2023 14:19:30 +0000 (17:19 +0300)
committerJosef Schlehofer <[email protected]>
Tue, 20 May 2025 11:20:46 +0000 (13:20 +0200)
The Name is used as a HS folder name and can't be empty.

Signed-off-by: Sergey Ponomarev <[email protected]>
net/tor-hs/files/tor-hs.init

index e4bbfdea73b7187221910df53037288ab5d3d512..512e3969b14b8692db7b1a1d6af5f912aaf02ebe 100755 (executable)
@@ -49,6 +49,7 @@ parse_hs_conf() {
        local config="$1"
 
        config_get name "$config" Name
+       [ -z "$name" ] && return 0
        config_get description "$config" Description
        config_get_bool enable_hs "$config" Enabled 0
        config_get ipv4 "$config" IPv4
@@ -69,9 +70,10 @@ parse_hs_conf_hooks() {
        local name hook_script enable_hs hostname_file
        local config="$1"
 
+       config_get name "$config" Name
+       [ -z "$name" ] && return 0
        config_get enable_hs "$config" Enabled 0
        config_get hook_script "$config" HookScript
-       config_get name "$config" Name
 
        hostname="$HS_DIR_PATH/$name/hostname"