Fix missing include in nss/nss_db/db-init.c

Andreas Jaeger aj@suse.com
Fri Apr 6 19:10:00 GMT 2012


Compiling on Linux/i586 I get with glibc 2.15 these warnings:
nss_db/db-initgroups.c:60:3: warning: implicit declaration of function 
'strlen' [-Wimplicit-function-declaration]
nss_db/db-initgroups.c:74:7: warning: implicit declaration of function 
'strncmp' [-Wimplicit-function-declaration]
nss_db/db-init.c:46:3: warning: implicit declaration of function 
'strcpy' [-Wimplicit-function-declaration]

db-init.c is already fixed in git head but db-initgroups not.

Fixed with the appended obvious patch, tested on Linux/i386 and 
Linux/x86-64.

Andreas

2012-04-06  Andreas Jaeger  <aj@suse.de>

	* nss/nss_db/db-initgroups.c: Include <string.h> for strlen and
	strncmp	declarations.

diff --git a/nss/nss_db/db-initgroups.c b/nss/nss_db/db-initgroups.c
index 0d44e00..e56f58a 100644
--- a/nss/nss_db/db-initgroups.c
+++ b/nss/nss_db/db-initgroups.c
@@ -1,5 +1,5 @@
  /* Initgroups handling in nss_db module.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
     This file is part of the GNU C Library.
     Contributed by Ulrich Drepper <drepper@gmail.com>.

@@ -21,6 +21,7 @@
  #include <errno.h>
  #include <grp.h>
  #include <paths.h>
+#include <string.h>

  #include "nss_db.h"


-- 
  Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
   SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
     GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126



More information about the Libc-alpha mailing list