mirror of git://sourceware.org/git/glibc.git
				
				
				
			Properly cache the result from looking up the nss database config
This commit is contained in:
		
							parent
							
								
									47f28d0a66
								
							
						
					
					
						commit
						b2179107f3
					
				|  | @ -1,3 +1,11 @@ | ||||||
|  | 2013-09-30  Andreas Schwab  <schwab@suse.de> | ||||||
|  | 
 | ||||||
|  | 	[BZ #15048] | ||||||
|  | 	* nscd/aicache.c (addhstaiX): Properly use the cache variable for | ||||||
|  | 	the nss database lookup. | ||||||
|  | 	* nscd/initgrcache.c (addinitgroupsX): Likewise. | ||||||
|  | 	* sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise. | ||||||
|  | 
 | ||||||
| 2013-09-28  Mike Frysinger  <vapier@gentoo.org> | 2013-09-28  Mike Frysinger  <vapier@gentoo.org> | ||||||
| 
 | 
 | ||||||
| 	* sysdeps/unix/sysv/linux/tst-fanotify.c (do_test): Fix style. | 	* sysdeps/unix/sysv/linux/tst-fanotify.c (do_test): Fix style. | ||||||
|  |  | ||||||
							
								
								
									
										10
									
								
								NEWS
								
								
								
								
							
							
						
						
									
										10
									
								
								NEWS
								
								
								
								
							|  | @ -9,11 +9,11 @@ Version 2.19 | ||||||
| 
 | 
 | ||||||
| * The following bugs are resolved with this release: | * The following bugs are resolved with this release: | ||||||
| 
 | 
 | ||||||
|   13985, 14155, 14547, 14699, 15400, 15427, 15522, 15531, 15532, 15608, |   13985, 14155, 14547, 14699, 15048, 15400, 15427, 15522, 15531, 15532, | ||||||
|   15609, 15610, 15640, 15681, 15736, 15748, 15749, 15754, 15797, 15844, |   15608, 15609, 15610, 15640, 15681, 15736, 15748, 15749, 15754, 15797, | ||||||
|   15849, 15855, 15856, 15857, 15859, 15867, 15886, 15887, 15890, 15892, |   15844, 15849, 15855, 15856, 15857, 15859, 15867, 15886, 15887, 15890, | ||||||
|   15893, 15895, 15897, 15905, 15909, 15919, 15921, 15923, 15939, 15963, |   15892, 15893, 15895, 15897, 15905, 15909, 15919, 15921, 15923, 15939, | ||||||
|   15966. |   15963, 15966. | ||||||
| 
 | 
 | ||||||
| * CVE-2012-4412 The strcoll implementation caches indices and rules for | * CVE-2012-4412 The strcoll implementation caches indices and rules for | ||||||
|   large collation sequences to optimize multiple passes.  This cache |   large collation sequences to optimize multiple passes.  This cache | ||||||
|  |  | ||||||
|  | @ -86,20 +86,19 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|   static service_user *hosts_database; |   static service_user *hosts_database; | ||||||
|   service_user *nip = NULL; |   service_user *nip; | ||||||
|   int no_more; |   int no_more; | ||||||
|   int rc6 = 0; |   int rc6 = 0; | ||||||
|   int rc4 = 0; |   int rc4 = 0; | ||||||
|   int herrno = 0; |   int herrno = 0; | ||||||
| 
 | 
 | ||||||
|   if (hosts_database != NULL) |   if (hosts_database == NULL) | ||||||
|     { |  | ||||||
|       nip = hosts_database; |  | ||||||
|       no_more = 0; |  | ||||||
|     } |  | ||||||
|   else |  | ||||||
|     no_more = __nss_database_lookup ("hosts", NULL, |     no_more = __nss_database_lookup ("hosts", NULL, | ||||||
| 				     "dns [!UNAVAIL=return] files", &nip); | 				     "dns [!UNAVAIL=return] files", | ||||||
|  | 				     &hosts_database); | ||||||
|  |   else | ||||||
|  |     no_more = 0; | ||||||
|  |   nip = hosts_database; | ||||||
| 
 | 
 | ||||||
|   /* Initialize configurations.  */ |   /* Initialize configurations.  */ | ||||||
|   if (__glibc_unlikely (!_res_hconf.initialized)) |   if (__glibc_unlikely (!_res_hconf.initialized)) | ||||||
|  |  | ||||||
|  | @ -80,17 +80,16 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|   static service_user *group_database; |   static service_user *group_database; | ||||||
|   service_user *nip = NULL; |   service_user *nip; | ||||||
|   int no_more; |   int no_more; | ||||||
| 
 | 
 | ||||||
|   if (group_database != NULL) |   if (group_database == NULL) | ||||||
|     { |  | ||||||
|       nip = group_database; |  | ||||||
|       no_more = 0; |  | ||||||
|     } |  | ||||||
|   else |  | ||||||
|     no_more = __nss_database_lookup ("group", NULL, |     no_more = __nss_database_lookup ("group", NULL, | ||||||
| 				     "compat [NOTFOUND=return] files", &nip); | 				     "compat [NOTFOUND=return] files", | ||||||
|  | 				     &group_database); | ||||||
|  |   else | ||||||
|  |     no_more = 0; | ||||||
|  |   nip = group_database; | ||||||
| 
 | 
 | ||||||
|  /* We always use sysconf even if NGROUPS_MAX is defined.  That way, the
 |  /* We always use sysconf even if NGROUPS_MAX is defined.  That way, the
 | ||||||
|      limit can be raised in the kernel configuration without having to |      limit can be raised in the kernel configuration without having to | ||||||
|  |  | ||||||
|  | @ -558,7 +558,7 @@ gaih_inet (const char *name, const struct gaih_service *service, | ||||||
| 	  struct gaih_addrtuple **pat = &at; | 	  struct gaih_addrtuple **pat = &at; | ||||||
| 	  int no_data = 0; | 	  int no_data = 0; | ||||||
| 	  int no_inet6_data = 0; | 	  int no_inet6_data = 0; | ||||||
| 	  service_user *nip = NULL; | 	  service_user *nip; | ||||||
| 	  enum nss_status inet6_status = NSS_STATUS_UNAVAIL; | 	  enum nss_status inet6_status = NSS_STATUS_UNAVAIL; | ||||||
| 	  enum nss_status status = NSS_STATUS_UNAVAIL; | 	  enum nss_status status = NSS_STATUS_UNAVAIL; | ||||||
| 	  int no_more; | 	  int no_more; | ||||||
|  | @ -791,15 +791,13 @@ gaih_inet (const char *name, const struct gaih_service *service, | ||||||
| 	    } | 	    } | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| 	  if (__nss_hosts_database != NULL) | 	  if (__nss_hosts_database == NULL) | ||||||
| 	    { |  | ||||||
| 	      no_more = 0; |  | ||||||
| 	      nip = __nss_hosts_database; |  | ||||||
| 	    } |  | ||||||
| 	  else |  | ||||||
| 	    no_more = __nss_database_lookup ("hosts", NULL, | 	    no_more = __nss_database_lookup ("hosts", NULL, | ||||||
| 					     "dns [!UNAVAIL=return] files", | 					     "dns [!UNAVAIL=return] files", | ||||||
| 					     &nip); | 					     &__nss_hosts_database); | ||||||
|  | 	  else | ||||||
|  | 	    no_more = 0; | ||||||
|  | 	  nip = __nss_hosts_database; | ||||||
| 
 | 
 | ||||||
| 	  /* Initialize configurations.  */ | 	  /* Initialize configurations.  */ | ||||||
| 	  if (__glibc_unlikely (!_res_hconf.initialized)) | 	  if (__glibc_unlikely (!_res_hconf.initialized)) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue