Browse Source

Check if combination nologin rss + jail has been used or create an error

Users sometimes only use CLI might activate this ...
Jaap Marcus 2 years ago
parent
commit
8dc9c7cd7f
1 changed files with 4 additions and 0 deletions
  1. 4 0
      bin/v-change-user-shell

+ 4 - 0
bin/v-change-user-shell

@@ -32,6 +32,10 @@ is_format_valid 'user' 'shell shell_jail_enabled'
 is_object_valid 'user' 'USER' "$user"
 is_object_unsuspended 'user' 'USER' "$user"
 
+if [[ "$shell" =~ nologin ]] || [[ "$shell" =~ rssh ]] &&  [[ "$shell_jail_enabled" =~ yes ]]; then
+	check_result "$E_INVALID" "nologin and rssh can't be jailed"
+fi
+
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode