Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > 7019690d00b8d3755f872bf50ffedca9 > files > 4

kodi-14.0-2.3.mga5.src.rpm

--- xbmc-14.0-Helix/tools/Linux/kodi.sh.in.0215	2017-06-08 13:21:09.040898827 +0000
+++ xbmc-14.0-Helix/tools/Linux/kodi.sh.in	2017-06-08 13:23:46.584083042 +0000
@@ -27,8 +27,21 @@
 LIBDIR="@libdir@"
 CRASHLOG_DIR=${CRASHLOG_DIR:-$HOME}
 USERDATA_DIR="${HOME}/.${bin_name}"
+USERDATA_PERMS="700"
 
 
+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()
 {
   [ "$(basename $0)" = "xbmc" ] && echo "WARNING: running ${bin_name} as "xbmc" is deprecated and will be removed in later versions, please switch to using the ${bin_name} binary"
@@ -124,6 +137,9 @@
 }
 
 migrate_home
+
+check_perms
+
 python @datadir@/${bin_name}/FEH.py "$@"
 RET=$?
 if [ $RET -ne 0 ]; then
@@ -153,4 +169,8 @@
   fi
 done
 
+#check perm again, for first ever start of kodi, USERDATA_DIR did not
+#yet exist before
+check_perms
+
 exit $RET