[PR #4591] [MERGED] s/S_IWRITE/S_IWUSR/ #5198

Closed
opened 2026-05-05 10:34:05 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/4591
Author: @kmk3
Created: 10/5/2021
Status: Merged
Merged: 10/9/2021
Merged by: @netblue30

Base: masterHead: replace-iwrite-iwuser


📝 Commits (2)

  • 3050ef0 s/S_IWRITE/S_IWUSR/
  • 4937f73 Merge branch 'master' into replace-iwrite-iwuser

📊 Changes

6 files changed (+10 additions, -10 deletions)

View changed files

📝 src/firejail/chroot.c (+1 -1)
📝 src/firejail/fs_hostname.c (+2 -2)
📝 src/firejail/fs_trace.c (+2 -2)
📝 src/firejail/fs_var.c (+3 -3)
📝 src/firejail/ls.c (+1 -1)
📝 src/firejail/sandbox.c (+1 -1)

📄 Description

They are equivalent, but only the latter is POSIX. See sys_stat.h(0p)
of POSIX.1-2017[1]. From Section 14.9.5, The Mode Bits for Access
Permission of the glibc manual[2]:

S_IWUSR
S_IWRITE

Write permission bit for the owner of the file.  Usually 0200.
S_IWRITE is an obsolete synonym provided for BSD compatibility.

Current usage:

$ git grep -F S_IWRITE -- src | wc -l
11
$ git grep -F S_IWUSR -- src | wc -l
26

Commands used to search and replace:

$ git grep -l -z S_IWRITE -- src | xargs -0 -I '{}' sh -c \
  "printf '%s\n' \"\`sed 's/S_IWRITE/S_IWUSR/g' '{}'\`\" >'{}'"

Note: The other related non-POSIX macros are not used anywhere:

$ git grep -F -e S_IREAD -e S_IEXEC -- src
$

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html
[2] https://www.gnu.org/software/libc/manual/html_node/Permission-Bits.html


Misc: I noticed this on #4586.

Since this conflicts with #4586, I'm marking this as a draft until that is
merged.

Note to self: This will need to be rebased/reworded.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/4591 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 10/5/2021 **Status:** ✅ Merged **Merged:** 10/9/2021 **Merged by:** [@netblue30](https://github.com/netblue30) **Base:** `master` ← **Head:** `replace-iwrite-iwuser` --- ### 📝 Commits (2) - [`3050ef0`](https://github.com/netblue30/firejail/commit/3050ef0353e002a3c33214f039a64c2871650ca2) s/S_IWRITE/S_IWUSR/ - [`4937f73`](https://github.com/netblue30/firejail/commit/4937f73ca58976e40e7629deea57bce5935ba043) Merge branch 'master' into replace-iwrite-iwuser ### 📊 Changes **6 files changed** (+10 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/chroot.c` (+1 -1) 📝 `src/firejail/fs_hostname.c` (+2 -2) 📝 `src/firejail/fs_trace.c` (+2 -2) 📝 `src/firejail/fs_var.c` (+3 -3) 📝 `src/firejail/ls.c` (+1 -1) 📝 `src/firejail/sandbox.c` (+1 -1) </details> ### 📄 Description They are equivalent, but only the latter is POSIX. See sys_stat.h(0p) of POSIX.1-2017[1]. From Section 14.9.5, The Mode Bits for Access Permission of the glibc manual[2]: > S_IWUSR > S_IWRITE > > Write permission bit for the owner of the file. Usually 0200. > S_IWRITE is an obsolete synonym provided for BSD compatibility. Current usage: $ git grep -F S_IWRITE -- src | wc -l 11 $ git grep -F S_IWUSR -- src | wc -l 26 Commands used to search and replace: $ git grep -l -z S_IWRITE -- src | xargs -0 -I '{}' sh -c \ "printf '%s\n' \"\`sed 's/S_IWRITE/S_IWUSR/g' '{}'\`\" >'{}'" Note: The other related non-POSIX macros are not used anywhere: $ git grep -F -e S_IREAD -e S_IEXEC -- src $ [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html [2] https://www.gnu.org/software/libc/manual/html_node/Permission-Bits.html --- Misc: I noticed this on #4586. Since this conflicts with #4586, I'm marking this as a draft until that is merged. Note to self: This will need to be rebased/reworded. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:34:05 -06:00
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#5198
No description provided.