From a12ae89f860229cbe5ba91f1f9cf17cc5a9ede31 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 13 Apr 2017 21:28:18 +0200 Subject: Assume that O_NOFOLLOW is always defined --- csu/check_fds.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'csu') diff --git a/csu/check_fds.c b/csu/check_fds.c index bec2a53..062c879 100644 --- a/csu/check_fds.c +++ b/csu/check_fds.c @@ -87,14 +87,10 @@ check_one_fd (int fd, int mode) void __libc_check_standard_fds (void) { - /* This 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. We can detect this with - the O_NOFOLLOW flag for open() but only on some system. */ -#ifndef O_NOFOLLOW -# define O_NOFOLLOW 0 -#endif - /* Check all three standard file descriptors. */ + /* Check all three standard file descriptors. The O_NOFOLLOW flag + 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); -- cgit v1.1