From 36e69d0c7761d9f21bfe2400215fe44fcd8129bd Mon Sep 17 00:00:00 2001 From: Darin Petkov Date: Thu, 17 Feb 2011 09:34:29 -0800 Subject: [PATCH] set_shared_user_password.sh updates /etc/shared_user_passwd.txt This is necessary so that the baselayout ebuild can be changed to set /etc/passwd and /etc/shadow appropriately. A previous attempt to do this through an environment variable in make.conf.user failed because pkg_postinst from binary packages run in their prebuilt environment (and, thus, are not picking the user specific variables). BUG=chromium-os:11664 TEST=ran set_shared_user_password.sh multiple times, observed /etc/shared_user_passwd.txt and shared_user_passwd.txt getting updated. Change-Id: I23b77c7417db0fd18b251f7cca62027813b182a8 Review URL: http://codereview.chromium.org/6534003 --- set_shared_user_password.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/set_shared_user_password.sh b/set_shared_user_password.sh index bdc7c44f1a..72d0ab0688 100755 --- a/set_shared_user_password.sh +++ b/set_shared_user_password.sh @@ -43,10 +43,13 @@ set -e # Get password read -p "Enter password for shared user account: " PASSWORD -CRYPTED_PASSWD_FILE=$SCRIPTS_DIR/shared_user_passwd.txt CRYPTED_PASSWD="$(echo "$PASSWORD" | openssl passwd -1 -stdin)" PASSWORD="gone now" -echo "$CRYPTED_PASSWD" > $CRYPTED_PASSWD_FILE +CRYPTED_PASSWD_FILE="${SCRIPTS_DIR}/shared_user_passwd.txt" +echo "${CRYPTED_PASSWD}" > "${CRYPTED_PASSWD_FILE}" -echo "Shared user password set in $CRYPTED_PASSWD_FILE" +SHARED_USER_PASSWD_FILE="/etc/shared_user_passwd.txt" +echo "${CRYPTED_PASSWD}" | sudo_clobber "${SHARED_USER_PASSWD_FILE}" + +echo "Password set in ${CRYPTED_PASSWD_FILE} and ${SHARED_USER_PASSWD_FILE}"