Merge pull request #7161 from antonlacon/openssl-passwd

buildsystem: adjust for python crypt module deprecation
This commit is contained in:
CvH 2022-11-27 22:05:48 +01:00 committed by GitHub
commit 5ee9fb6f93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -1612,7 +1612,7 @@ add_user() {
if [ "$PASSWORD" = "x" ]; then
PASSWORD="*"
else
PASSWORD=$(python -c "import crypt; print(crypt.crypt('$PASSWORD', crypt.mksalt(crypt.METHOD_SHA512)))")
PASSWORD=$(openssl passwd -6 "${PASSWORD}")
fi
if ! grep -q "^$1:" ${INSTALL}/usr/cache/shadow; then
echo "$1:$PASSWORD:::::::" >> ${INSTALL}/usr/cache/shadow

View File

@ -99,18 +99,18 @@ chmod 700 /var/config/proftpd.passwd
for NUM in $(seq 1 100); do
case "$CryptoHash" in
"0") password_salt=$(python -c "import crypt; print(crypt.mksalt(crypt.METHOD_SHA512))");;
"1") password_salt=$(python -c "import crypt; print(crypt.mksalt(crypt.METHOD_SHA256))");;
"2") password_salt=$(python -c "import crypt; print(crypt.mksalt(crypt.METHOD_MD5))");;
esac
USERNAME=$(eval echo \$Username${NUM})
USERPASS=$(eval echo \$Userpass${NUM})
USERPATH=$(eval echo \$Userpath${NUM})
case "$CryptoHash" in
"0") password_entry=$(openssl passwd -6 "${USERPASS}");;
"1") password_entry=$(openssl passwd -5 "${USERPASS}");;
"2") password_entry=$(openssl passwd -1 "${USERPASS}");;
esac
if [ -n "$USERNAME" ]; then
echo $USERNAME:$(python -c "import crypt; print(crypt.crypt('${USERPASS}', '${password_salt}'))"):10:10::$USERPATH:/bin/false >> /var/config/proftpd.passwd
echo $USERNAME:$password_entry:10:10::$USERPATH:/bin/false >> /var/config/proftpd.passwd
# user writes with different user/group
mkdir -p "$USERPATH"
chmod 777 "$USERPATH"

View File

@ -7,7 +7,7 @@ PKG_VERSION=""
PKG_LICENSE="GPL"
PKG_SITE="https://libreelec.tv"
PKG_URL=""
PKG_DEPENDS_HOST="autoconf:host autoconf-archive:host automake:host bison:host configtools:host cmake:host flex:host intltool:host libtool:host ninja:host make:host meson:host p7zip:host pigz:host sed:host xmlstarlet:host xz:host"
PKG_DEPENDS_HOST="autoconf:host autoconf-archive:host automake:host bison:host configtools:host cmake:host flex:host intltool:host libtool:host ninja:host make:host meson:host openssl:host p7zip:host pigz:host sed:host xmlstarlet:host xz:host"
PKG_DEPENDS_TARGET="toolchain:host gcc:host"
PKG_SECTION="virtual"
PKG_LONGDESC="LibreELEC.tv' toolchain to compile all packages"