Lines Matching defs:pam_fh
83 static int open_pam_conf(struct pam_fh **, pam_handle_t *, char *);
84 static void close_pam_conf(struct pam_fh *);
86 static int get_pam_conf_entry(struct pam_fh *, pam_handle_t *,
89 static char *nextline(struct pam_fh *, pam_handle_t *, int *);
1914 open_pam_conf(struct pam_fh **pam_fh, pam_handle_t *pamh, char *config)
1956 if ((*pam_fh = calloc(1, sizeof (struct pam_fh))) == NULL) {
1960 (*pam_fh)->fconfig = fd;
1961 (*pam_fh)->bufsize = (size_t)stb.st_size;
1962 if (((*pam_fh)->data = mmap(0, (*pam_fh)->bufsize, PROT_READ,
1963 MAP_PRIVATE, (*pam_fh)->fconfig, 0)) == MAP_FAILED) {
1965 free (*pam_fh);
1968 (*pam_fh)->bufferp = (*pam_fh)->data;
1978 close_pam_conf(struct pam_fh *pam_fh)
1980 (void) munmap(pam_fh->data, pam_fh->bufsize);
1981 (void) close(pam_fh->fconfig);
1982 free(pam_fh);
1993 struct pam_fh *pam_fh;
2014 if (open_pam_conf(&pam_fh, pamh, config) == 0) {
2019 get_pam_conf_entry(pam_fh, pamh, &pamentp)) == PAM_SUCCESS &&
2125 (void) close_pam_conf(pam_fh);
2136 get_pam_conf_entry(struct pam_fh *pam_fh, pam_handle_t *pamh, pamtab_t **pam)
2147 if ((cp = nextline(pam_fh, pamh, &err)) == NULL) {
2382 nextline(struct pam_fh *pam_fh, pam_handle_t *pamh, int *err)
2386 char *data = pam_fh->data;
2387 char *bufferp = pam_fh->bufferp;
2388 char *bufferendp = &data[pam_fh->bufsize];
2442 if ((input_len = ll - bufferp) >= sizeof (pam_fh->line)) {
2447 input_len = sizeof (pam_fh->line) - 1;
2450 (void) strncpy(pam_fh->line, bufferp, input_len);
2451 pam_fh->line[input_len] = '\0';
2452 pam_fh->bufferp = ll++;
2455 if ((input_len = ll - bufferp) >= sizeof (pam_fh->line)) {
2460 input_len = sizeof (pam_fh->line) - 1;
2463 (void) strncpy(pam_fh->line, bufferp, input_len);
2464 pam_fh->line[input_len] = '\0';
2465 pam_fh->bufferp = ll;
2468 return (pam_fh->line);