--- xbmc-17.3-Krypton/tools/Linux/kodi.sh.in.orig 2017-06-08 14:21:19.778380804 +0200 +++ xbmc-17.3-Krypton/tools/Linux/kodi.sh.in 2017-06-08 14:23:02.630455849 +0200 @@ -27,7 +27,7 @@ LIBDIR="@libdir@" CRASHLOG_DIR=${CRASHLOG_DIR:-$HOME} USERDATA_DIR="${HOME}/.${bin_name}" - +USERDATA_PERMS="700" # Workaround for high CPU load with nvidia GFX export __GL_YIELD=USLEEP @@ -35,7 +35,17 @@ # Fix wasting RAM due to fragmentation export MALLOC_MMAP_THRESHOLD_=131072 - +check_perms() +{ +if [ -d "${USERDATA_DIR}" ]; then + CURRENT_PERMS="$(stat -c '%a' ${USERDATA_DIR})" + if [ $USERDATA_PERMS != $CURRENT_PERMS ]; then + echo "INFO: $USERDATA_DIR is world readable!" + echo "INFO: switching to $USERDATA_PERMS" + chmod $USERDATA_PERMS $USERDATA_DIR + fi +fi +} migrate_home() { @@ -138,6 +148,9 @@ migrate_home +#check and fix perms after having migrated home +check_perms + if command_exists gdb; then # Output warning in case ulimit is unsupported by shell eval ulimit -c unlimited @@ -161,4 +174,8 @@ fi done +#check perm again, for first ever start of kodi, USERDATA_DIR did not +#yet exist before +check_perms + exit $RET