! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
libmagic doesn't follow symlinks, unable to view symlinked images
Status:
RESOLVED: FIXED
Product:
Ristretto
Component:
Application

Comments

Description candyangel 2017-05-15 19:38:46 CEST
The change to use libmagic in 0.8.2 has made Ristretto unable to open images through symlinks as libmagic isn't instructed to follow them. This makes it return a non-image mime type (presumably x-symlink or something like that).

The call to magic_open() in src/file.c (line 406) should be:

magic_t magic = magic_open(MAGIC_MIME_TYPE | MAGIC_SYMLINK);

This fixes the behaviour.

I've put this as major/high as it makes Ristretto not work correctly, but doesn't cause any data loss or anything like that. I hope this is appropriate!
Comment 1 candyangel 2017-05-15 19:41:03 CEST
The problem can be shown by following these steps, then trying to open symtest/subdir/test.png (the symlink).

mkdir symtest
cd symtest
curl -O 'http://test.gregorcapuder.com/wp-content/uploads/2016/01/test.png'
mkdir subdir
cd subdir
ln -s ../test.png
Comment 2 Igor editbugs 2017-06-05 17:15:17 CEST
Thanks! I will fix it with your proposed change,

Bug #13576

Reported by:
candyangel
Reported on: 2017-05-15
Last modified on: 2017-06-06

People

CC List:
1 user

Version

Attachments

Additional information