From 6c1acea4bd4a1f1c8329c7160b8d72f5ad2c108c Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 5 Apr 2022 13:15:03 -0400 Subject: support usr/share/applications/screensavers --- sbopkglint.d/35-desktop.t.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/sbopkglint.d/35-desktop.t.sh b/sbopkglint.d/35-desktop.t.sh index 9650ef4..03f52de 100644 --- a/sbopkglint.d/35-desktop.t.sh +++ b/sbopkglint.d/35-desktop.t.sh @@ -13,14 +13,16 @@ BADPERMS="" BADDESKTOP="" NONDESKTOP="" -if [ -d usr/share/applications ]; then - # doinst.sh creates this, don't check here now that we have a doinst test. - #[ -e "usr/share/applications/mimeinfo.cache" ] || warn "doinst.sh is missing update-desktop-database" - for f in usr/share/applications/*; do +check_desktop_dir() { + local dir="$1" + [ -d "$dir" ] || return + + for f in $dir/*; do [ -e "$f" ] || continue [ "$f" = "usr/share/applications/mimeinfo.cache" ] && continue + [ "$f" = "usr/share/applications/screensavers" ] && continue [ "$( stat -Lc '%a %U %G' "$f" )" = "644 root root" ] || BADPERMS+="$f " case "$f" in @@ -28,8 +30,13 @@ if [ -d usr/share/applications ]; then *) NONDESKTOP+="$f " ;; esac done +} + +for dir in usr/share/applications usr/share/applications/screensavers; do + check_desktop_dir "$dir" +done + - [ -n "$BADPERMS" ] && warn "bad permissions/owner on .desktop files (should be 0644 root:root):" && ls -ld $BADPERMS - [ -n "$BADDESKTOP" ] && warn ".desktop files fail to validate:" && ls -ld $BADDESKTOP - [ -n "$NONDESKTOP" ] && warn "unknown file (not .desktop) in desktop dir:" && ls -ld $NONDESKTOP -fi +[ -n "$BADPERMS" ] && warn "bad permissions/owner on .desktop files (should be 0644 root:root):" && ls -ld $BADPERMS +[ -n "$BADDESKTOP" ] && warn ".desktop files fail to validate:" && ls -ld $BADDESKTOP +[ -n "$NONDESKTOP" ] && warn "unknown file (not .desktop) in desktop dir:" && ls -ld $NONDESKTOP -- cgit v1.2.3