|
pam_pkcs11 0.6.13
|
#include <sys/types.h>#include <stdlib.h>#include <string.h>#include <pwd.h>#include <../common/cert_st.h>#include "../scconf/scconf.h"Go to the source code of this file.
Data Structures | |
| struct | mapper_module_st |
| Structure to be filled on mapper module initialization. More... | |
| struct | mapfile |
| This struct is used in processing map files a map file is a list of "key" " -> " "value" text lines. More... | |
Macros | |
| #define | MAPPER_EXTERN extern |
| #define | _DEFAULT_MAPPER_FIND_ENTRIES |
| Default macro for locate certificate entry. | |
| #define | _DEFAULT_MAPPER_FIND_USER |
| Default macro for locating user. | |
| #define | _DEFAULT_MAPPER_MATCH_USER |
| Macro for match mapper function. | |
| #define | _DEFAULT_MAPPER_END |
| Macro for de-initialization routine. | |
| #define | _DEFAULT_MAPPER_INIT |
| Macro for default init function. | |
Typedefs | |
| typedef struct mapper_module_st | mapper_module |
| Structure to be filled on mapper module initialization. | |
Functions | |
| mapper_module * | mapper_module_init (scconf_block *ctx, const char *mapper_name) |
| Initialize module and mapper_module_st structure. | |
| MAPPER_EXTERN struct mapfile * | set_mapent (const char *uri) |
| Initialize a mapper entry table. | |
| MAPPER_EXTERN int | get_mapent (struct mapfile *mfile) |
| Retrieve next entry of given map file. | |
| MAPPER_EXTERN void | end_mapent (struct mapfile *mfile) |
| Release a mapentry structure. | |
| MAPPER_EXTERN char * | mapfile_find (const char *file, char *key, int ignorecase, int *match) |
| Try to map "key" to provided mapfile. | |
| MAPPER_EXTERN int | mapfile_match (const char *file, char *key, const char *value, int ignorecase) |
| Try to match provided key to provided name by mean of a mapfile. | |
| MAPPER_EXTERN char * | search_pw_entry (const char *item, int ignorecase) |
| find the user login that matches pw_name or pw_gecos with provided item | |
| MAPPER_EXTERN int | compare_pw_entry (const char *item, struct passwd *pw, int ignorecase) |
| Test if provided item matches pw_name or pw_gecos of provided password structure. | |
| #define _DEFAULT_MAPPER_END |
| #define _DEFAULT_MAPPER_FIND_ENTRIES |
Default macro for locate certificate entry.
Provided as sample for debugging, not for real user
| x509 | X509 Certificate |
| context | Mapper context |
| #define _DEFAULT_MAPPER_FIND_USER |
Default macro for locating user.
Should not be used except for debugging, as always returns "nobody"
| x509 | X509 Certificate |
| context | Mapper context |
| #define _DEFAULT_MAPPER_INIT |
Macro for default init function.
| blk | Mapper Configuration file block |
| name | Name of this mapper |
| #define _DEFAULT_MAPPER_MATCH_USER |
Macro for match mapper function.
| x509 | X509 Certificate |
| login | user to match, or null to find user that matches certificate |
| context | Mapper context |
| #define MAPPER_EXTERN extern |
Definition at line 96 of file mapper.h.
Referenced by compare_pw_entry(), end_mapent(), get_mapent(), mapfile_find(), mapfile_match(), search_pw_entry(), and set_mapent().
| typedef struct mapper_module_st mapper_module |
Structure to be filled on mapper module initialization.
| MAPPER_EXTERN int compare_pw_entry | ( | const char * | item, |
| struct passwd * | pw, | ||
| int | ignorecase ) |
Test if provided item matches pw_name or pw_gecos of provided password structure.
| item | String to be compared |
| pw | password entry to search into |
| ignorecase | Flag to check upper/lowercase in string comparisons |
References compare_pw_entry(), and MAPPER_EXTERN.
Referenced by compare_pw_entry().
| MAPPER_EXTERN void end_mapent | ( | struct mapfile * | mfile | ) |
Release a mapentry structure.
| mfile | Map file structure to be released |
References end_mapent(), and MAPPER_EXTERN.
Referenced by end_mapent().
| MAPPER_EXTERN int get_mapent | ( | struct mapfile * | mfile | ) |
Retrieve next entry of given map file.
| mfile | Map file entry pointer |
References get_mapent(), and MAPPER_EXTERN.
Referenced by get_mapent().
| MAPPER_EXTERN char * mapfile_find | ( | const char * | file, |
| char * | key, | ||
| int | ignorecase, | ||
| int * | match ) |
Try to map "key" to provided mapfile.
| file | URL of map file |
| key | String to be mapped |
| ignorecase | Flag to indicate upper/lowercase ignore in string compare |
| match | Set to 1 for mapped string return, unmodified for key return |
References mapfile_find(), and MAPPER_EXTERN.
Referenced by mapfile_find().
| MAPPER_EXTERN int mapfile_match | ( | const char * | file, |
| char * | key, | ||
| const char * | value, | ||
| int | ignorecase ) |
Try to match provided key to provided name by mean of a mapfile.
| file | URL of map file |
| key | String to be mapped |
| value | String to be matched against mapped result |
| ignorecase | Flag to indicate upper/lowercase ignore in string compare |
References mapfile_match(), and MAPPER_EXTERN.
Referenced by mapfile_match().
| mapper_module * mapper_module_init | ( | scconf_block * | ctx, |
| const char * | mapper_name ) |
Initialize module and mapper_module_st structure.
EVERY mapper module MUST provide and export this function if dinamycally linked
| ctx | Pointer to related configuration file context |
| mapper_name | Name of this mapper. Used for multi-mapper modules |
References mapper_module_init().
Referenced by mapper_module_init().
| MAPPER_EXTERN char * search_pw_entry | ( | const char * | item, |
| int | ignorecase ) |
find the user login that matches pw_name or pw_gecos with provided item
| item | Data to be searched from password database |
| ignorecase | Flag to check upper/lowercase in string comparisons |
References MAPPER_EXTERN, and search_pw_entry().
Referenced by search_pw_entry().
| MAPPER_EXTERN struct mapfile * set_mapent | ( | const char * | uri | ) |
Initialize a mapper entry table.
| uri | Universal Resource Locator of the file to be mapped |
References MAPPER_EXTERN, and set_mapent().
Referenced by set_mapent().