[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r3545 - in glibc-package/branches/eglibc-2.10/debian: . patches patches/any



Author: aurel32
Date: 2009-05-27 13:15:01 +0000 (Wed, 27 May 2009)
New Revision: 3545

Added:
   glibc-package/branches/eglibc-2.10/debian/patches/any/submitted-getent-gshadow.diff
Modified:
   glibc-package/branches/eglibc-2.10/debian/changelog
   glibc-package/branches/eglibc-2.10/debian/patches/series
Log:
  * Add debian/patches/any/submitted-getent-gshadow.diff to add gshadow 
    support to getent.



Modified: glibc-package/branches/eglibc-2.10/debian/changelog
===================================================================
--- glibc-package/branches/eglibc-2.10/debian/changelog	2009-05-27 06:31:39 UTC (rev 3544)
+++ glibc-package/branches/eglibc-2.10/debian/changelog	2009-05-27 13:15:01 UTC (rev 3545)
@@ -90,6 +90,8 @@
   * Add debian/patches/any/submitted-nptl_db-symbols.diff to fix testsuite
     on alpha.
   * Add debian/patches/alpha/submitted-rtld-fPIC.diff to fix build on alpha.
+  * Add debian/patches/any/submitted-getent-gshadow.diff to add gshadow 
+    support to getent.
 
  -- Aurelien Jarno <aurel32@debian.org>  Tue, 26 May 2009 09:27:14 +0200
 

Added: glibc-package/branches/eglibc-2.10/debian/patches/any/submitted-getent-gshadow.diff
===================================================================
--- glibc-package/branches/eglibc-2.10/debian/patches/any/submitted-getent-gshadow.diff	                        (rev 0)
+++ glibc-package/branches/eglibc-2.10/debian/patches/any/submitted-getent-gshadow.diff	2009-05-27 13:15:01 UTC (rev 3545)
@@ -0,0 +1,95 @@
+2009-05-27  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* nss/getent.c (print_gshadow): New function. (gshadow_keys):
+	  Likewise.
+
+--- a/nss/getent.c
++++ b/nss/getent.c
+@@ -30,6 +30,7 @@
+ #include <netdb.h>
+ #include <pwd.h>
+ #include <shadow.h>
++#include <gshadow.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -743,6 +744,71 @@ shadow_keys (int number, char *key[])
+   return result;
+ }
+ 
++/* This is for shadow */
++static void
++print_gshadow (struct sgrp *sg)
++{
++  unsigned int i = 0;
++
++  printf ("%s:%s:",
++	  sg->sg_namp ? sg->sg_namp : "",
++	  sg->sg_passwd ? sg->sg_passwd : "");
++
++  while (sg->sg_adm[i] != NULL)
++    {
++      fputs_unlocked (sg->sg_adm[i], stdout);
++      ++i;
++      if (sg->sg_adm[i] != NULL)
++	putchar_unlocked (',');
++    }
++
++  putchar_unlocked (':');
++
++  i = 0;
++  while (sg->sg_mem[i] != NULL)
++    {
++      fputs_unlocked (sg->sg_mem[i], stdout);
++      ++i;
++      if (sg->sg_mem[i] != NULL)
++	putchar_unlocked (',');
++    }
++
++  putchar_unlocked ('\n');
++}
++
++static int
++gshadow_keys (int number, char *key[])
++{
++  int result = 0;
++  int i;
++
++  if (number == 0)
++    {
++      struct sgrp *sg;
++
++      setsgent ();
++      while ((sg = getsgent ()) != NULL)
++	print_gshadow (sg);
++      endsgent ();
++      return result;
++    }
++
++  for (i = 0; i < number; ++i)
++    {
++      struct sgrp *sg;
++
++      sg = getsgnam (key[i]);
++
++      if (sg == NULL)
++	result = 2;
++      else
++	print_gshadow (sg);
++    }
++
++  return result;
++}
++
++
+ struct
+   {
+     const char *name;
+@@ -764,6 +830,7 @@ D(protocols)
+ D(rpc)
+ D(services)
+ D(shadow)
++D(gshadow)
+ #undef D
+     { NULL, NULL }
+   };

Modified: glibc-package/branches/eglibc-2.10/debian/patches/series
===================================================================
--- glibc-package/branches/eglibc-2.10/debian/patches/series	2009-05-27 06:31:39 UTC (rev 3544)
+++ glibc-package/branches/eglibc-2.10/debian/patches/series	2009-05-27 13:15:01 UTC (rev 3545)
@@ -188,3 +188,4 @@
 any/submitted-accept4-hidden.diff
 any/submitted-rtld-not-cancel.diff
 any/submitted-nptl_db-symbols.diff
+any/submitted-getent-gshadow.diff


Reply to: