[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
- [RFC PATCH v2 0/7] O_IGNORE_CTTY everywhere & misc fixes, Sergey Bugaev, 2023/04/19
- [RFC PATCH v2 1/7] misc: Convert daemon () to GNU coding style, Sergey Bugaev, 2023/04/19
- [RFC PATCH v2 6/7] include/fcntl.h: Define O_IGNORE_CTTY, Sergey Bugaev, 2023/04/19
- [RFC PATCH v2 2/7] misc: Ignore SIGHUP in daemon () while forking, Sergey Bugaev, 2023/04/19
- [RFC PATCH v2 3/7] Use O_CLOEXEC in more places (BZ #15722), Sergey Bugaev, 2023/04/19
- [RFC PATCH v2 4/7] csu: Fix standard fds' mode,
Sergey Bugaev <=
- Re: [RFC PATCH v2 4/7] csu: Fix standard fds' mode, Cristian RodrÃguez, 2023/04/19
- Re: [RFC PATCH v2 4/7] csu: Fix standard fds' mode, Sergey Bugaev, 2023/04/19
- Re: [RFC PATCH v2 4/7] csu: Fix standard fds' mode, Adhemerval Zanella Netto, 2023/04/19
- Re: [RFC PATCH v2 4/7] csu: Fix standard fds' mode, Sergey Bugaev, 2023/04/19
- Re: [RFC PATCH v2 4/7] csu: Fix standard fds' mode, Adhemerval Zanella Netto, 2023/04/20
- Re: [RFC PATCH v2 4/7] csu: Fix standard fds' mode, Cristian RodrÃguez, 2023/04/20
- Re: [RFC PATCH v2 4/7] csu: Fix standard fds' mode, Adhemerval Zanella Netto, 2023/04/20
- Re: [RFC PATCH v2 4/7] csu: Fix standard fds' mode, Paul Eggert, 2023/04/21
[RFC PATCH v2 5/7] hurd: Make dl-sysdep's open () cope with O_IGNORE_CTTY, Sergey Bugaev, 2023/04/19