]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fix so that make unbound-host works when compiled with libnss.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 27 Jul 2012 13:17:14 +0000 (13:17 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 27 Jul 2012 13:17:14 +0000 (13:17 +0000)
git-svn-id: file:///svn/unbound/trunk@2726 be551aaa-1e26-0410-a405-d3ace91eadb9

smallapp/unbound-host.c

index 095396749ff114e57aec582cb142ebfe6caef802..ed52a551f9fc1c24af20e2a392b26e7338e20615 100644 (file)
@@ -61,6 +61,9 @@
 #endif
 #include "libunbound/unbound.h"
 #include <ldns/ldns.h>
+#ifdef HAVE_NSS
+#include <nss3/nss.h>
+#endif
 
 /** verbosity for unbound-host app */
 static int verb = 0;
@@ -509,6 +512,12 @@ int main(int argc, char* argv[])
        if(argc != 1)
                usage();
 
+#ifdef HAVE_NSS
+        if(NSS_NoDB_Init(".") != SECSuccess) {
+               fprintf(stderr, "could not init NSS\n");
+               return 1;
+       }
+#endif
        lookup(ctx, argv[0], qtype, qclass);
        return 0;
 }