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