Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Man pages have #ifdefs in them #3782

Closed
1 of 6 tasks
kmk3 opened this issue Dec 1, 2020 · 1 comment
Closed
1 of 6 tasks

Man pages have #ifdefs in them #3782

kmk3 opened this issue Dec 1, 2020 · 1 comment

Comments

@kmk3
Copy link
Collaborator

kmk3 commented Dec 1, 2020

Bug and expected behavior

  • Describe the bug.

So, I was browsing through the man pages when I noticed this:

$ man firejail | grep '#if'
              #ifdef HAVE_X11 $ firejail --appimage --net=none --x11 krita-3.0-x86_64.appimage
              [...]  #if HAVE_USERNS
              #ifdef HAVE_X11
$ pacman -Qlq firejail | grep /man/ | grep -v '/$' | xargs -I '{}' -n 1 sh -c 'printf "%s\n" "{}"; man "{}" | grep "#if"'
/usr/share/man/man1/firecfg.1.gz
/usr/share/man/man1/firejail.1.gz
              #ifdef HAVE_X11 $ firejail --appimage --net=none --x11 krita-3.0-x86_64.appimage
              [...]  #if HAVE_USERNS
              #ifdef HAVE_X11
/usr/share/man/man1/firemon.1.gz
/usr/share/man/man5/firejail-login.5.gz
/usr/share/man/man5/firejail-profile.5.gz
              Return a different error instead of EPERM to the process, kill it when an attempt is made to call a blocked system call, or allow but log the attempt.  #ifdef HAVE_X11
/usr/share/man/man5/firejail-users.5.gz
$ pacman -Qlq firejail | grep /man/ | grep -v '/$' | xargs -I '{}' -n 1 sh -c 'printf "%s\n" "{}"; zcat "{}" | grep "#if"'
/usr/share/man/man1/firecfg.1.gz
/usr/share/man/man1/firejail.1.gz
#ifdef HAVE_X11
#if HAVE_USERNS
#ifdef HAVE_X11
/usr/share/man/man1/firemon.1.gz
/usr/share/man/man5/firejail-login.5.gz
/usr/share/man/man5/firejail-profile.5.gz
#ifdef HAVE_X11
/usr/share/man/man5/firejail-users.5.gz
  • What did you expect to happen?

#ifdef'd blocks to be processed by cpp(1) or something else at build time.

Environment

  • Linux distribution and version (ie output of lsb_release -a, screenfetch or cat /etc/os-release)
  • Firejail version (output of firejail --version) exclusive or used git commit (git rev-parse HEAD)
$ lsb_release -a
LSB Version:    1.4
Distributor ID: Artix
Description:    Artix Linux
Release:        rolling
Codename:       n/a
$ firejail --version
firejail version 0.9.64

Compile time support:
        - AppArmor support is enabled
        - AppImage support is enabled
        - chroot support is enabled
        - D-BUS proxy support is enabled
        - file and directory whitelisting support is enabled
        - file transfer support is enabled
        - firetunnel support is enabled
        - networking support is enabled
        - overlayfs support is enabled
        - private-home support is enabled
        - SELinux support is disabled
        - user namespace support is enabled
        - X11 sandboxing support is enabled

The package comes straight from Arch though:

$ pacman -Si firejail
Repository      : community
Name            : firejail
Version         : 0.9.64-2
Description     : Linux namespaces sandbox program
Architecture    : x86_64
URL             : https://github.com/netblue30/firejail
Licenses        : GPL2
Groups          : None
Provides        : None
Depends On      : apparmor
Optional Deps   : None
Conflicts With  : None
Replaces        : None
Download Size   : 545.83 KiB
Installed Size  : 1988.23 KiB
Packager        : Sergej Pupykin <pupykin.s+arch@gmail.com>
Build Date      : Tue 27 Oct 2020 08:35:54 PM -03
Validated By    : MD5 Sum  SHA-256 Sum  Signature
$ sha256sum /var/cache/pacman/pkg/firejail-0.9.64-2-x86_64.pkg.tar.zst
4750705b96a6991165b6834f0092ffccce313c0b27dfdf169f29cfa6a43f9fab  /var/cache/pacman/pkg/firejail-0.9.64-2-x86_64.pkg.tar.zst

Checklist

  • The upstream profile (and redirect profile if exists) have no changes fixing it.
  • The program has a profile. (If not, request one in https://github.com/netblue30/firejail/issues/1139)
  • Programs needed for interaction are listed in the profile.
  • A short search for duplicates was performed.
  • If it is a AppImage, --profile=PROFILENAME is used to set the right profile.
  • Used LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAM to get english error-messages.
@rusty-snake
Copy link
Collaborator

Thanks for reporting, should be fixed. The issue was that (1) #if was used at one place but the awk script only works with #ifdef and (2) the regex had no matches for numbers as in HAVE_X11.

FastAlien pushed a commit to FastAlien/firejail that referenced this issue Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants