Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 May 2003 04:42:39 -0700 (PDT)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 31854 for review
Message-ID:  <200305251142.h4PBgdI1065631@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=31854

Change 31854 by des@des.at.des.thinksec.com on 2003/05/25 04:41:46

	Use RTLD_NOW where available, and define it to RTLD_LAZY otherwise.

Affected files ...

.. //depot/projects/openpam/lib/openpam_dynamic.c#12 edit

Differences ...

==== //depot/projects/openpam/lib/openpam_dynamic.c#12 (text+ko) ====

@@ -31,7 +31,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/openpam/lib/openpam_dynamic.c#11 $
+ * $P4: //depot/projects/openpam/lib/openpam_dynamic.c#12 $
  */
 
 #include <dlfcn.h>
@@ -43,6 +43,10 @@
 
 #include "openpam_impl.h"
 
+#ifndef RTLD_NOW
+#define RTLD_NOW RTLD_LAZY
+#endif
+
 /*
  * OpenPAM internal
  *
@@ -64,10 +68,10 @@
 	/* try versioned module first, then unversioned module */
 	if (asprintf(&vpath, "%s.%d", path, LIB_MAJ) < 0)
 		goto buf_err;
-	if ((dlh = dlopen(vpath, RTLD_LAZY)) == NULL) {
+	if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
 		openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
 		*strrchr(vpath, '.') = '\0';
-		if ((dlh = dlopen(vpath, RTLD_LAZY)) == NULL) {
+		if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
 			openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
 			FREE(module);
 			return (NULL);



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