Changeset 94 in openpam for trunk/lib/openpam_dynamic.c


Ignore:
Timestamp:
Mar 7, 2002, 8:22:38 PM (19 years ago)
Author:
Dag-Erling Smørgrav
Message:

Fix a number of bugs in the module cache:

  • Don't log dlopen() failures, since they're rarely interesting; instead, log a failure if no module was found at all.
  • When loading a versioned module, store its logical name in the module structure rather than its physical name, since it will be looked up by its logical name if it's needed again.
  • Initialize module->next->prev when adding a module to the cache.
  • Set modules to NULL when releasing the last module in the cache.

Sponsored by: DARPA, NAI Labs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/openpam_dynamic.c

    r93 r94  
    3232 * SUCH DAMAGE.
    3333 *
    34  * $P4: //depot/projects/openpam/lib/openpam_dynamic.c#2 $
     34 * $P4: //depot/projects/openpam/lib/openpam_dynamic.c#3 $
    3535 */
    3636
     
    6565                goto buf_err;
    6666        if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
    67                 openpam_log(PAM_LOG_ERROR, "dlopen(): %s", dlerror());
    6867                *strrchr(vpath, '.') = '\0';
    6968                if ((dlh = dlopen(vpath, RTLD_NOW)) == NULL) {
    70                         openpam_log(PAM_LOG_ERROR, "dlopen(): %s", dlerror());
    7169                        free(module);
    7270                        return (NULL);
    7371                }
    7472        }
    75         module->path = vpath;
     73        free(vpath);
     74        if ((module->path = strdup(path)) == NULL)
     75                goto buf_err;
    7676        module->dlh = dlh;
    7777        for (i = 0; i < PAM_NUM_PRIMITIVES; ++i)
Note: See TracChangeset for help on using the changeset viewer.