shadow: move from .config to .cache

This commit is contained in:
MilhouseVH 2017-12-07 21:40:45 +00:00
parent dcd653b5a4
commit dc30a81d1c
3 changed files with 8 additions and 9 deletions

View File

@ -369,15 +369,16 @@ add_user() {
echo "$1:x:$3:$4:$5:$6:$7" >> ${INSTALL}/etc/passwd
fi
touch ${INSTALL}/usr/config/shadow
ln -sf /storage/.config/shadow ${INSTALL}/etc/shadow
mkdir -p ${INSTALL}/usr/cache
touch ${INSTALL}/usr/cache/shadow
ln -sf /storage/.cache/shadow ${INSTALL}/etc/shadow
PASSWORD="$2"
if [ "$PASSWORD" = "x" ]; then
PASSWORD="*"
fi
if ! grep -q "^$1:" ${INSTALL}/usr/config/shadow; then
echo "$1:$PASSWORD:::::::" >> ${INSTALL}/usr/config/shadow
if ! grep -q "^$1:" ${INSTALL}/usr/cache/shadow; then
echo "$1:$PASSWORD:::::::" >> ${INSTALL}/usr/cache/shadow
fi
}

View File

@ -196,7 +196,7 @@ post_install() {
ROOT_PWD="`$TOOLCHAIN/bin/cryptpw -m sha512 $ROOT_PASSWORD`"
echo "chmod 4755 $INSTALL/usr/bin/busybox" >> $FAKEROOT_SCRIPT
echo "chmod 000 $INSTALL/usr/config/shadow" >> $FAKEROOT_SCRIPT
echo "chmod 000 $INSTALL/usr/cache/shadow" >> $FAKEROOT_SCRIPT
add_user root "$ROOT_PWD" 0 0 "Root User" "/storage" "/bin/sh"
add_group root 0

View File

@ -1,7 +1,7 @@
#!/bin/sh
################################################################################
# This file is part of LibreELEC - http://www.libreelec.tv
# Copyright (C) 2017 Team LibreELEC
# This file is part of LibreELEC - https://libreelec.tv
# Copyright (C) 2017-present Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -24,5 +24,3 @@ done
# Copy config files, but don't overwrite - this should replace our sample files
false | cp -iRp /usr/config/* /storage/.config/ &>/dev/null
[ -f /storage/.config/shadow ] && chmod 000 /storage/.config/shadow || true