From patchwork Sat Nov 10 21:42:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 198216 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 0D1992C0040 for ; Sun, 11 Nov 2012 08:45:00 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0DC17101C60; Sat, 10 Nov 2012 21:44:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f84aPZ7XgHJD; Sat, 10 Nov 2012 21:44:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3CCC9101B23; Sat, 10 Nov 2012 21:44:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 5AE2F8F74A for ; Sat, 10 Nov 2012 21:44:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3AFD68A1D8 for ; Sat, 10 Nov 2012 21:44:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vYcNOqh7M5cD for ; Sat, 10 Nov 2012 21:44:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by whitealder.osuosl.org (Postfix) with ESMTP id 669068A117 for ; Sat, 10 Nov 2012 21:44:04 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id E75681CA; Sat, 10 Nov 2012 22:43:30 +0100 (CET) Received: from localhost (37-8-163-215.coucou-networks.fr [37.8.163.215]) by mail.free-electrons.com (Postfix) with ESMTPSA id A140A237 for ; Sat, 10 Nov 2012 22:43:08 +0100 (CET) From: Thomas Petazzoni To: buildroot@busybox.net Date: Sat, 10 Nov 2012 22:42:46 +0100 Message-Id: <13ca6c8f55f92df21dc9ba86e09dfe0b17a686d6.1352583641.git.thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Subject: [Buildroot] [PATCH 09/11] rpcbind: allow build without NSS support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net uClibc doesn't provide NSS support, so we shouldn't try to include nss related headers or call nss related functions. Signed-off-by: Thomas Petazzoni --- ...to-use-NSS-support-when-not-available-in-.patch | 60 ++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 package/rpcbind/rpcbind-0002-Do-not-try-to-use-NSS-support-when-not-available-in-.patch diff --git a/package/rpcbind/rpcbind-0002-Do-not-try-to-use-NSS-support-when-not-available-in-.patch b/package/rpcbind/rpcbind-0002-Do-not-try-to-use-NSS-support-when-not-available-in-.patch new file mode 100644 index 0000000..f7cc4a6 --- /dev/null +++ b/package/rpcbind/rpcbind-0002-Do-not-try-to-use-NSS-support-when-not-available-in-.patch @@ -0,0 +1,60 @@ +From cfc70fb4c54e044f724516e9352f974187adb448 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 10 Nov 2012 22:04:12 +0100 +Subject: [PATCH] Do not try to use NSS support when not available in the C + library + +uClibc does not have NSS support, so it is unnecessary to tell the C +library to use the "files" as the source for "services", since it is +the only possible choice. + +Signed-off-by: Thomas Petazzoni +--- + src/rpcbind.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/rpcbind.c b/src/rpcbind.c +index 525ffba..cde8685 100644 +--- a/src/rpcbind.c ++++ b/src/rpcbind.c +@@ -67,7 +67,9 @@ + #include + #include + #include ++#ifdef HAVE_NSS_H + #include ++#endif + #include "config.h" + #include "rpcbind.h" + +@@ -156,11 +158,13 @@ main(int argc, char *argv[]) + exit(1); + } + ++#ifdef HAVE_NSS_H + /* + * Make sure we use the local service file + * for service lookkups + */ + __nss_configure_lookup("services", "files"); ++#endif + + nc_handle = setnetconfig(); /* open netconfig file */ + if (nc_handle == NULL) { +@@ -222,11 +226,13 @@ main(int argc, char *argv[]) + struct passwd *p; + char *id = runasdaemon ? RUN_AS : rpcbinduser; + ++#ifdef HAVE_NSS_H + /* + * Make sure we use the local password file + * for these lookups. + */ + __nss_configure_lookup("passwd", "files"); ++#endif + + if((p = getpwnam(id)) == NULL) { + syslog(LOG_ERR, "cannot get uid of '%s': %m", id); +-- +1.7.9.5 +