[GH-ISSUE #3975] Running xpdf in friejail #2486

Closed
opened 2026-05-05 09:10:12 -06:00 by gitea-mirror · 10 comments
Owner

Originally created by @domivogt on GitHub (Feb 11, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3975

This (hopefully) isn't a bug report but just a usage question:

I want to run xpdf in a sandbox. Problem is that a simple

$ fireail xpdf /some/path/pdffile

Does not work because the path is not whitelisted. Whitelisting the whole system seems wrong; xpdf should simply have read access to the file on the command line and nothing else (except config files of course). However, it's not so easy to figure out at which position xpdf's files arguemnt is. It's not necessarily the last one.

Originally created by @domivogt on GitHub (Feb 11, 2021). Original GitHub issue: https://github.com/netblue30/firejail/issues/3975 This (hopefully) isn't a bug report but just a usage question: I want to run xpdf in a sandbox. Problem is that a simple $ fireail xpdf /some/path/pdffile Does not work because the path is not whitelisted. Whitelisting the whole system seems wrong; xpdf should simply have read access to the file on the command line and nothing else (except config files of course). However, it's not so easy to figure out at which position xpdf's files arguemnt is. It's not necessarily the last one.
Author
Owner

@rusty-snake commented on GitHub (Feb 11, 2021):

Duplicate of #838

<!-- gh-comment-id:777741445 --> @rusty-snake commented on GitHub (Feb 11, 2021): Duplicate of #838
Author
Owner

@rusty-snake commented on GitHub (Feb 11, 2021):

Does not work because the path is not whitelisted.

xpdf has a blacklisting profile, did you add the whitelisting stuff?

<!-- gh-comment-id:777741597 --> @rusty-snake commented on GitHub (Feb 11, 2021): > Does not work because the path is not whitelisted. xpdf has a blacklisting profile, did you add the whitelisting stuff?
Author
Owner

@domivogt commented on GitHub (Feb 11, 2021):

I've not changed anything. This is the problem I want to solve:

$ firejail --profile=/usr/local/etc/firejail/xpdf.profile xpdf /data/foo.pdf
error: "/data/foo.pdf" file not found

It works if the file is in $HOME.

<!-- gh-comment-id:777753261 --> @domivogt commented on GitHub (Feb 11, 2021): I've not changed anything. This is the problem I want to solve: ``` $ firejail --profile=/usr/local/etc/firejail/xpdf.profile xpdf /data/foo.pdf error: "/data/foo.pdf" file not found ``` It works if the file is in $HOME.
Author
Owner

@rusty-snake commented on GitHub (Feb 11, 2021):

I've not changed anything.

No globals.local or other *.local and nothing in firejail.config. Ok, does it work with firejail --noprofile /usr/bin/xpdf /data/foo.pdf.
Also is /data mounted with something "crazy" like fuse, nfs, ...?
EDIT: or symlinked from somewhere? Shows firejail --debug xpdf /data/foo.pdf anything like "Disable /data"?

<!-- gh-comment-id:777755316 --> @rusty-snake commented on GitHub (Feb 11, 2021): > I've not changed anything. No globals.local or other *.local and nothing in firejail.config. Ok, does it work with `firejail --noprofile /usr/bin/xpdf /data/foo.pdf`. Also is /data mounted with something "crazy" like fuse, nfs, ...? EDIT: or symlinked from somewhere? Shows `firejail --debug xpdf /data/foo.pdf` anything like "Disable /data"?
Author
Owner

@domivogt commented on GitHub (Feb 11, 2021):

No globals.local or other *.local and nothing in firejail.config.

Firejail-0.9.64.4 is just installed as built, without any changes to anything (except seamonkey.local and iceweasel.local).

Ok, does it work with firejail --noprofile /usr/bin/xpdf /data/foo.pdf.

Yes. However, it looks weird overall: If the file is in /data/.../foo.pdf, it works. If it's in /home/data/.../foo.pdf it doesn't. (/home is on a different partition, but not mounted with any exciting options:

/dev/sda1 on / type ext4 (rw,noatime,nodiratime,discard)
/dev/sda3 on /home type ext4 (rw,noatime,nodiratime,discard)

Is /home treated differently than other dirs?

Also is /data mounted with something "crazy" like fuse, nfs, ...?

/data is just a world readable directory in the root filesystem.

or symlinked from somewhere?

Nope.

Shows firejail --debug xpdf /data/foo.pdf anything like "Disable /data"?

No.

<!-- gh-comment-id:777768241 --> @domivogt commented on GitHub (Feb 11, 2021): > No globals.local or other *.local and nothing in firejail.config. Firejail-0.9.64.4 is just installed as built, without any changes to anything (except seamonkey.local and iceweasel.local). > Ok, does it work with firejail --noprofile /usr/bin/xpdf /data/foo.pdf. Yes. However, it looks weird overall: If the file is in /data/.../foo.pdf, it works. If it's in /home/data/.../foo.pdf it doesn't. (/home is on a different partition, but not mounted with any exciting options: ``` /dev/sda1 on / type ext4 (rw,noatime,nodiratime,discard) /dev/sda3 on /home type ext4 (rw,noatime,nodiratime,discard) ``` Is /home treated differently than other dirs? > Also is /data mounted with something "crazy" like fuse, nfs, ...? /data is just a world readable directory in the root filesystem. > or symlinked from somewhere? Nope. > Shows firejail --debug xpdf /data/foo.pdf anything like "Disable /data"? No.
Author
Owner

@rusty-snake commented on GitHub (Feb 11, 2021):

Is /home treated differently than other dirs?

Yes, only /home/user is present without --allusers.

<!-- gh-comment-id:777769294 --> @rusty-snake commented on GitHub (Feb 11, 2021): > Is /home treated differently than other dirs? Yes, only `/home/user` is present without `--allusers`.
Author
Owner

@domivogt commented on GitHub (Feb 11, 2021):

Fair enough. So, assuming you have the full path of a file, like /data/som/subdir/file.pdf. Is there a simple way to whitelist that path, and only that path, regardless of any other active rules?

(And if that's possible, is it possible to remove write permissions on the path and to the file?)

<!-- gh-comment-id:777774205 --> @domivogt commented on GitHub (Feb 11, 2021): Fair enough. So, assuming you have the full path of a file, like /data/som/subdir/file.pdf. Is there a simple way to whitelist that path, and only that path, regardless of any other active rules? (And if that's possible, is it possible to remove write permissions on the path and to the file?)
Author
Owner

@rusty-snake commented on GitHub (Feb 11, 2021):

(And if that's possible, is it possible to remove write permissions on the path and to the file?)

read-only /path/to/file, if you only view pdfs, you could read-only /data and read-only ${HOME}.

Is there a simple way to whitelist that path, and only that path, regardless of any other active rules?

No, the are multiple options granting/denying access to a file.

Work firejail --withelist=/data/foo.pdf xpdf /data/pdf? EDIT: it can not work.

<!-- gh-comment-id:777780925 --> @rusty-snake commented on GitHub (Feb 11, 2021): > (And if that's possible, is it possible to remove write permissions on the path and to the file?) `read-only /path/to/file`, if you only view pdfs, you could `read-only /data` and `read-only ${HOME}`. > Is there a simple way to whitelist that path, and only that path, regardless of any other active rules? No, the are multiple options granting/denying access to a file. ~Work `firejail --withelist=/data/foo.pdf xpdf /data/pdf`?~ EDIT: it can not work.
Author
Owner

@rusty-snake commented on GitHub (Apr 6, 2021):

Looks like you need to comment the profile and the uncomment it line for line to find the cause.

<!-- gh-comment-id:814191898 --> @rusty-snake commented on GitHub (Apr 6, 2021): Looks like you need to comment the profile and the uncomment it line for line to find the cause.
Author
Owner

@rusty-snake commented on GitHub (May 12, 2021):

I'm closing here due to inactivity, please fell free to request to reopen if you still have this issue.

<!-- gh-comment-id:839994310 --> @rusty-snake commented on GitHub (May 12, 2021): I'm closing here due to inactivity, please fell free to request to reopen if you still have this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#2486
No description provided.