Skip to content

Commit

Permalink
Use helper to take ownership of /output.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlesage committed Nov 29, 2022
1 parent c008337 commit 3e7f267
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions rootfs/etc/cont-init.d/55-jdownloader2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 :

0 comments on commit 3e7f267

Please sign in to comment.