Public bug reported:

After upgrading from Ubuntu/Kubuntu 18.04 LTS via 24.04 LTS to 26.04 LTS,
Ghostscript can no longer read PDF files located on removable media
mounted by udisks2 under

    /run/media/$USER/...

Example:

    gs -sDEVICE=pdfwrite -o /tmp/out.pdf input.pdf

fails with

    Error: /undefinedfilename
    Last OS error: Permission denied

The file exists and is readable.

Other applications (pdfinfo, cp, file, LibreOffice, Okular) can read the
same file without any problems.

strace shows:

    openat(..., "input.pdf", O_RDONLY) = -1 EACCES

The kernel log shows:

    apparmor="DENIED"
    profile="gs"

The AppArmor profile

    /etc/apparmor.d/gs

contains:

    owner file rw /media/*/**.@{gs_file_ext},

but does not allow

    /run/media/*/**.@{gs_file_ext},

Adding

    owner file rw /run/media/*/**.@{gs_file_ext},

to

    /etc/apparmor.d/local/gs

and reloading the profile fixes the problem immediately.

This appears to be a regression after the move from /media to
/run/media for removable media.

** Affects: ghostscript (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2161994

Title:
  AppArmor profile "gs" denies access to PDF files mounted under
  /run/media

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/2161994/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to