Explorar o código

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 #827
Robert Zollner %!s(int64=5) %!d(string=hai) anos
pai
achega
57d9537527
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      func/rebuild.sh

+ 2 - 2
func/rebuild.sh

@@ -43,7 +43,7 @@ rebuild_user_conf() {
 
     # Update password
     chmod u+w /etc/shadow
-    sed -i 's/^$user:[^:]*:/$user:$MD5:/' /etc/shadow
+    sed -i "s|^$user:[^:]*:|$user:$MD5:|" /etc/shadow
     chmod u-w /etc/shadow
 
     # Building directory tree
@@ -334,7 +334,7 @@ rebuild_web_domain_conf() {
 
             # Updating ftp user password
             chmod u+w /etc/shadow
-            sed -i 's/^$ftp_user:[^:]*:/$ftp_user:$ftp_md5:/' /etc/shadow
+            sed -i "s|^$ftp_user:[^:]*:|$ftp_user:$ftp_md5:|" /etc/shadow
             chmod u-w /etc/shadow
         fi
     done