bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH v2 4/7] csu: Fix standard fds' mode


From: Sergey Bugaev
Subject: [RFC PATCH v2 4/7] csu: Fix standard fds' mode
Date: Wed, 19 Apr 2023 19:02:04 +0300

stdin is supposed to be readable, stdout and stderr writable. Otherwise,
we get this:

l-wx------. 1 root root 64 Apr 19 18:40 0 -> /dev/full
lr-x------. 1 root root 64 Apr 19 18:40 1 -> /dev/null
lr-x------. 1 root root 64 Apr 19 18:40 2 -> /dev/null

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
 csu/check_fds.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/csu/check_fds.c b/csu/check_fds.c
index de6dd716..ca4812cd 100644
--- a/csu/check_fds.c
+++ b/csu/check_fds.c
@@ -90,7 +90,7 @@ __libc_check_standard_fds (void)
      is really paranoid but some people actually are.  If /dev/null
      should happen to be a symlink to somewhere else and not the
      device commonly known as "/dev/null" we bail out.  */
-  check_one_fd (STDIN_FILENO, O_WRONLY | O_NOFOLLOW);
-  check_one_fd (STDOUT_FILENO, O_RDONLY | O_NOFOLLOW);
-  check_one_fd (STDERR_FILENO, O_RDONLY | O_NOFOLLOW);
+  check_one_fd (STDIN_FILENO, O_RDONLY | O_NOFOLLOW);
+  check_one_fd (STDOUT_FILENO, O_WRONLY | O_NOFOLLOW);
+  check_one_fd (STDERR_FILENO, O_WRONLY | O_NOFOLLOW);
 }
-- 
2.40.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]