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 --- elf/dl-profile.c | 7 +------ elf/rtld.c | 4 ---- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'elf') diff --git a/elf/dl-profile.c b/elf/dl-profile.c index 01aaf315a7..a4f11089a1 100644 --- a/elf/dl-profile.c +++ b/elf/dl-profile.c @@ -325,12 +325,7 @@ _dl_start_profile (void) *cp++ = '/'; __stpcpy (__stpcpy (cp, GLRO(dl_profile)), ".profile"); -#ifdef O_NOFOLLOW -# define EXTRA_FLAGS | O_NOFOLLOW -#else -# define EXTRA_FLAGS -#endif - fd = __open (filename, O_RDWR | O_CREAT EXTRA_FLAGS, DEFFILEMODE); + fd = __open (filename, O_RDWR | O_CREAT | O_NOFOLLOW, DEFFILEMODE); if (fd == -1) { char buf[400]; diff --git a/elf/rtld.c b/elf/rtld.c index 5986eaf4a1..319ef062d4 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -2525,11 +2525,7 @@ process_envvars (enum mode *modep) messages to this file. */ else if (any_debug && debug_output != NULL) { -#ifdef O_NOFOLLOW const int flags = O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW; -#else - const int flags = O_WRONLY | O_APPEND | O_CREAT; -#endif size_t name_len = strlen (debug_output); char buf[name_len + 12]; char *startp; -- cgit 1.4.1