Bubblewrap integration broke user thumbnailers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gnome-desktop3 (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
This bug is related to https:/
The recent hardening on thumbnailers by using bubblewrap is causing a problem with user-installed thumbnailers. Consider this (for example) thumbnailer to add a small Dilbert icon to the GIMP .xcf files:
#!/bin/bash
tmpfile1=$(tempfile --directory /tmp --prefix xcft --suffix .png)
trap 'rm -rf $tmpfile1' INT EXIT TERM
die() {
echo >&2 "$@"
rm -rf $tmpfile1
exit 1
}
# The script will be called with parameters : -s %s %u %o
# -s %s: vertical size, %u: input url, %o: output file
if [ $1 = "-s" ]; then
size=$2
uin=$3
fout=$4
else
size=32 #default size
uin=$1
fout=$2
fi
# uin es una url, eliminar "file://"
fin="${
/usr/bin/
/usr/bin/
\( -resize $((size/
\( -resize $sizex$size $tmpfile1 \) "$fout" || die "convert failed"
rm -rf $tmpfile1
exit 0
It used to work before the last update to use bubblewrap, and now doesn't work anymore. I tried to dig into https:/
mkdir /tmp/temporary
bwrap --ro-bind /usr /usr \
--ro-bind /etc/ld.so.cache /etc/ld.so.cache \
--ro-bind /bin /bin \
--ro-bind /lib64 /lib64 \
--ro-bind /lib /lib \
--ro-bind /sbin /sbin \
--proc /proc \
--dev /dev \
--chdir / \
--setenv GIO_USE_VFS local \
--unshare-all \
--die-
--bind /tmp/temporary /tmp \
--ro-bind /home/romano/
/usr/
#
cp /tmp/temporary/
...and this way, my thumbnailer did succeed in creating the PNG with the correct preview. But when called internally by gnome, it fails, and creates a strange "~/.cache/
�PNG
IHDRĉd�EtEXtThumb
[...]
Notice anyway that one of the problems was that originally the thumbnailer called
/usr/ bin/composite
which, do to the alternative setup in .deb packages, was a link to /etc/alternativ es/composite that pointed back to the real binary; probably the "/etc/alternati ves/" directory should be added to the bind-ed directories...