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