Skip to content

Commit c8a6365

Browse files
authored
Prevent empty ns1 / ns2 to be used (hestiacp#3683)
1 parent 8c26daa commit c8a6365

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bin/v-change-user-ns

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ check_args '3' "$#" 'USER NS1 NS2 [NS3] [NS4] [NS5] [NS6] [NS7] [NS8]'
3939
# Checking argument format
4040
is_format_valid 'user' 'ns1' 'ns2'
4141

42+
if [ "$ns1" = '' ]; then
43+
check_result '3' "Usage: v-change-user-ns USER NS1 NS2 [NS3] [NS4] [NS5] [NS6] [NS7] [NS8]"
44+
fi
45+
if [ "$ns2" = '' ]; then
46+
check_result '3' "Usage: v-change-user-ns USER NS1 NS2 [NS3] [NS4] [NS5] [NS6] [NS7] [NS8]"
47+
fi
48+
4249
ns="$ns1,$ns2"
4350
if [ -n "$ns3" ]; then
4451
is_format_valid 'ns3'

0 commit comments

Comments
 (0)