diff options
author | Timo Teräs <timo.teras@iki.fi> | 2014-07-24 09:32:06 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2014-07-30 07:03:40 +0000 |
commit | 9b59b303937d3c5e11dc01aa3da53ae5e8e93566 (patch) | |
tree | 847f6d537322aca77ad5ff093ee6d28051043fa9 /main/musl/0008-fix-the-m-specifier-in-syslog.patch | |
parent | 86759609760f21984c719f15a4ceb6a8e0e4bb64 (diff) | |
download | aports-9b59b303937d3c5e11dc01aa3da53ae5e8e93566.tar.bz2 aports-9b59b303937d3c5e11dc01aa3da53ae5e8e93566.tar.xz |
main/musl: cherry-pick fixes, update alpine specific patches
four additional fixes from upstream git.
dns patch fixed to implement ns_{put,get}* as real functions,
and macro ns_msg_getflag added.
netlink patch is reworked to provide alias interface names
for ipv4 where appropriate, and for ipv6 link-local scope ids.
few error paths have been fixed, and if_nameindex() memory
allocation strategy has been improved.
setxid patch added.
(cherry picked from commit 3227b4ad816f850f655b6f44dc497926cb2cdcd1)
Diffstat (limited to 'main/musl/0008-fix-the-m-specifier-in-syslog.patch')
-rw-r--r-- | main/musl/0008-fix-the-m-specifier-in-syslog.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/main/musl/0008-fix-the-m-specifier-in-syslog.patch b/main/musl/0008-fix-the-m-specifier-in-syslog.patch new file mode 100644 index 0000000000..acf44a9d02 --- /dev/null +++ b/main/musl/0008-fix-the-m-specifier-in-syslog.patch @@ -0,0 +1,43 @@ +From da27118157c2942d7652138b8d8b0056fc8f872f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= <clement.vasseur@gmail.com> +Date: Wed, 9 Jul 2014 14:34:18 +0200 +Subject: [PATCH] fix the %m specifier in syslog + +errno must be saved upon vsyslog entry, otherwise its value could be +changed by some libc function before reaching the %m handler in +vsnprintf. +--- + src/misc/syslog.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/misc/syslog.c b/src/misc/syslog.c +index 1cd61ce..57f1d75 100644 +--- a/src/misc/syslog.c ++++ b/src/misc/syslog.c +@@ -7,6 +7,7 @@ + #include <signal.h> + #include <string.h> + #include <pthread.h> ++#include <errno.h> + #include "libc.h" + #include "atomic.h" + +@@ -76,6 +77,7 @@ static void _vsyslog(int priority, const char *message, va_list ap) + time_t now; + struct tm tm; + char buf[256]; ++ int errno_save = errno; + int pid; + int l, l2; + +@@ -93,6 +95,7 @@ static void _vsyslog(int priority, const char *message, va_list ap) + pid = (log_opt & LOG_PID) ? getpid() : 0; + l = snprintf(buf, sizeof buf, "<%d>%s %s%s%.0d%s: ", + priority, timebuf, log_ident, "["+!pid, pid, "]"+!pid); ++ errno = errno_save; + l2 = vsnprintf(buf+l, sizeof buf - l, message, ap); + if (l2 >= 0) { + if (l2 >= sizeof buf - l) l = sizeof buf - 1; +-- +2.0.2 + |