aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-profile.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-01-09 03:08:54 +0000
committerUlrich Drepper <drepper@redhat.com>2001-01-09 03:08:54 +0000
commitf2a8d16bed62f39b40dbd87f4b642e851b8eb23d (patch)
tree433c807fdc00d0a9303f0ee034b82cb237bc3b89 /elf/dl-profile.c
parent0101a56fd61979c3905421e31931071b251042ba (diff)
downloadglibc-f2a8d16bed62f39b40dbd87f4b642e851b8eb23d.tar
glibc-f2a8d16bed62f39b40dbd87f4b642e851b8eb23d.tar.gz
glibc-f2a8d16bed62f39b40dbd87f4b642e851b8eb23d.tar.bz2
glibc-f2a8d16bed62f39b40dbd87f4b642e851b8eb23d.zip
Update.
* elf/dl-profile.c (_dl_start_profile): Open the output file with O_NOFOLLOW if possible.
Diffstat (limited to 'elf/dl-profile.c')
-rw-r--r--elf/dl-profile.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/elf/dl-profile.c b/elf/dl-profile.c
index 53b26d51a2..9a7e7265dd 100644
--- a/elf/dl-profile.c
+++ b/elf/dl-profile.c
@@ -1,5 +1,5 @@
/* Profiling of shared libraries.
- Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
Based on the BSD mcount implementation.
@@ -256,7 +256,12 @@ _dl_start_profile (struct link_map *map, const char *output_dir)
*cp++ = '/';
__stpcpy (__stpcpy (cp, _dl_profile), ".profile");
- fd = __open (filename, O_RDWR | O_CREAT, 0666);
+#ifdef O_NOFOLLOW
+# define EXTRA_FLAGS | O_NOFOLLOW
+#else
+# define EXTRA_FLAGS
+#endif
+ fd = __open (filename, O_RDWR | O_CREAT EXTRA_FLAGS, 0666);
if (fd == -1)
{
/* We cannot write the profiling data so don't do anything. */