mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
Merge pull request #7161 from antonlacon/openssl-passwd
buildsystem: adjust for python crypt module deprecation
This commit is contained in:
commit
5ee9fb6f93
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user