Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2017 21:51:19 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r313748 - head/lib/libc/net
Message-ID:  <201702142151.v1ELpJAe064567@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Feb 14 21:51:19 2017
New Revision: 313748
URL: https://svnweb.freebsd.org/changeset/base/313748

Log:
  Register nss_atexit() before parsing nsswitch.conf for the first time.
  
  NSS modules are loaded when nsswitch.conf is parsed and may register their
  own atexit handlers with libc. nss_atexit() unloads any dynamically loaded
  NSS modules, so it should run only after the modules' atexit handlers have
  been invoked.
  
  MFC after:	2 weeks
  Sponsored by:	Dell EMC Isilon

Modified:
  head/lib/libc/net/nsdispatch.c

Modified: head/lib/libc/net/nsdispatch.c
==============================================================================
--- head/lib/libc/net/nsdispatch.c	Tue Feb 14 21:36:18 2017	(r313747)
+++ head/lib/libc/net/nsdispatch.c	Tue Feb 14 21:51:19 2017	(r313748)
@@ -371,12 +371,12 @@ nss_configure(void)
 	    (vector_free_elem)ns_dbt_free);
 	VECTOR_FREE(_nsmod, &_nsmodsize, sizeof(*_nsmod),
 	    (vector_free_elem)ns_mod_free);
+	if (confmod == 0)
+		(void)atexit(nss_atexit);
 	nss_load_builtin_modules();
 	_nsyyparse();
 	(void)fclose(_nsyyin);
 	vector_sort(_nsmap, _nsmapsize, sizeof(*_nsmap), string_compare);
-	if (confmod == 0)
-		(void)atexit(nss_atexit);
 	confmod = statbuf.st_mtime;
 
 #ifdef NS_CACHING



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702142151.v1ELpJAe064567>