[GH-ISSUE #1692] /usr/bin/string cannot read /proc/*/environ #1144

Closed
opened 2026-05-05 07:32:10 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @elvetemedve on GitHub (Dec 25, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1692

The problem

strings cannot read file from /proc filesystem.

strings /proc/1190/environ

Reading profile /etc/firejail/strings.profile
Reading profile /etc/firejail/default.profile
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc
Parent pid 12877, child pid 12878
Standard C library installed in 15.13 ms
Program libraries installed in 4.18 ms
Installed 23 libraries and 1 directories
Warning: /sbin directory link was not blacklisted
Warning: /usr/sbin directory link was not blacklisted
Blacklist violations are logged to syslog
Child process initialized in 82.04 ms
/usr/sbin/strings: '/proc/1190/environ': No such file

Parent is shutting down, bye...

However the file does exist.
ls -l /proc/1190/environ

-r-------- 1 geza geza 0 Dec 25 14:09 /proc/1190/environ

Environment

Firejail version: 0.9.52

Originally created by @elvetemedve on GitHub (Dec 25, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1692 ### The problem **strings** cannot read file from **/proc** filesystem. `strings /proc/1190/environ` > Reading profile /etc/firejail/strings.profile > Reading profile /etc/firejail/default.profile > Reading profile /etc/firejail/disable-common.inc > Reading profile /etc/firejail/disable-passwdmgr.inc > Reading profile /etc/firejail/disable-programs.inc > Parent pid 12877, child pid 12878 > Standard C library installed in 15.13 ms > Program libraries installed in 4.18 ms > Installed 23 libraries and 1 directories > Warning: /sbin directory link was not blacklisted > Warning: /usr/sbin directory link was not blacklisted > Blacklist violations are logged to syslog > Child process initialized in 82.04 ms > /usr/sbin/strings: '/proc/1190/environ': No such file > > Parent is shutting down, bye... > However the file does exist. `ls -l /proc/1190/environ` > -r-------- 1 geza geza 0 Dec 25 14:09 /proc/1190/environ ### Environment Firejail version: 0.9.52
gitea-mirror 2026-05-05 07:32:10 -06:00
Author
Owner

@reinerh commented on GitHub (Dec 26, 2017):

That's actually a feature, as firejailed programs can't access process information of other processes (they are in a separate namespace).

Instead of trying to open the file from the jailed process, you could pass it the content on stdin.
This should work: strings < /proc/.../environ.

<!-- gh-comment-id:354023690 --> @reinerh commented on GitHub (Dec 26, 2017): That's actually a feature, as firejailed programs can't access process information of other processes (they are in a separate namespace). Instead of trying to open the file from the jailed process, you could pass it the content on stdin. This should work: `strings < /proc/.../environ`.
Author
Owner

@elvetemedve commented on GitHub (Dec 27, 2017):

@reinerh Thanks. I wasn't aware of the consequences of namespaces. I learned someting again. :)

That did the trick actually. Thank you.

<!-- gh-comment-id:354105463 --> @elvetemedve commented on GitHub (Dec 27, 2017): @reinerh Thanks. I wasn't aware of the consequences of namespaces. I learned someting again. :) That did the trick actually. Thank you.
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#1144
No description provided.