Changeset 866
- Timestamp:
- 12/09/07 11:49:43 (1 year ago)
- Files:
-
- fwknop/trunk/ChangeLog (modified) (1 diff)
- fwknop/trunk/fwknop (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fwknop/trunk/ChangeLog
r854 r866 42 42 - Bugfix in fwknopd to account for non-Ethernet link layer header over 43 43 *BSD loopback interfaces. 44 - Added --Save-dst argument to the fwknop client to add a priority file to 45 store client command line arguments (~/.fwknop.save). This file is only 46 overwritten when --Save-dst is used. 44 47 45 48 fwknop-1.8.3 (11/17/2007): fwknop/trunk/fwknop
r862 r866 89 89 my $cmdline_pcap_cmd = ''; 90 90 my $no_save_last_args = 0; 91 my $save_destination = 0; 91 92 my $server_auth_method = ''; 92 93 my $spa_established_tcp = 0; … … 96 97 my $knock_dst_pre_resolve = ''; 97 98 98 ### User agent for contacting http://www.whatismyip.org/, we don't99 ### advertise the fwknop client (canoverride with --User-agent)99 ### User agent for contacting http://www.whatismyip.org/, (can 100 ### override with --User-agent) 100 101 my $ext_resolve_user_agent = "Fwknop/$version"; 101 102 $ext_resolve_user_agent =~ s|-pre\d+||; … … 1203 1204 close S; 1204 1205 1206 if ($save_destination) { 1207 open D, "> $homedir/.fwknop.save" 1208 or die "[*] Could not open $homedir/.fwknop.save"; 1209 print D "@args_cp\n"; 1210 close D; 1211 } 1212 1205 1213 my @host_lines = (); 1206 1214 my $matched_dst = 0; … … 1244 1252 'Save-packet' => \$save_packet_mode, 1245 1253 'Save-packet-file=s' => \$save_packet_file, 1254 'Save-dst' => \$save_destination, 1246 1255 'user-rc=s' => \$user_rc_file, 1247 1256 'knock-dst=s' => \$knock_dst, … … 1284 1293 1285 1294 sub run_last_cmdline() { 1286 my $save_file = "$homedir/.fwknop.run"; 1287 if (-e $save_file) { 1295 1296 my $found_file = 0; 1297 1298 for my $save_file ("$homedir/.fwknop.save", "$homedir/.fwknop.run") { 1299 next unless -e $save_file; 1300 1288 1301 open S, "< $save_file" or die "[*] Could not open $save_file: $!"; 1289 1302 my $arg_line = <S>; … … 1299 1312 @ARGV = split /\s+/, $arg_line; 1300 1313 1301 ### run GetOpt() to get com and line args1314 ### run GetOpt() to get command line args 1302 1315 &handle_command_line(); 1303 1316 1304 } else { 1305 die "[*] fwknop argument save file $save_file does not exist."; 1317 $found_file = 1; 1318 last; 1319 1320 } 1321 1322 unless ($found_file) { 1323 die "[*] fwknop argument save files (~/.fwknop.save and ", 1324 "~/.fwknop.run) not found."; 1306 1325 } 1307 1326 return; … … 1310 1329 sub run_last_host_cmdline() { 1311 1330 my $hosts_file = "$homedir/.fwknop.hosts"; 1312 if (-e $hosts_file) { 1331 1332 my $found_file = 0; 1333 my $found_host = 0; 1334 for my $file ("$homedir/.fwknop.save", "$homedir/.fwknop.hosts") { 1335 next unless -e $file; 1336 1313 1337 my $arg_line = ''; 1314 1338 open H, "< $hosts_file" or die "[*] Could not open $hosts_file: $!"; … … 1336 1360 &handle_command_line(); 1337 1361 1338 } else { 1339 print "[-] No matching destination host in $hosts_file\n"; 1340 } 1341 } else { 1342 die "[*] fwknop argument save file $hosts_file does not exist."; 1362 $found_host = 1; 1363 last; 1364 } 1365 $found_file = 1; 1366 } 1367 1368 unless ($found_file) { 1369 die "[*] fwknop argument save files (~/.fwknop.save and ", 1370 "~/.fwknop.hosts) not found."; 1371 } 1372 1373 unless ($found_host) { 1374 print "[-] No matching destination host in ~/.fwknop.save ", 1375 "or ~/.fwknop.hosts\n"; 1343 1376 } 1344 1377 return; … … 1423 1456 (requires the -R option). The default user 1424 1457 agent is: $ext_resolve_user_agent 1458 --Save-dst - Save the command line args for this 1459 invocation against the destination to the 1460 special file ~/.fwknop.save (this file 1461 provides a priority location that is only 1462 overwritten with --Save-dst and is useful 1463 for an fwknop client command that you want 1464 to always preserve). 1425 1465 --Save-packet - Save a copy of an encrypted SPA packet to 1426 to a file (~/fwknop_save_packet. $$by1466 to a file (~/fwknop_save_packet.<pid> by 1427 1467 default). 1428 1468 --Save-packet-file - Specify the path to the file where the
