~ubuntu-branches/ubuntu/breezy/pam/breezy

« back to all changes in this revision

Viewing changes to Linux-PAM/dynamic/test.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2004-06-28 14:28:08 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040628142808-adikk7vtfg3pzcjw
Tags: 0.76-22
* Add uploaders
* Document location of repository
* Fix options containing arguments in pam_unix, Closes: #254904

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <dlfcn.h>
 
3
#include <unistd.h>
 
4
 
 
5
#include <security/pam_appl.h>
 
6
#include <security/pam_misc.h>
 
7
 
 
8
int main(int argc, char **argv)
 
9
{
 
10
    void *handle;
 
11
 
 
12
    handle = dlopen("./pam.so", RTLD_NOW);
 
13
    if (handle == NULL) {
 
14
        fprintf(stderr, "failed to load pam.so: %s\n", dlerror());
 
15
        exit(1);
 
16
    }
 
17
 
 
18
    /* handle->XXX points to each of the PAM functions */
 
19
    
 
20
    
 
21
    if (dlclose(handle)) {
 
22
        fprintf(stderr, "failed to unload pam.so: %s\n", dlerror());
 
23
        exit(1);
 
24
    }
 
25
 
 
26
    exit(0);
 
27
}