Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Jun 2005 23:10:11 +0200
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        freebsd-current@FreeBSD.org
Cc:        freebsd-ports@FreeBSD.org
Subject:   OpenPAM Figwort broke PAM modules from ports
Message-ID:  <20050626211011.GH1283@obiwan.tataz.chchile.org>

next in thread | raw e-mail | index | archive | help
Hi,

first sorry for cross-posting, but I think this may interest both
-current@ and -ports@ readers.

Dag-Erling Smørgrav imported the lastest OpenPAM release, called
"Figwort".  This release includes the following diff :
%%%
    diff -urNp openpam-feterita/lib/openpam_dynamic.c openpam-figwort/lib/openpam_dynamic.c
    --- openpam-feterita/lib/openpam_dynamic.c	Sun Jun  1 14:54:03 2003
    +++ openpam-figwort/lib/openpam_dynamic.c	Fri Jun 17 10:11:42 2005
    @@ -57,6 +57,7 @@ pam_module_t *
     openpam_dynamic(const char *path)
     {
     	pam_module_t *module;
    +	const char *prefix;
     	char *vpath;
     	void *dlh;
     	int i;
    @@ -65,8 +66,14 @@ openpam_dynamic(const char *path)
     	if ((module = calloc(1, sizeof *module)) == NULL)
     		goto buf_err;
     
    +	/* Prepend the standard prefix if not an absolute pathname. */
    +	if (path[0] != '/')
    +		prefix = OPENPAM_MODULES_DIR;
    +	else
    +		prefix = "";
    +
     	/* try versioned module first, then unversioned module */
    -	if (asprintf(&vpath, "%s.%d", path, LIB_MAJ) < 0)
    +	if (asprintf(&vpath, "%s%s.%d", prefix, path, LIB_MAJ) < 0)
     		goto buf_err;
     	if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
     		openpam_log(PAM_LOG_DEBUG, "%s: %s", vpath, dlerror());
%%%

This prevents PAM modules installed in /usr/local/lib from being
dlopen(3)'d.  I'm not sure whether FreeBSD really wants this new
``feature'' or not, but actually I think this needs a note in
src/UPDATING to be issued, explaining that PAM modules installed from
ports need to be specified with their full path now.

Regards,
-- 
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot org >



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