public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix libnsl env var handling
@ 2006-10-11  9:38 Jakub Jelinek
  2006-10-11 16:24 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2006-10-11  9:38 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

While NIS_DEFAULTS and NIS_GROUP env vars are never used by
libnss_nisplus, NIS_PATH is (through nis_getnames/nis_list with
EXPAND_NAME) and as such it is desirable to force use of the default
search path for suid/sgid.
Also, __nis_default_access was completely unnecessarily calling getenv
on the same var twice.

2006-10-11  Jakub Jelinek  <jakub@redhat.com>

	* nis/nis_defaults.c (__nis_default_access): Don't call
	getenv twice.

	* nis/nis_subr.c (nis_getnames): Use __secure_getenv instead of
	getenv.
	* sysdeps/generic/unsecvars.h: Add NIS_PATH.

--- libc/nis/nis_defaults.c.jj	2006-05-10 04:54:46.000000000 +0200
+++ libc/nis/nis_defaults.c	2006-10-11 09:43:52.000000000 +0200
@@ -447,7 +447,7 @@ __nis_default_access (char *param, unsig
     {
       cptr = getenv ("NIS_DEFAULTS");
       if (cptr != NULL && strstr (cptr, "access=") != NULL)
-	result = searchaccess (getenv ("NIS_DEFAULTS"), result);
+	result = searchaccess (cptr, result);
     }
 
   return result;
--- libc/nis/nis_subr.c.jj	2006-10-11 09:41:22.000000000 +0200
+++ libc/nis/nis_subr.c	2006-10-11 10:58:37.000000000 +0200
@@ -178,7 +178,7 @@ nis_getnames (const_nis_name name)
     }
 
   /* Get the search path, where we have to search "name" */
-  path = getenv ("NIS_PATH");
+  path = __secure_getenv ("NIS_PATH");
   if (path == NULL)
     path = strdupa ("$");
   else
--- libc/sysdeps/generic/unsecvars.h.jj	2005-01-06 23:40:19.000000000 +0100
+++ libc/sysdeps/generic/unsecvars.h	2006-10-11 11:06:43.000000000 +0200
@@ -18,6 +18,7 @@
   "LOCALDOMAIN\0"							      \
   "LOCPATH\0"								      \
   "MALLOC_TRACE\0"							      \
+  "NIS_PATH\0"								      \
   "NLSPATH\0"								      \
   "RESOLV_HOST_CONF\0"							      \
   "RES_OPTIONS\0"							      \

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix libnsl env var handling
  2006-10-11  9:38 [PATCH] Fix libnsl env var handling Jakub Jelinek
@ 2006-10-11 16:24 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2006-10-11 16:24 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-11 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-11  9:38 [PATCH] Fix libnsl env var handling Jakub Jelinek
2006-10-11 16:24 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).