Import upstream version 0.28+git20180225.1.ce56811
Debian Janitor
2 years ago
64 | 64 | 0.26 2015-12-08 Mike McCauley |
65 | 65 | - pass CFLAGS and CPPFLAGS explicitly in the subdirectory to get all |
66 | 66 | hardening flags, Patch from Florian Schlichting. |
67 | ||
68 | 0.27 2020-02-09 Mike McCauley | |
69 | - Patch from Jacob Farkas via RT to allow building under on Alpine Linux | |
70 | under Docker on armv7l, and possibly others | |
71 | ||
72 | 0.28 2020-03-14 Mike McCauley | |
73 | - Patch from Heikki Vatiainen: | |
74 | - File descriptor leak introduced in release 0.25 where check for open | |
75 | connection was added to TacacsPlus::close() before calling tacpluslib's | |
76 | deinit_tac_session() | |
77 | - File descriptor leak in tacpluslib's init_tac_session where close() | |
78 | was not called for the newly created socket if, for example, destination | |
79 | host was unreachable | |
80 | - Port and Timeout TacacsPlus::new() parameters were documented | |
81 | incorrectly. The are not passed within array references. |
16 | 16 | tacpluslib/tac_plus.h |
17 | 17 | tacpluslib/tacplus_client.h |
18 | 18 | tacpluslib/utils.c |
19 | META.json | |
20 | META.yml | |
19 | ||
20 | META.yml Module meta-data (added by MakeMaker) | |
21 | META.json Module JSON meta-data (added by MakeMaker) |
3 | 3 | "unknown" |
4 | 4 | ], |
5 | 5 | "dynamic_config" : 1, |
6 | "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", | |
6 | "generated_by" : "ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010", | |
7 | 7 | "license" : [ |
8 | 8 | "unknown" |
9 | 9 | ], |
31 | 31 | } |
32 | 32 | }, |
33 | 33 | "release_status" : "stable", |
34 | "version" : "0.28", | |
35 | "x_serialization_backend" : "JSON::PP version 2.97001" | |
34 | "version" : "0.26", | |
35 | "x_serialization_backend" : "JSON::PP version 4.04" | |
36 | 36 | } |
6 | 6 | configure_requires: |
7 | 7 | ExtUtils::MakeMaker: '0' |
8 | 8 | dynamic_config: 1 |
9 | generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' | |
9 | generated_by: 'ExtUtils::MakeMaker version 7.44, CPAN::Meta::Converter version 2.150010' | |
10 | 10 | license: unknown |
11 | 11 | meta-spec: |
12 | 12 | url: http://module-build.sourceforge.net/META-spec-v1.4.html |
16 | 16 | directory: |
17 | 17 | - t |
18 | 18 | - inc |
19 | version: '0.28' | |
19 | version: '0.26' | |
20 | 20 | x_serialization_backend: 'CPAN::Meta::YAML version 0.018' |
16 | 16 | @EXPORT_OK = qw( |
17 | 17 | TACPLUS_CLIENT |
18 | 18 | ); |
19 | $VERSION = '0.28'; | |
19 | $VERSION = '0.26'; | |
20 | 20 | |
21 | 21 | sub new |
22 | 22 | { |
49 | 49 | $h{'Key'}, |
50 | 50 | $h{'Timeout'} ? $h{'Timeout'} : 15 |
51 | 51 | ); |
52 | $self->{'open'} = 1 if ($res >= 0); | |
52 | 53 | last if ($res >= 0); |
53 | 54 | } |
54 | 55 | } |
55 | $self->{'open'} = 1 if ($res >= 0); | |
56 | 56 | undef $self if ($res < 0); |
57 | 57 | $self; |
58 | 58 | } |
145 | 145 | |
146 | 146 | $tac = new Authen::TacacsPlus(Host=>$server, |
147 | 147 | Key=>$key, |
148 | Port=>'tacacs', | |
149 | Timeout=>15); | |
148 | [Port=>'tacacs'], | |
149 | [Timeout=>15]); | |
150 | 150 | |
151 | 151 | or |
152 | 152 | |
153 | 153 | $tac = new Authen::TacacsPlus( |
154 | [ Host=>$server1, Key=>$key1, Port=>'tacacs', Timeout=>15 ], | |
155 | [ Host=>$server2, Key=>$key2, Port=>'tacacs', Timeout=>15 ], | |
156 | [ Host=>$server3, Key=>$key3, Port=>'tacacs', Timeout=>15 ], | |
154 | [ Host=>$server1, Key=>$key1, [Port=>'tacacs'], [Timeout=>15] ], | |
155 | [ Host=>$server2, Key=>$key2, [Port=>'tacacs'], [Timeout=>15] ], | |
156 | [ Host=>$server3, Key=>$key3, [Port=>'tacacs'], [Timeout=>15] ], | |
157 | 157 | ... ); |
158 | 158 | |
159 | 159 | $tac->authen($username,$passwords); |
169 | 169 | |
170 | 170 | $tac = new Authen::TacacsPlus(Host=>$server, |
171 | 171 | Key=>$key, |
172 | Port=>'tacacs', | |
173 | Timeout=>15); | |
172 | [Port=>'tacacs'], | |
173 | [Timeout=>15]); | |
174 | 174 | |
175 | 175 | Opens new session with tacacs+ server on host $server, encrypted |
176 | 176 | with key $key. Undefined object is returned if something wrong |
208 | 208 | if( flags < 0 ) { |
209 | 209 | //fprintf( stderr, "fcntl: %s\n", strerror(errno) ); |
210 | 210 | tac_err = "socket error"; |
211 | close(tac_fd); | |
212 | 211 | return -1; |
213 | 212 | } |
214 | 213 | |
217 | 216 | if( res < 0 ) { |
218 | 217 | //fprintf( stderr, "fcntl: %s\n", strerror(errno) ); |
219 | 218 | tac_err = "socket error"; |
220 | close(tac_fd); | |
221 | 219 | return -1; |
222 | 220 | } |
223 | 221 | |
227 | 225 | // connection not established, but in progress |
228 | 226 | if( res < 0 && (errno != EINPROGRESS) ) { |
229 | 227 | tac_err = "connection failed"; |
230 | close(tac_fd); | |
231 | 228 | return -1; |
232 | 229 | } |
233 | 230 | |
241 | 238 | res = select( tac_fd+1, NULL, &wset, NULL, &tv ); |
242 | 239 | if( res < 0 ) { |
243 | 240 | tac_err = "select failed"; |
244 | close(tac_fd); | |
245 | 241 | return -1; |
246 | 242 | } |
247 | 243 | else if( res == 0 ) { |
248 | 244 | tac_err = "timeout"; |
249 | close(tac_fd); | |
250 | 245 | return -1; |
251 | 246 | } |
252 | 247 | if( res > 0 ) { |
255 | 250 | len = sizeof(optval); |
256 | 251 | if( getsockopt( tac_fd, SOL_SOCKET, SO_ERROR, (void *)&optval, &len ) > 0 ) { |
257 | 252 | tac_err = "getsockopt failed"; |
258 | close(tac_fd); | |
259 | 253 | return -1; |
260 | 254 | } |
261 | 255 | if( optval != 0 ) { |
262 | 256 | tac_err = "connection failed"; |
263 | close(tac_fd); | |
264 | 257 | return -1; |
265 | 258 | } |
266 | 259 | // optval == 0 --> no error, connection established |