[GH-ISSUE #3381] Cannot add /usr/bin/[ to private-bin #2123

Open
opened 2026-05-05 08:48:10 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @nicovs on GitHub (Apr 24, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3381

is there a possibility to add [ to the private-bin?

tried to add with [, "[", '[' or [ but doesnt appear in the jail.

Capistrano prepends /usr/bin/env to it's command eg [ -e path/to/file ], causing the shell not to use the [ internal, but the actual /usr/bin/[ command.
The actual error:

[15:49:37] [jaileduser@server] ~  [ ! -e cachetool.phar ] && echo not found
not found
 [15:49:38] [jaileduser@server] ~  /usr/bin/env [ ! -e cachetool.phar ] && echo not found
env: ‘[’: Permission denied

With private-bin:
private-bin ...xargs,zcat,zip,zless,'[',test

Debug output on the jail:

Checking /usr/local/bin/zip
Checking /usr/bin/zip
sbox run: /run/firejail/lib/fcopy /usr/bin/zip /run/firejail/mnt/bin (null)
Checking /usr/local/bin/zless
Checking /usr/bin/zless
Checking /bin/zless
sbox run: /run/firejail/lib/fcopy /bin/zless /run/firejail/mnt/bin (null)
Checking /usr/local/bin/test
Checking /usr/bin/test
sbox run: /run/firejail/lib/fcopy /usr/bin/test /run/firejail/mnt/bin (null)
Mount-bind /run/firejail/mnt/bin on top of /usr/local/bin
Mount-bind /run/firejail/mnt/bin on top of /usr/bin
Mount-bind /run/firejail/mnt/bin on top of /bin
Originally created by @nicovs on GitHub (Apr 24, 2020). Original GitHub issue: https://github.com/netblue30/firejail/issues/3381 is there a possibility to add [ to the private-bin? tried to add with [, "[", '[' or \[ but doesnt appear in the jail. Capistrano prepends /usr/bin/env to it's command eg [ -e path/to/file ], causing the shell not to use the [ internal, but the actual /usr/bin/[ command. The actual error: ``` [15:49:37] [jaileduser@server] ~ [ ! -e cachetool.phar ] && echo not found not found [15:49:38] [jaileduser@server] ~ /usr/bin/env [ ! -e cachetool.phar ] && echo not found env: ‘[’: Permission denied ``` With private-bin: ```private-bin ...xargs,zcat,zip,zless,'[',test``` Debug output on the jail: ```sbox run: /run/firejail/lib/fcopy /bin/zcat /run/firejail/mnt/bin (null) Checking /usr/local/bin/zip Checking /usr/bin/zip sbox run: /run/firejail/lib/fcopy /usr/bin/zip /run/firejail/mnt/bin (null) Checking /usr/local/bin/zless Checking /usr/bin/zless Checking /bin/zless sbox run: /run/firejail/lib/fcopy /bin/zless /run/firejail/mnt/bin (null) Checking /usr/local/bin/test Checking /usr/bin/test sbox run: /run/firejail/lib/fcopy /usr/bin/test /run/firejail/mnt/bin (null) Mount-bind /run/firejail/mnt/bin on top of /usr/local/bin Mount-bind /run/firejail/mnt/bin on top of /usr/bin Mount-bind /run/firejail/mnt/bin on top of /bin ```
gitea-mirror added the
bug
label 2026-05-05 08:48:10 -06:00
Author
Owner

@rusty-snake commented on GitHub (Apr 24, 2020):

Using private-bin \[ gives:
Error: "/usr/bin/[" is an invalid filename: rejected character: "["

<!-- gh-comment-id:619063372 --> @rusty-snake commented on GitHub (Apr 24, 2020): Using `private-bin \[` gives: `Error: "/usr/bin/[" is an invalid filename: rejected character: "["`
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#2123
No description provided.