xref: /freebsd/contrib/openpam/doc/man/openpam_readline.3 (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1.\" Generated from openpam_readline.c by gendoc.pl
2.Dd June 27, 2023
3.Dt OPENPAM_READLINE 3
4.Os
5.Sh NAME
6.Nm openpam_readline
7.Nd read a line from a file
8.Sh SYNOPSIS
9.In sys/types.h
10.In stdio.h
11.In security/pam_appl.h
12.In security/openpam.h
13.Ft "char *"
14.Fn openpam_readline "FILE *f" "int *lineno" "size_t *lenp"
15.Sh DESCRIPTION
16.Bf Sy
17This function is deprecated and may be removed in a future release without further warning.
18The
19.Fn openpam_readlinev
20function may be used to achieve similar results.
21.Ef
22.Pp
23The
24.Fn openpam_readline
25function reads a line from a file, and returns it
26in a NUL-terminated buffer allocated with
27.Xr malloc 3 .
28.Pp
29The
30.Fn openpam_readline
31function performs a certain amount of processing
32on the data it reads:
33.Bl -bullet
34.It
35Comments (introduced by a hash sign) are stripped.
36.It
37Blank lines are ignored.
38.It
39If a line ends in a backslash, the backslash is stripped and the
40next line is appended.
41.El
42.Pp
43If
44.Fa lineno
45is not
46.Dv NULL ,
47the integer variable it points to is
48incremented every time a newline character is read.
49.Pp
50If
51.Fa lenp
52is not
53.Dv NULL ,
54the length of the line (not including the
55terminating NUL character) is stored in the variable it points to.
56.Pp
57The caller is responsible for releasing the returned buffer by passing
58it to
59.Xr free 3 .
60.Pp
61.Sh RETURN VALUES
62The
63.Fn openpam_readline
64function returns
65.Dv NULL
66on failure.
67.Sh SEE ALSO
68.Xr openpam_readlinev 3 ,
69.Xr openpam_readword 3 ,
70.Xr pam 3
71.Sh STANDARDS
72The
73.Fn openpam_readline
74function is an OpenPAM extension.
75.Sh AUTHORS
76The
77.Fn openpam_readline
78function and this manual page were
79developed for the
80.Fx
81Project by ThinkSec AS and Network Associates Laboratories, the
82Security Research Division of Network Associates, Inc.\& under
83DARPA/SPAWAR contract N66001-01-C-8035
84.Pq Dq CBOSS ,
85as part of the DARPA CHATS research program.
86.Pp
87The OpenPAM library is maintained by
88.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no .
89