1*0d9d0fd8Schristos.\" $NetBSD: openpam_readline.3,v 1.9 2023/06/30 21:46:20 christos Exp $ 244269bb5Schristos.\" 38fa0fefeSchristos.\" Generated from openpam_readline.c by gendoc.pl 4*0d9d0fd8Schristos.Dd June 27, 2023 544269bb5Schristos.Dt OPENPAM_READLINE 3 644269bb5Schristos.Os 744269bb5Schristos.Sh NAME 844269bb5Schristos.Nm openpam_readline 944269bb5Schristos.Nd read a line from a file 1044269bb5Schristos.Sh SYNOPSIS 1144269bb5Schristos.In sys/types.h 12e1b25b17Schristos.In stdio.h 1344269bb5Schristos.In security/pam_appl.h 1444269bb5Schristos.In security/openpam.h 1544269bb5Schristos.Ft "char *" 1644269bb5Schristos.Fn openpam_readline "FILE *f" "int *lineno" "size_t *lenp" 1744269bb5Schristos.Sh DESCRIPTION 18e1b25b17Schristos.Bf Sy 19e1b25b17SchristosThis function is deprecated and may be removed in a future release without further warning. 2044269bb5SchristosThe 21e1b25b17Schristos.Fn openpam_readlinev 22e1b25b17Schristosfunction may be used to achieve similar results. 23e1b25b17Schristos.Ef 24e1b25b17Schristos.Pp 25e1b25b17SchristosThe 26e1b25b17Schristos.Fn openpam_readline 2744269bb5Schristosfunction reads a line from a file, and returns it 2844269bb5Schristosin a NUL-terminated buffer allocated with 2944269bb5Schristos.Xr malloc 3 . 3044269bb5Schristos.Pp 3144269bb5SchristosThe 32e1b25b17Schristos.Fn openpam_readline 3344269bb5Schristosfunction performs a certain amount of processing 3444269bb5Schristoson the data it reads: 3544269bb5Schristos.Bl -bullet 3644269bb5Schristos.It 37e1b25b17SchristosComments (introduced by a hash sign) are stripped. 3844269bb5Schristos.It 3944269bb5SchristosBlank lines are ignored. 4044269bb5Schristos.It 4144269bb5SchristosIf a line ends in a backslash, the backslash is stripped and the 4244269bb5Schristosnext line is appended. 4344269bb5Schristos.El 4444269bb5Schristos.Pp 4544269bb5SchristosIf 4644269bb5Schristos.Fa lineno 4744269bb5Schristosis not 4844269bb5Schristos.Dv NULL , 4944269bb5Schristosthe integer variable it points to is 5044269bb5Schristosincremented every time a newline character is read. 5144269bb5Schristos.Pp 5244269bb5SchristosIf 5344269bb5Schristos.Fa lenp 5444269bb5Schristosis not 5544269bb5Schristos.Dv NULL , 5644269bb5Schristosthe length of the line (not including the 5744269bb5Schristosterminating NUL character) is stored in the variable it points to. 5844269bb5Schristos.Pp 5944269bb5SchristosThe caller is responsible for releasing the returned buffer by passing 6044269bb5Schristosit to 6144269bb5Schristos.Xr free 3 . 62e1b25b17Schristos.Pp 6344269bb5Schristos.Sh RETURN VALUES 6444269bb5SchristosThe 65e1b25b17Schristos.Fn openpam_readline 6644269bb5Schristosfunction returns 6744269bb5Schristos.Dv NULL 6844269bb5Schristoson failure. 6944269bb5Schristos.Sh SEE ALSO 70e1b25b17Schristos.Xr openpam_readlinev 3 , 71e1b25b17Schristos.Xr openpam_readword 3 , 7244269bb5Schristos.Xr pam 3 7344269bb5Schristos.Sh STANDARDS 7444269bb5SchristosThe 75e1b25b17Schristos.Fn openpam_readline 7644269bb5Schristosfunction is an OpenPAM extension. 7744269bb5Schristos.Sh AUTHORS 7844269bb5SchristosThe 79e1b25b17Schristos.Fn openpam_readline 80e1b25b17Schristosfunction and this manual page were 81e1b25b17Schristosdeveloped for the 8244269bb5Schristos.Fx 83e1b25b17SchristosProject by ThinkSec AS and Network Associates Laboratories, the 8444269bb5SchristosSecurity Research Division of Network Associates, Inc.\& under 8544269bb5SchristosDARPA/SPAWAR contract N66001-01-C-8035 8644269bb5Schristos.Pq Dq CBOSS , 8744269bb5Schristosas part of the DARPA CHATS research program. 888fa0fefeSchristos.Pp 898fa0fefeSchristosThe OpenPAM library is maintained by 904cb4af11Schristos.An Dag-Erling Sm\(/orgrav Aq Mt des@des.no . 91