Bug#560333: libc6: getpwnam shows shadow passwords of NIS users

2009-12-22 Thread Christoph Pleger
The attached patch seems to solve the problems. It works with nscd as well as 
without nscd. Authentication works fine now.

It makes the following changes:

* In nis-pwd.c, do not mangle encrypted password from 
   passwd.adjunct.byname map  into the password field
   of passwd map, instead mangle an 'x' into the field

* In nis-spwd.c, look for key in passwd.adjunct.byname if shadow.byname
   does not exist and add the two missing fields (passwd.adjunct.byname
   has two fields less than shadow)

Maybe some people can have a look over my patch to see if I missed anything. 
diff -Naurp glibc-2.7.original/nis/nss_nis/nis-pwd.c glibc-2.7/nis/nss_nis/nis-pwd.c
--- glibc-2.7.original/nis/nss_nis/nis-pwd.c	2006-05-02 00:31:15.0 +0200
+++ glibc-2.7/nis/nss_nis/nis-pwd.c	2009-12-22 09:04:46.0 +0100
@@ -275,8 +275,8 @@ internal_nis_getpwent_r (struct passwd *
 	  yp_match (domain, passwd.adjunct.byname, result, namelen,
 			result2, len2)) == YPERR_SUCCESS)
 	{
-	  /* We found a passwd.adjunct entry.  Merge encrypted
-	 password therein into original result.  */
+	  /* We found a passwd.adjunct entry.  Merge x
+	 into original result.  */
 	  char *encrypted = strchr (result2, ':');
 	  char *endp;
 	  size_t restlen;
@@ -304,7 +304,7 @@ internal_nis_getpwent_r (struct passwd *
 
 	  mempcpy (mempcpy (mempcpy (mempcpy (buffer, result, namelen),
  :, 1),
-			encrypted, endp - encrypted),
+			x, 1),
 		   p, restlen + 1);
 	  p = buffer;
 
@@ -408,8 +408,8 @@ _nss_nis_getpwnam_r (const char *name, s
yp_match (domain, passwd.adjunct.byname, name, namelen,
 		   result2, len2) == YPERR_SUCCESS)
 {
-  /* We found a passwd.adjunct entry.  Merge encrypted password
-	 therein into original result.  */
+  /* We found a passwd.adjunct entry.  Merge x
+	 into original result.  */
   char *encrypted = strchr (result2, ':');
   char *endp;
 
@@ -436,7 +436,7 @@ _nss_nis_getpwnam_r (const char *name, s
 
   __mempcpy (__mempcpy (__mempcpy (__mempcpy (buffer, name, namelen),
    :, 1),
-			encrypted, endp - encrypted),
+			x, 1),
 		 p, restlen + 1);
   p = buffer;
 
@@ -509,8 +509,8 @@ _nss_nis_getpwuid_r (uid_t uid, struct p
 	  yp_match (domain, passwd.adjunct.byname, result, namelen,
 		result2, len2)) == YPERR_SUCCESS)
 {
-  /* We found a passwd.adjunct entry.  Merge encrypted password
-	 therein into original result.  */
+  /* We found a passwd.adjunct entry.  Merge x
+	 into original result.  */
   char *encrypted = strchr (result2, ':');
   char *endp;
   size_t restlen;
@@ -538,7 +538,7 @@ _nss_nis_getpwuid_r (uid_t uid, struct p
 
   __mempcpy (__mempcpy (__mempcpy (__mempcpy (buffer, result, namelen),
    :, 1),
-			encrypted, endp - encrypted),
+			x, 1),
 		 p, restlen + 1);
   p = buffer;
 
diff -Naurp glibc-2.7.original/nis/nss_nis/nis-spwd.c glibc-2.7/nis/nss_nis/nis-spwd.c
--- glibc-2.7.original/nis/nss_nis/nis-spwd.c	2006-04-29 03:09:49.0 +0200
+++ glibc-2.7/nis/nss_nis/nis-spwd.c	2009-12-22 10:02:25.0 +0100
@@ -78,17 +78,42 @@ internal_nis_getspent_r (struct spwd *sp
 {
   char *result;
   char *outkey;
+  char *p;
   int len;
   int keylen;
   int yperr;
+  int adjunct_used = 0;
 
-  if (new_start)
+  if (new_start) {
 yperr = yp_first (domain, shadow.byname, outkey, keylen, result,
 			  len);
-  else
+
+if (yperr == YPERR_MAP) {
+	  if (result != NULL)
+	free result;
+
+	  yperr = yp_first (domain, passwd.adjunct.byname, outkey, keylen, result,
+			len);
+
+	  adjunct_used = 1;
+	}
+  }
+  
+  else {
 yperr = yp_next (domain, shadow.byname, oldkey, oldkeylen, outkey,
 			 keylen, result, len);
 
+if (yperr == YPERR_MAP) {
+	  if (result != NULL)
+	free result;
+
+	  yperr = yp_next (domain, passwd.adjunct.byname, oldkey, oldkeylen, outkey,
+			   keylen, result, len);
+	  
+	  adjunct_used = 1;
+	}
+  }
+
   if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
 {
 	  enum nss_status retval = yperr2nss (yperr);
@@ -98,15 +123,32 @@ internal_nis_getspent_r (struct spwd *sp
   return retval;
 }
 
-  if (__builtin_expect ((size_t) (len + 1)  buflen, 0))
-{
-  free (result);
-	  *errnop = ERANGE;
-  return NSS_STATUS_TRYAGAIN;
-}
+  if (! adjunct_used)
+	{
+	  if (__builtin_expect ((size_t) (len + 1)  buflen, 0))
+	{
+	  free (result);
+	  *errnop = ERANGE;
+	  return NSS_STATUS_TRYAGAIN;
+	}
+
+	  p = strncpy (buffer, result, len);
+	  buffer[len] = '\0';  
+	}
+  else
+	{
+	  if (__builtin_expect ((size_t) (len + 3)  buflen, 0))
+	{
+	  free (result);
+	  *errnop = ERANGE;
+	  return NSS_STATUS_TRYAGAIN;
+	}
+
+	  p = strncpy (buffer, result, len);
+	  buffer[len] = '\0';  
+	  p = strcat (buffer, ::);
+	}
 
-  char *p = 

Processed: Bug#561203: FTBFS [hppa] - pthread_create() (QThread) + fork() = crash

2009-12-22 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 retitle 561203 FTBFS [hppa] - pthread_create() (or QThread) + fork() = crash
Bug #561203 [src:kde4libs] FTBFS [hppa] - build hangs
Changed Bug title to 'FTBFS [hppa] - pthread_create() (or QThread) + fork() = 
crash' from 'FTBFS [hppa] - build hangs'
 reassign 561203 libc6 2.10.2-2
Bug #561203 [src:kde4libs] FTBFS [hppa] - pthread_create() (or QThread) + 
fork() = crash
Bug reassigned from package 'src:kde4libs' to 'libc6'.
Bug No longer marked as found in versions kde4libs/4:4.3.4-1.
Bug #561203 [libc6] FTBFS [hppa] - pthread_create() (or QThread) + fork() = 
crash
Bug Marked as found in versions eglibc/2.10.2-2.
 affects 561203 kde4libs
Bug #561203 [libc6] FTBFS [hppa] - pthread_create() (or QThread) + fork() = 
crash
Added indication that 561203 affects kde4libs
 tags 561203 help
Bug #561203 [libc6] FTBFS [hppa] - pthread_create() (or QThread) + fork() = 
crash
Added tag(s) help.
 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#561203: FTBFS [hppa] - pthread_create() (QThread) + fork() = crash

2009-12-22 Thread Carlos O'Donell
On Tue, Dec 22, 2009 at 2:54 PM, Modestas Vainius modes...@vainius.eu wrote:
 when investigating this issue further, I determined that fork() following
 pthread_create() sometimes makes the application crash. In order to reproduce,
 build attached minifail.cpp with:

 $ g++ -I/usr/include/qt4 -lQtCore minifail.cpp -o minifail -O0 -g

Thank you for the test case.

 This means that thread 2 was not started at all and hung at clone().
 Relevant QThread code at
 http://qt.gitorious.org/qt/qt/blobs/4.5/src/corelib/thread/qthread_unix.cpp

I don't believe that it would be stuck at the store instruction which
is pointed to by the PC (iaoqh).

However, I do believe that something is wrong and I am going to
investigate the kde4libs failure tonight.

 I strongly believe that if you fix the first problem, the 2nd one will
 disappear too as their origin is the same. Both tests work just fine on amd64.

 Contrary to what I said previously, the bug is reproducible under strace -f,
 but you have to wait much longer (up to 1th run).

 ii  libc6                         2.10.2-2                      GNU C Library:
 Shared libraries

Thanks. I'll look into this tonight.

Cheers,
Carlos.



--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#561203: FTBFS [hppa] - pthread_create() (QThread) + fork() = crash

2009-12-22 Thread Helge Deller

On 12/22/2009 08:54 PM, Modestas Vainius wrote:

when investigating this issue further, I determined that fork() following
pthread_create() sometimes makes the application crash. In order to reproduce,
build attached minifail.cpp with:

$ g++ -I/usr/include/qt4 -lQtCore minifail.cpp -o minifail -O0 -g

(pipe()/read()/write() are only used to sync parent with child after fork(),
they are irrelevant for the problem).



Thanks!

Good testcase!
I could verify all problems you reported (segfaults and hangs).
Kernel 2.6.33-rc1-32bit, UP-machine, c3000.

Helge



--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#562149: Some manpages are missing from glibc-doc 2.10.2-2a

2009-12-22 Thread Serenity Yaz
Package: glibc-doc
Version: 2.10.2-2
Severity: important


glibc-doc apparently are missing some manpages, including those for
pthread_create, pthread_join, and probably some others.

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.31.5 (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash

glibc-doc depends on no packages.

glibc-doc recommends no packages.

Versions of packages glibc-doc suggests:
ii  glibc-doc-reference   2.10.1-1   GNU C Library: Documentation

-- no debconf information


  




-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org