From 3e7f267e6d994d8cfe5e51afbc0468bb75eed30b Mon Sep 17 00:00:00 2001 From: Jocelyn Le Sage Date: Tue, 29 Nov 2022 12:38:47 -0500 Subject: [PATCH] Use helper to take ownership of `/output`. --- rootfs/etc/cont-init.d/55-jdownloader2.sh | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/rootfs/etc/cont-init.d/55-jdownloader2.sh b/rootfs/etc/cont-init.d/55-jdownloader2.sh index 930919d..ac932b0 100755 --- a/rootfs/etc/cont-init.d/55-jdownloader2.sh +++ b/rootfs/etc/cont-init.d/55-jdownloader2.sh @@ -52,18 +52,6 @@ else fi # Take ownership of the output directory. -if ! chown $USER_ID:$GROUP_ID /output 2>/dev/null; then - # Failed to take ownership of /output. This could happen when, - # for example, the folder is mapped to a network share. - # Continue if we have write permission, else fail. - TMPFILE="$(su-exec $USER_ID:$GROUP_ID mktemp /output/.test_XXXXXX 2>/dev/null)" - if [ $? -eq 0 ]; then - # Success, we were able to write file. - su-exec $USER_ID:$GROUP_ID rm "$TMPFILE" - else - log "ERROR: Failed to take ownership and no write permission on /output." - exit 1 - fi -fi +take-ownership /output # vim: set ft=sh :