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