From 2f428d1a3f4b65cadab0259938d7aa3e5b0e3b80 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 25 Sep 2026 03:09:15 -0400 Subject: sbodl: chown downloaded files to the cache dir's owner if running as root. --- sbodl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sbodl') diff --git a/sbodl b/sbodl index 397507b..cb07716 100755 --- a/sbodl +++ b/sbodl @@ -267,6 +267,9 @@ for dl in $DL; do else wget $EXTRAWGETARGS $WGETARGS "$dl" || die "Download failed, try '$SELF -a'." if [ -e "$FILE" ]; then + # the chown keeps sbrun sudo users from having root-owned + # files in ~/sbodl-cache. + chown --reference="$CACHEDIR" "$FILE" &>/dev/null mv -b "$FILE" "$CACHEDIR" ln -s "$CACHEDIR/$FILE" "$FILE" fi -- cgit v1.2.3