Skip to content

Commit 57d9537

Browse files
committed
Restore backup: change sed pattern delimitator from '/' to '|' as it was conflicting with password hash characters
Also sed pattern was surrounded with single quotes and bash variables were not substituited Fixes hestiacp#827
1 parent 0a6e29b commit 57d9537

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

func/rebuild.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ rebuild_user_conf() {
4343

4444
# Update password
4545
chmod u+w /etc/shadow
46-
sed -i 's/^$user:[^:]*:/$user:$MD5:/' /etc/shadow
46+
sed -i "s|^$user:[^:]*:|$user:$MD5:|" /etc/shadow
4747
chmod u-w /etc/shadow
4848

4949
# Building directory tree
@@ -334,7 +334,7 @@ rebuild_web_domain_conf() {
334334

335335
# Updating ftp user password
336336
chmod u+w /etc/shadow
337-
sed -i 's/^$ftp_user:[^:]*:/$ftp_user:$ftp_md5:/' /etc/shadow
337+
sed -i "s|^$ftp_user:[^:]*:|$ftp_user:$ftp_md5:|" /etc/shadow
338338
chmod u-w /etc/shadow
339339
fi
340340
done

0 commit comments

Comments
 (0)