[GH-ISSUE #635] make read-write opposite of read-only #441

Closed
opened 2026-05-05 05:51:57 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @nick75e on GitHub (Jul 15, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/635

Hi!

Is it possible to make read-write generic so that it can work with any top directory and counter the effect of read-only on subfolders, e.g.:
read-only /media/user/* and read-write /media/user/foo/
read-only ~/ and read-write ~/foo.bar

Thanks.

Originally created by @nick75e on GitHub (Jul 15, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/635 Hi! Is it possible to make `read-write` generic so that it can work with any top directory and counter the effect of `read-only` on subfolders, e.g.: `read-only /media/user/*` and `read-write /media/user/foo/` `read-only ~/` and `read-write ~/foo.bar` Thanks.
gitea-mirror 2026-05-05 05:51:57 -06:00
Author
Owner

@netblue30 commented on GitHub (Jul 16, 2016):

Sure, I'll put it in.

<!-- gh-comment-id:233127801 --> @netblue30 commented on GitHub (Jul 16, 2016): Sure, I'll put it in.
Author
Owner

@netblue30 commented on GitHub (Jul 16, 2016):

Sorry, it is already done in git - somebody requested it a while back.

      --read-write=dirname_or_filename
              By  default,  the  sandbox  mounts system directories read-only.
              These directories are  /etc,  /var,  /usr,  /bin,  /sbin,  /lib,
              /lib32, /libx32 and /lib64.  Use this option to mount read-write
              files or directories inside the system directories.

              This option is available only to root user.  It  has  no  effect
              when --chroot or --overlay are also set. In these cases the sys‐
              tem directories are mounted read-write.

<!-- gh-comment-id:233127928 --> @netblue30 commented on GitHub (Jul 16, 2016): Sorry, it is already done in git - somebody requested it a while back. ``` --read-write=dirname_or_filename By default, the sandbox mounts system directories read-only. These directories are /etc, /var, /usr, /bin, /sbin, /lib, /lib32, /libx32 and /lib64. Use this option to mount read-write files or directories inside the system directories. This option is available only to root user. It has no effect when --chroot or --overlay are also set. In these cases the sys‐ tem directories are mounted read-write. ```
Author
Owner

@nick75e commented on GitHub (Jul 16, 2016):

The first part is misleading since it says Use this option [...] inside the system directories. I thought it was only for these directories.
Also can you remove the requirement to be root for directories owned by the user?

<!-- gh-comment-id:233129234 --> @nick75e commented on GitHub (Jul 16, 2016): The first part is misleading since it says `Use this option [...] inside the system directories`. I thought it was only for these directories. Also can you remove the requirement to be root for directories owned by the user?
Author
Owner

@netblue30 commented on GitHub (Jul 16, 2016):

Yes, it is kind of misleading. I'll allow the option in the user home directory.

<!-- gh-comment-id:233148297 --> @netblue30 commented on GitHub (Jul 16, 2016): Yes, it is kind of misleading. I'll allow the option in the user home directory.
Author
Owner

@nick75e commented on GitHub (Jul 16, 2016):

I personally also need it for files under /media/$USER and from what I've read from other users /data/ would also be useful.

<!-- gh-comment-id:233153163 --> @nick75e commented on GitHub (Jul 16, 2016): I personally also need it for files under `/media/$USER` and from what I've read from other users `/data/` would also be useful.
Author
Owner

@netblue30 commented on GitHub (Jul 17, 2016):

OK, let's do it this way: if the file or directory is owned by the user, I'll set it read/write.

<!-- gh-comment-id:233160988 --> @netblue30 commented on GitHub (Jul 17, 2016): OK, let's do it this way: if the file or directory is owned by the user, I'll set it read/write.
Author
Owner

@netblue30 commented on GitHub (Jul 20, 2016):

Fixed in git. The text in the man page is:

       --read-write=dirname_or_filename
              Set  directory  or  file  read-write.  Only files or directories
              belonging to the current user are allowed  for  this  operation.
              Example:

              $ mkdir ~/test
              $ touch ~/test/a
              $ firejail --read-only=~/test --read-write=~/test/a
<!-- gh-comment-id:233992412 --> @netblue30 commented on GitHub (Jul 20, 2016): Fixed in git. The text in the man page is: ``` --read-write=dirname_or_filename Set directory or file read-write. Only files or directories belonging to the current user are allowed for this operation. Example: $ mkdir ~/test $ touch ~/test/a $ firejail --read-only=~/test --read-write=~/test/a ```
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#441
No description provided.