]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Encrypt temporary password we're setting.
authorDarren Tucker <dtucker@dtucker.net>
Sun, 29 Jun 2025 04:34:48 +0000 (14:34 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Sun, 29 Jun 2025 04:52:43 +0000 (14:52 +1000)
Now that we want to actually use the random password for tests, we need
to correctly encrypt it, instead of just setting it to a random string
that's not the "locked" value.

.github/setup_ci.sh

index 598b0624a6d9749af1a7839c2eb87f84116c6459..8ed1d178325f9902e819599a425615b83fcddbb6 100755 (executable)
@@ -308,11 +308,11 @@ if [ ! -z "${EPHEMERAL_VM}" ]; then
     # value, so unless we reset it here most of the tests will fail.
     case "${target}" in
     ubuntu-*)
-       echo ${target} target: setting random password string.
-       pw=$(openssl rand -base64 9)
+       echo ${target} target: setting random password.
+       openssl rand -base64 9 >regress/password
+       pw=$(tr -d '\n' <regress/password | openssl passwd -6 -stdin)
        sudo usermod --password "${pw}" runner
        sudo usermod --unlock runner
-       echo "${pw}" > regress/password
        ;;
     esac
 fi