-
-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setcap is broken once packaged to appimage #881
Comments
Please paste the exact commands here. |
@duchy that might be a limitation because the AppImage is mounted using FUSE. Such filesystems are limited, e.g., permission wise (setuid bit cannot be used for instance). You really must provide more information, otherwise we cannot help you even if we wanted to. |
AppImages are read-only, you cannot change their contents or change their contents' capabilities. |
@TheAssassin I think you are right. It is not supported as the FUSE being used in AppImages. The program I wrote will require some capabilities, e.g. realtime priority or access raw net packets. @probonopd Do you guys have any suggestion/workarounds on this issue? |
All this is disabled for security reasons, squashfs also strips out anything that might be exploited (like setuid bits, etc.). Your app might just (re-run) itself using root through some tool like |
Check what the Etcher AppImage is to get root rights. It "just works" regarding permissions. |
That makes sense, but can you not just copy the relevant files out to Since I need this functionality as well, I set out to try to answer this question myself today and built a linuxdeploy plugin that replaces all binaries with bash script wrappers: They copy the original binary over to # assuming BINCACHE_BIN_TARGET_FOLDER='$HOME/.cache/appname/AppImage'
pushd "$APPDIR"
# Wrap all binaries
for bin in usr/bin/*; do
cp "$bin" "${bin}_bincache_"
cat > "$bin" <<EOF
#!/usr/bin/env bash
set -e
mkdir -p "$BINCACHE_BIN_TARGET_FOLDER/usr/bin"
bin_path="\$APPDIR/$bin"
bin_name="$(basename "$bin")"
source="\${bin_path}_bincache_"
dest="$BINCACHE_BIN_TARGET_FOLDER/usr/bin/\$bin_name"
# Update cache if changed
if ! time cmp --silent -- "\$source" "\$dest"; then
echo 'bincache: Caching new version' >&2
time cp "\$source" "\$dest"
# setcap: Here somewhere (I did it in the binary itself & restart itself)
fi
ln -sf "\$APPDIR/usr/lib" "$BINCACHE_BIN_TARGET_FOLDER/usr/lib"
ln -sf "\$APPDIR/usr/share" "$BINCACHE_BIN_TARGET_FOLDER/usr/share"
"\$dest" "\$@"
EOF This all works great except once Maybe I'm wrong though and it may be possible some way? It's unfortunate because I'm building an app that relies on reading from |
I know this is an old issue, but it's the #1 search result for capabilities not working on AppImage. I found a workaround I'd like to share.
Ambient capabilities seem to work on the AppImage, we used that as a workaround |
setcap cap-sys-nice+ep
With above command, capibility can be set, but takes no effect.
I tried but failed when set a thread with realtime priority in the program packaged into a appimage file on ubuntu 16.04
The text was updated successfully, but these errors were encountered: