OpenPAM Figwort broke PAM modules from ports

From: Jeremie Le Hen <jeremie_at_le-hen.org>
Date: Sun, 26 Jun 2005 23:10:11 +0200
Hi,

first sorry for cross-posting, but I think this may interest both
-current_at_ and -ports_at_ 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
    _at__at_ -57,6 +57,7 _at__at_ pam_module_t *
     openpam_dynamic(const char *path)
     {
     	pam_module_t *module;
    +	const char *prefix;
     	char *vpath;
     	void *dlh;
     	int i;
    _at__at_ -65,8 +66,14 _at__at_ 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 >
Received on Sun Jun 26 2005 - 19:09:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:37 UTC