Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3313)

Unified Diff: src/scripts/mod_for_test_scripts/300changePassword

Issue 845007: Change mod_for_test_script to make it work with arm os image. (Closed)
Patch Set: patch 6. Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/scripts/mod_for_test_scripts/300changePassword
diff --git a/src/scripts/mod_for_test_scripts/300changePassword b/src/scripts/mod_for_test_scripts/300changePassword
index 44f08c3d7e98c8039bf67389f2e88679aacefd15..5e5b6d080db4f523e006edf61a20a2a8d8596615 100755
--- a/src/scripts/mod_for_test_scripts/300changePassword
+++ b/src/scripts/mod_for_test_scripts/300changePassword
@@ -4,11 +4,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# reset password for root and shared user account.
-
-LOCAL_ACCOUNT="chronos"
-echo "Reset password for root."
-passwd root < test_account.passwd 2> /dev/null
-echo "Reset password for ${LOCAL_ACCOUNT}."
-passwd ${LOCAL_ACCOUNT} < test_account.passwd 2> /dev/null
+# reset root password to test0000 (4 zeroes).
+TEMP_SHADOWFILE=${ROOT_FS_DIR}/etc/newshadow
+CRYPTED_PASSWD="$(echo "test0000" | openssl passwd -1 -stdin)"
+echo "root:${CRYPTED_PASSWD}:14500:0:::::" > ${TEMP_SHADOWFILE}
+echo "chronos:${CRYPTED_PASSWD}:14500:0:99999::::" > ${TEMP_SHADOWFILE}
+sed '/^root/ d;/^chronos/ d' ${ROOT_FS_DIR}/etc/shadow >> ${TEMP_SHADOWFILE}
+mv -f ${TEMP_SHADOWFILE} ${ROOT_FS_DIR}/etc/shadow
« no previous file with comments | « src/scripts/mod_for_test_scripts/000recordRootFsSize ('k') | src/scripts/mod_for_test_scripts/350addTestAuthKeys » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698