Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

openpam_straddch(3) [freebsd man page]

OPENPAM_STRADDCH(3)					   BSD Library Functions Manual 				       OPENPAM_STRADDCH(3)

openpam_straddch -- add a character to a string, expanding the buffer if needed LIBRARY
Pluggable Authentication Module Library (libpam, -lpam) SYNOPSIS
#include <sys/types.h> #include <security/pam_appl.h> #include <security/openpam.h> int openpam_straddch(char **str, size_t *size, size_t *len, int ch); DESCRIPTION
The openpam_straddch() function appends a character to a dynamically allocated NUL-terminated buffer, reallocating the buffer as needed. The str argument points to a variable containing either a pointer to an existing buffer or NULL. If the value of the variable pointed to by str is NULL, a new buffer is allocated. The size and len argument point to variables used to hold the size of the buffer and the length of the string it contains, respectively. The final argument, ch, is the character that should be appended to the string. If ch is 0, nothing is appended, but a new buffer is still allocated if str is NULL. This can be used to ``bootstrap'' the string. If a new buffer is allocated or an existing buffer is reallocated to make room for the additional character, str and size are updated accord- ingly. The openpam_straddch() function ensures that the buffer is always NUL-terminated. If the openpam_straddch() function is successful, it increments the integer variable pointed to by len (unless ch was 0) and returns 0. Oth- erwise, it leaves the variables pointed to by str, size and len unmodified, sets errno to ENOMEM and returns -1. RETURN VALUES
The openpam_straddch() function returns 0 on success and -1 on failure. SEE ALSO
pam(3), pam_strerror(3) STANDARDS
The openpam_straddch() function is an OpenPAM extension. AUTHORS
The openpam_straddch() function and this manual page were developed by Dag-Erling Smorgrav <>. BSD
September 12, 2014 BSD

Check Out this Related Man Page

OPENPAM_READLINE(3)					   BSD Library Functions Manual 				       OPENPAM_READLINE(3)

openpam_readline -- read a line from a file LIBRARY
Pluggable Authentication Module Library (libpam, -lpam) SYNOPSIS
#include <sys/types.h> #include <stdio.h> #include <security/pam_appl.h> #include <security/openpam.h> char * openpam_readline(FILE *f, int *lineno, size_t *lenp); DESCRIPTION
This function is deprecated and may be removed in a future release without further warning. The openpam_readlinev() function may be used to achieve similar results. The openpam_readline() function reads a line from a file, and returns it in a NUL-terminated buffer allocated with malloc(3). The openpam_readline() function performs a certain amount of processing on the data it reads: o Comments (introduced by a hash sign) are stripped. o Blank lines are ignored. o If a line ends in a backslash, the backslash is stripped and the next line is appended. If lineno is not NULL, the integer variable it points to is incremented every time a newline character is read. If lenp is not NULL, the length of the line (not including the terminating NUL character) is stored in the variable it points to. The caller is responsible for releasing the returned buffer by passing it to free(3). RETURN VALUES
The openpam_readline() function returns NULL on failure. SEE ALSO
openpam_readlinev(3), openpam_readword(3), pam(3) STANDARDS
The openpam_readline() function is an OpenPAM extension. AUTHORS
The openpam_readline() function and this manual page were developed for the FreeBSD Project by ThinkSec AS and Network Associates Laborato- ries, the Security Research Division of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (``CBOSS''), as part of the DARPA CHATS research program. The OpenPAM library is maintained by Dag-Erling Smorgrav <>. BSD
September 12, 2014 BSD
Man Page