public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/27056] New: Incorrect access modes for stdin, stout and stderr in csu/check_fds.c
@ 2020-12-11 18:19 dr.duncan.p.simpson at gmail dot com
  2020-12-11 18:48 ` [Bug libc/27056] " schwab@linux-m68k.org
  0 siblings, 1 reply; 2+ messages in thread
From: dr.duncan.p.simpson at gmail dot com @ 2020-12-11 18:19 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27056

            Bug ID: 27056
           Summary: Incorrect access modes for stdin, stout and stderr in
                    csu/check_fds.c
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: dr.duncan.p.simpson at gmail dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

In check_fds.c I saw that stdin is opened as O_write only and stdout are stderr
are opened as read only, which is presumably less than ideal. Suggested fix

diff --git a/csu/check_fds.c b/csu/check_fds.c
index 29d9d04acb..5999d450a4 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);
 }

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libc/27056] Incorrect access modes for stdin, stout and stderr in csu/check_fds.c
  2020-12-11 18:19 [Bug libc/27056] New: Incorrect access modes for stdin, stout and stderr in csu/check_fds.c dr.duncan.p.simpson at gmail dot com
@ 2020-12-11 18:48 ` schwab@linux-m68k.org
  0 siblings, 0 replies; 2+ messages in thread
From: schwab@linux-m68k.org @ 2020-12-11 18:48 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27056

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
This is by design.  If the program is started with 0/1/2 closed then access to
them should fail.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-11 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 18:19 [Bug libc/27056] New: Incorrect access modes for stdin, stout and stderr in csu/check_fds.c dr.duncan.p.simpson at gmail dot com
2020-12-11 18:48 ` [Bug libc/27056] " schwab@linux-m68k.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).