functions: add_user: replace python with openssl

python's crypt module is deprecated in 3.11 and to be removed in 3.13.
Replace its usage with openssl's passwd.

Signed-off-by: Ian Leonard <antonlacon@gmail.com>
This commit is contained in:
Ian Leonard 2021-10-09 19:55:45 +00:00
parent 5132be1a1d
commit 79a4a5dd8c
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -7,7 +7,7 @@ PKG_VERSION=""
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_SITE="https://libreelec.tv" PKG_SITE="https://libreelec.tv"
PKG_URL="" 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_DEPENDS_TARGET="toolchain:host gcc:host"
PKG_SECTION="virtual" PKG_SECTION="virtual"
PKG_LONGDESC="LibreELEC.tv' toolchain to compile all packages" PKG_LONGDESC="LibreELEC.tv' toolchain to compile all packages"