[GH-ISSUE #4927] broken man.profile in 0.9.68 #2821

Closed
opened 2026-05-05 09:28:27 -06:00 by gitea-mirror · 8 comments
Owner

Originally created by @hyder365 on GitHub (Feb 10, 2022).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4927

Description

Using firejail 0.9.68 on Arch Linux with "firecfg" run after the upgrade, I'm no longer able to view man pages with the man command. The issue is likely that "man" can no longer spawn the PAGER process. "man ls" prints the man page all at once without piping it to more/less. Running "man ls | less" works fine.

Steps to Reproduce

Install firejail, use the mandoc package (rather than GNU man, may be related) for the "man" command, and run it.

Expected behavior

Paging through a man page.

Actual behavior

Man page is printed all at once.

Behavior without a profile

Works normally.

Checklist

  • The issues is caused by firejail (i.e. running the program by path (e.g. /usr/bin/vlc) "fixes" it).
  • I can reproduce the issue without custom modifications (e.g. globals.local).
  • The program has a profile. (If not, request one in https://github.com/netblue30/firejail/issues/1139)
  • The profile (and redirect profile if exists) hasn't already been fixed upstream.
  • I have performed a short search for similar issues (to avoid opening a duplicate).
Originally created by @hyder365 on GitHub (Feb 10, 2022). Original GitHub issue: https://github.com/netblue30/firejail/issues/4927 <!-- See the following links for help with formatting: https://guides.github.com/features/mastering-markdown/ https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax --> ### Description Using firejail 0.9.68 on Arch Linux with "firecfg" run after the upgrade, I'm no longer able to view man pages with the man command. The issue is likely that "man" can no longer spawn the PAGER process. "man ls" prints the man page all at once without piping it to more/less. Running "man ls | less" works fine. ### Steps to Reproduce Install firejail, use the mandoc package (rather than GNU man, may be related) for the "man" command, and run it. ### Expected behavior Paging through a man page. ### Actual behavior Man page is printed all at once. ### Behavior without a profile Works normally. ### Checklist <!-- Note: Items are checked with an "x", like so: - [x] This is a checked item. --> - [x] The issues is caused by firejail (i.e. running the program by path (e.g. `/usr/bin/vlc`) "fixes" it). - [x] I can reproduce the issue without custom modifications (e.g. globals.local). - [x] The program has a profile. (If not, request one in `https://github.com/netblue30/firejail/issues/1139`) - [x] The profile (and redirect profile if exists) hasn't already been fixed [upstream](https://github.com/netblue30/firejail/tree/master/etc). - [x] I have performed a short search for similar issues (to avoid opening a duplicate).
Author
Owner

@reinerh commented on GitHub (Feb 10, 2022):

Hm, I can't reproduce this with firejail 0.9.68 in Debian.

I tried it with man from man-db and mman from mandoc (I used firejail man ls).

firecfg.config contains a comment that less breaks man. Are you sure less is not firejailed by default in your setup?

The man profile also contains no private-bin, which would prevent spawning binaries that are not listed. Do you have a man.local file?

<!-- gh-comment-id:1035314985 --> @reinerh commented on GitHub (Feb 10, 2022): Hm, I can't reproduce this with firejail 0.9.68 in Debian. I tried it with man from man-db and mman from mandoc (I used `firejail man ls`). firecfg.config contains a comment that `less` breaks man. Are you sure less is not firejailed by default in your setup? The man profile also contains no `private-bin`, which would prevent spawning binaries that are not listed. Do you have a `man.local` file?
Author
Owner

@hyder365 commented on GitHub (Feb 10, 2022):

There's no "less" symlink in /usr/local/bin with the other firejailed programs, and "which less" returns /sbin/less.

Nothing in ~/.config/firejail is related to less or man.

I just confirmed the same problem on a separate but similar Arch laptop with mandoc and no ~/.config/firejail directory.

edit to add: I get an error like this too:

man: /usr/share/man/man8/ntpd.8.gz: SYSERR: mkstemp: /tmp/man.XXXXrVTZqh: Read-only file system

But /tmp is of course not read-only, and calling "man" from the installed binary path rather than with firejail works fine.

<!-- gh-comment-id:1035334169 --> @hyder365 commented on GitHub (Feb 10, 2022): There's no "less" symlink in /usr/local/bin with the other firejailed programs, and "which less" returns /sbin/less. Nothing in ~/.config/firejail is related to less or man. I just confirmed the same problem on a separate but similar Arch laptop with mandoc and no ~/.config/firejail directory. edit to add: I get an error like this too: man: /usr/share/man/man8/ntpd.8.gz: SYSERR: mkstemp: /tmp/man.XXXXrVTZqh: Read-only file system But /tmp is of course not read-only, and calling "man" from the installed binary path rather than with firejail works fine.
Author
Owner

@reinerh commented on GitHub (Feb 10, 2022):

Ah, the man.profile has read-only /tmp. It looks like your man program tries to save a temporary file in /tmp.
You can fix this by adding ignore read-only /tmp to man.local.
But I'm wondering why this happens on your system and not on mine.
I tested with mandoc 1.14.6 and man-db 2.10.0.

<!-- gh-comment-id:1035346669 --> @reinerh commented on GitHub (Feb 10, 2022): Ah, the man.profile has `read-only /tmp`. It looks like your man program tries to save a temporary file in `/tmp`. You can fix this by adding `ignore read-only /tmp` to man.local. But I'm wondering why this happens on your system and not on mine. I tested with mandoc 1.14.6 and man-db 2.10.0.
Author
Owner

@rusty-snake commented on GitHub (Feb 10, 2022):

cc @hlein

https://github.com/gentoo/gentoo/pull/24102/commits/1c49f0ec610e8dc66f94756711d15fcb14d28852#diff-95e09230bc946491c552d0240ab3baa07dc9f2a6f4196998d865f3902094b6ff

firecfg.config
-man
+# Breaks: $ man chromium-browser
+# WARNING: terminal is not fully functional
+# Press RETURN to continue 
+# Manual page chromium-browser(1) byte 0/0 (END) (press h for help or q to quit)
+#man
<!-- gh-comment-id:1035435593 --> @rusty-snake commented on GitHub (Feb 10, 2022): cc @hlein https://github.com/gentoo/gentoo/pull/24102/commits/1c49f0ec610e8dc66f94756711d15fcb14d28852#diff-95e09230bc946491c552d0240ab3baa07dc9f2a6f4196998d865f3902094b6ff > ```diff > firecfg.config > -man > +# Breaks: $ man chromium-browser > +# WARNING: terminal is not fully functional > +# Press RETURN to continue > +# Manual page chromium-browser(1) byte 0/0 (END) (press h for help or q to quit) > +#man > ```
Author
Owner

@hlein commented on GitHub (Feb 10, 2022):

Hah, yes I think I had done that or picked it up from somewhere. firejail man does indeed error on Gentoo, but for different reasons than @hyder365 reports on Arch:

$ firejail man ls
WARNING: terminal is not fully functional
Press RETURN to continue

So, I disabled man in Gentoo's firecfg.config in my latest package update. But I hadn't yet investigated to see if I could figure out what changes to man.profile could fix it.

Meanwhile, firejail less works but also doesn't. firejail less largefile does not error, and you can pageup/down, search, etc. But ^C is not caught (causes less to exit). So I suspect again/also, terminal related.

<!-- gh-comment-id:1035450995 --> @hlein commented on GitHub (Feb 10, 2022): Hah, yes I think I had done that or picked it up from somewhere. `firejail man` does indeed error on Gentoo, but for different reasons than @hyder365 reports on Arch: ``` $ firejail man ls WARNING: terminal is not fully functional Press RETURN to continue ``` So, I disabled man in Gentoo's `firecfg.config` in my latest package update. But I hadn't yet investigated to see if I could figure out what changes to `man.profile` could fix it. Meanwhile, `firejail less` works but also doesn't. `firejail less largefile` does not error, and you can pageup/down, search, etc. But `^C` is not caught (causes less to exit). So I suspect again/also, terminal related.
Author
Owner

@hyder365 commented on GitHub (Feb 11, 2022):

Ah, the man.profile has read-only /tmp. It looks like your man program tries to save a temporary file in /tmp. You can fix this by adding ignore read-only /tmp to man.local. But I'm wondering why this happens on your system and not on mine. I tested with mandoc 1.14.6 and man-db 2.10.0.

Thanks. It looks like mandoc creates files in /tmp by default, on OpenBSD as well as Linux.

<!-- gh-comment-id:1035678862 --> @hyder365 commented on GitHub (Feb 11, 2022): > Ah, the man.profile has `read-only /tmp`. It looks like your man program tries to save a temporary file in `/tmp`. You can fix this by adding `ignore read-only /tmp` to man.local. But I'm wondering why this happens on your system and not on mine. I tested with mandoc 1.14.6 and man-db 2.10.0. Thanks. It looks like mandoc creates files in /tmp by default, on OpenBSD as well as Linux.
Author
Owner

@netblue30 commented on GitHub (Feb 14, 2022):

Bug/no bug? Would it be a good idea to remove man from firecfg.config, so it is not enabled by default?

<!-- gh-comment-id:1039201683 --> @netblue30 commented on GitHub (Feb 14, 2022): Bug/no bug? Would it be a good idea to remove man from firecfg.config, so it is not enabled by default?
Author
Owner

@rusty-snake commented on GitHub (Feb 14, 2022):

At least read-only /tmp should be remove.

<!-- gh-comment-id:1039203073 --> @rusty-snake commented on GitHub (Feb 14, 2022): At least `read-only /tmp` should be remove.
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#2821
No description provided.