summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-07-30 06:00:43 +0000
committerUlrich Drepper <drepper@redhat.com>2005-07-30 06:00:43 +0000
commit29c21e490099c35fb3e35c2c493b6b480b211e72 (patch)
tree7dc69b6d2492e181c548e5b6714bb9bb62a2119e /misc
parent155c581323f45dd7657ff011be1590a5ffdc4fa0 (diff)
downloadglibc-29c21e490099c35fb3e35c2c493b6b480b211e72.tar.gz
* misc/bits/syslog.h: New file.
* misc/sys/syslog.h: Include <bits/syslog.h> for fortification. * misc/Makefile (headers): Add bits/syslog.h. * include/sys/syslog.h: Add __vsyslog_chk prototype and hidden_proto. * sysdeps/generic/syslog.c: Change vsyslog function to __vsyslog_chk. Call __vfprintf_chk if necessary. Make vsyslog a wrapper. Add __syslog_chk. * misc/Versions: Export __syslog_chk and __vsyslog_chk. * nis/nis_xdr.c: Help gcc to avoid generating unnecessary wrapper functions.
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile2
-rw-r--r--misc/Versions3
-rw-r--r--misc/sys/syslog.h10
3 files changed, 12 insertions, 3 deletions
diff --git a/misc/Makefile b/misc/Makefile
index cd5b64e7ab..7c0b64818d 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -29,7 +29,7 @@ headers := sys/uio.h bits/uio.h sys/ioctl.h bits/ioctls.h bits/ioctl-types.h \
sys/mman.h sys/param.h fstab.h mntent.h search.h err.h error.h \
sys/queue.h sysexits.h syscall.h sys/syscall.h sys/swap.h \
sys/select.h ustat.h sys/ustat.h bits/ustat.h sys/sysinfo.h \
- regexp.h bits/select.h bits/mman.h sys/xattr.h
+ regexp.h bits/select.h bits/mman.h sys/xattr.h bits/syslog.h
routines := brk sbrk sstk ioctl \
readv writev \
diff --git a/misc/Versions b/misc/Versions
index 13b38eec72..4c3aafad6e 100644
--- a/misc/Versions
+++ b/misc/Versions
@@ -130,4 +130,7 @@ libc {
GLIBC_2.3.3 {
remap_file_pages;
}
+ GLIBC_2.4 {
+ __syslog_chk; __vsyslog_chk;
+ }
}
diff --git a/misc/sys/syslog.h b/misc/sys/syslog.h
index 5007525d85..9de7570d8a 100644
--- a/misc/sys/syslog.h
+++ b/misc/sys/syslog.h
@@ -188,7 +188,7 @@ extern int setlogmask (int __mask) __THROW;
This function is a possible cancellation point and therefore not
marked with __THROW. */
extern void syslog (int __pri, __const char *__fmt, ...)
- __attribute__ ((__format__(__printf__, 2, 3)));
+ __attribute__ ((__format__ (__printf__, 2, 3)));
#ifdef __USE_BSD
/* Generate a log message using FMT and using arguments pointed to by AP.
@@ -198,7 +198,13 @@ extern void syslog (int __pri, __const char *__fmt, ...)
or due to the implementation it is a cancellation point and
therefore not marked with __THROW. */
extern void vsyslog (int __pri, __const char *__fmt, __gnuc_va_list __ap)
- __attribute__ ((__format__(__printf__, 2, 0)));
+ __attribute__ ((__format__ (__printf__, 2, 0)));
+#endif
+
+
+/* Define some macros helping to catch buffer overflows. */
+#if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus
+# include <bits/syslog.h>
#endif
__END_DECLS