Skip to content

Commit e6946b0

Browse files
authored
Fix restoring ftp users when user has an underscore in the name (hestiacp#4533)
Now, if the user has an underscore in the name like user_1 and it has an ftp account like user_1_ftp, when restoring the user, Hestia creates the ftp account like user_1_1_ftp. https://forum.hestiacp.com/t/v-restore-user-ftp-accounts/15600
1 parent 4734367 commit e6946b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

func/rebuild.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ rebuild_web_domain_conf() {
414414
$BIN/v-delete-web-domain-ftp "$user" "$domain" "$ftp_user"
415415
# Generate temporary password to add user but update afterwards
416416
temp_password=$(generate_password)
417-
$BIN/v-add-web-domain-ftp "$user" "$domain" "${ftp_user#*_}" "$temp_password" "$ftp_path"
417+
$BIN/v-add-web-domain-ftp "$user" "$domain" "${ftp_user##*_}" "$temp_password" "$ftp_path"
418418
# Updating ftp user password
419419
chmod u+w /etc/shadow
420420
sed -i "s|^$ftp_user:[^:]*:|$ftp_user:$ftp_md5:|" /etc/shadow

0 commit comments

Comments
 (0)