OpenPAM Figwort broke PAM modules from ports
Jeremie Le Hen
jeremie at le-hen.org
Sun Jun 26 21:09:58 GMT 2005
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 >
More information about the freebsd-ports
mailing list