Harald Hoyer 5f4d81
From 1e335af70f29d1a1e9c132338aa35b8971934441 Mon Sep 17 00:00:00 2001
Harald Hoyer 5f4d81
From: Dave Reisner <dreisner@archlinux.org>
Harald Hoyer 5f4d81
Date: Fri, 19 Apr 2013 16:31:25 -0400
Harald Hoyer 5f4d81
Subject: [PATCH] nss-myhostname: ensure that glibc's assert is used
Harald Hoyer 5f4d81
Harald Hoyer 5f4d81
---
Harald Hoyer 5f4d81
 src/nss-myhostname/nss-myhostname.c | 6 +++++-
Harald Hoyer 5f4d81
 1 file changed, 5 insertions(+), 1 deletion(-)
Harald Hoyer 5f4d81
Harald Hoyer 5f4d81
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
Harald Hoyer 5f4d81
index 16ccb3e..8699098 100644
Harald Hoyer 5f4d81
--- a/src/nss-myhostname/nss-myhostname.c
Harald Hoyer 5f4d81
+++ b/src/nss-myhostname/nss-myhostname.c
Harald Hoyer 5f4d81
@@ -25,7 +25,6 @@
Harald Hoyer 5f4d81
 #include <netdb.h>
Harald Hoyer 5f4d81
 #include <errno.h>
Harald Hoyer 5f4d81
 #include <string.h>
Harald Hoyer 5f4d81
-#include <assert.h>
Harald Hoyer 5f4d81
 #include <unistd.h>
Harald Hoyer 5f4d81
 #include <net/if.h>
Harald Hoyer 5f4d81
 #include <stdlib.h>
Harald Hoyer 5f4d81
@@ -35,6 +34,11 @@
Harald Hoyer 5f4d81
 #include "macro.h"
Harald Hoyer 5f4d81
 #include "util.h"
Harald Hoyer 5f4d81
 
Harald Hoyer 5f4d81
+/* Ensure that glibc's assert is used. We cannot use assert from macro.h, as
Harald Hoyer 5f4d81
+ * libnss_myhostname will be linked into arbitrary programs which will, in turn
Harald Hoyer 5f4d81
+ * attempt to write to the journal via log_dispatch() */
Harald Hoyer 5f4d81
+#include <assert.h>
Harald Hoyer 5f4d81
+
Harald Hoyer 5f4d81
 /* We use 127.0.0.2 as IPv4 address. This has the advantage over
Harald Hoyer 5f4d81
  * 127.0.0.1 that it can be translated back to the local hostname. For
Harald Hoyer 5f4d81
  * IPv6 we use ::1 which unfortunately will not translate back to the
Harald Hoyer 5f4d81
-- 
Harald Hoyer 5f4d81
1.8.2.1
Harald Hoyer 5f4d81