From owner-svn-src-head@freebsd.org Tue Feb 14 21:51:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67F9BCDF9F1; Tue, 14 Feb 2017 21:51:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 373061F98; Tue, 14 Feb 2017 21:51:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1ELpJlD064568; Tue, 14 Feb 2017 21:51:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1ELpJAe064567; Tue, 14 Feb 2017 21:51:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702142151.v1ELpJAe064567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 14 Feb 2017 21:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313748 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Feb 2017 21:51:20 -0000 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