Debian Codegraph @

upstream/opensuse-tumbleweed/man3/Net::Netrc.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "Net::Netrc 3pm"
61 .TH Net::Netrc 3pm 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 Net::Netrc \- OO interface to users netrc file
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& use Net::Netrc;
72 \&
73 \& $mach = Net::Netrc\->lookup(\*(Aqsome.machine\*(Aq);
74 \& $login = $mach\->login;
75 \& ($login, $password, $account) = $mach\->lpa;
76 .Ve
77 .SH DESCRIPTION
78 .IX Header "DESCRIPTION"
79 \&\f(CW\*(C`Net::Netrc\*(C'\fR is a class implementing a simple interface to the .netrc file
80 used as by the ftp program.
81 .PP
82 \&\f(CW\*(C`Net::Netrc\*(C'\fR also implements security checks just like the ftp program,
83 these checks are, first that the .netrc file must be owned by the user and
84 second the ownership permissions should be such that only the owner has
85 read and write access. If these conditions are not met then a warning is
86 output and the .netrc file is not read.
87 .SS "The \fI.netrc\fP File"
88 .IX Subsection "The .netrc File"
89 The .netrc file contains login and initialization information used by the
90 auto\-login process. It resides in the user\*(Aqs home directory. The following
91 tokens are recognized; they may be separated by spaces, tabs, or new\-lines:
92 .IP "machine name" 4
93 .IX Item "machine name"
94 Identify a remote machine name. The auto\-login process searches
95 the .netrc file for a machine token that matches the remote machine
96 specified. Once a match is made, the subsequent .netrc tokens
97 are processed, stopping when the end of file is reached or an\-
98 other machine or a default token is encountered.
99 .IP default 4
100 .IX Item "default"
101 This is the same as machine name except that default matches
102 any name. There can be only one default token, and it must be
103 after all machine tokens. This is normally used as:
104 .Sp
105 .Vb 1
106 \& default login anonymous password user@site
107 .Ve
108 .Sp
109 thereby giving the user automatic anonymous login to machines
110 not specified in .netrc.
111 .IP "login name" 4
112 .IX Item "login name"
113 Identify a user on the remote machine. If this token is present,
114 the auto\-login process will initiate a login using the
115 specified name.
116 .IP "password string" 4
117 .IX Item "password string"
118 Supply a password. If this token is present, the auto\-login
119 process will supply the specified string if the remote server
120 requires a password as part of the login process.
121 .IP "account string" 4
122 .IX Item "account string"
123 Supply an additional account password. If this token is present,
124 the auto\-login process will supply the specified string
125 if the remote server requires an additional account password.
126 .IP "macdef name" 4
127 .IX Item "macdef name"
128 Define a macro. \f(CW\*(C`Net::Netrc\*(C'\fR only parses this field to be compatible
129 with \fIftp\fR.
130 .SS "Class Methods"
131 .IX Subsection "Class Methods"
132 The constructor for a \f(CW\*(C`Net::Netrc\*(C'\fR object is not called new as it does not
133 really create a new object. But instead is called \f(CW\*(C`lookup\*(C'\fR as this is
134 essentially what it does.
135 .ie n .IP """lookup($machine[, $login])""" 4
136 .el .IP "\f(CWlookup($machine[, $login])\fR" 4
137 .IX Item "lookup($machine[, $login])"
138 Lookup and return a reference to the entry for \f(CW$machine\fR. If \f(CW$login\fR is given
139 then the entry returned will have the given login. If \f(CW$login\fR is not given then
140 the first entry in the .netrc file for \f(CW$machine\fR will be returned.
141 .Sp
142 If a matching entry cannot be found, and a default entry exists, then a
143 reference to the default entry is returned.
144 .Sp
145 If there is no matching entry found and there is no default defined, or
146 no .netrc file is found, then \f(CW\*(C`undef\*(C'\fR is returned.
147 .SS "Object Methods"
148 .IX Subsection "Object Methods"
149 .ie n .IP login() 4
150 .el .IP \f(CWlogin()\fR 4
151 .IX Item "login()"
152 Return the login id for the netrc entry
153 .ie n .IP password() 4
154 .el .IP \f(CWpassword()\fR 4
155 .IX Item "password()"
156 Return the password for the netrc entry
157 .ie n .IP account() 4
158 .el .IP \f(CWaccount()\fR 4
159 .IX Item "account()"
160 Return the account information for the netrc entry
161 .ie n .IP lpa() 4
162 .el .IP \f(CWlpa()\fR 4
163 .IX Item "lpa()"
164 Return a list of login, password and account information for the netrc entry
165 .SH EXPORTS
166 .IX Header "EXPORTS"
167 \&\fINone\fR.
168 .SH "KNOWN BUGS"
169 .IX Header "KNOWN BUGS"
170 See <https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=libnet>.
171 .SH "SEE ALSO"
172 .IX Header "SEE ALSO"
173 Net::Cmd.
174 .SH AUTHOR
175 .IX Header "AUTHOR"
176 Graham Barr <[email protected] <mailto:[email protected]>>.
177 .PP
178 Steve Hay <[email protected] <mailto:[email protected]>> is now maintaining
179 libnet as of version 1.22_02.
180 .SH COPYRIGHT
181 .IX Header "COPYRIGHT"
182 Copyright (C) 1995\-1998 Graham Barr. All rights reserved.
183 .PP
184 Copyright (C) 2013\-2014, 2020 Steve Hay. All rights reserved.
185 .SH LICENCE
186 .IX Header "LICENCE"
187 This module is free software; you can redistribute it and/or modify it under the
188 same terms as Perl itself, i.e. under the terms of either the GNU General Public
189 License or the Artistic License, as specified in the \fILICENCE\fR file.
190 .SH VERSION
191 .IX Header "VERSION"
192 Version 3.15
193 .SH DATE
194 .IX Header "DATE"
195 20 March 2023
196 .SH HISTORY
197 .IX Header "HISTORY"
198 See the \fIChanges\fR file.