Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tails
tails
Commits
aae2d65b
Commit
aae2d65b
authored
Jan 05, 2012
by
Tails developers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import new htpdate (at commit 45dbc4c).
This adds the -D option we need.
parent
058ae840
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
config/chroot_local-includes/usr/local/sbin/htpdate
config/chroot_local-includes/usr/local/sbin/htpdate
+21
-2
No files found.
config/chroot_local-includes/usr/local/sbin/htpdate
View file @
aae2d65b
...
...
@@ -53,9 +53,25 @@ my $ssl_protocol = 'TLSv1'; # will be passed to wget's --secure-protocol
my
$useragent
=
"
htpdate/
$VERSION
";
my
$userid
=
'';
# userid for proxy servers
my
$dns_timeout
;
my
$done_file
;
my
$res_file
;
our
(
$opt_d
,
$opt_h
,
$opt_q
,
$opt_x
,
$opt_u
,
$opt_a
,
$opt_f
,
$opt_l
,
$opt_p
,
$opt_t
,
$opt_T
);
our
(
$opt_d
,
$opt_h
,
$opt_q
,
$opt_x
,
$opt_u
,
$opt_a
,
$opt_f
,
$opt_l
,
$opt_p
,
$opt_t
,
$opt_D
,
$opt_T
);
sub
done
{
if
(
defined
$done_file
)
{
$>
=
0
if
$opt_u
;
open
my
$f
,
'
>
',
$done_file
or
print
STDERR
"
Couldn't write done file:
$done_file
\n
";
close
$f
;
$>
=
getpwnam
(
$opt_u
)
if
$opt_u
;
}
}
$SIG
{
__DIE__
}
=
sub
{
done
;
die
(
@
_
);
};
sub
message
{
my
@msg
=
@_
;
...
...
@@ -83,7 +99,7 @@ sub error (@_) {
sub
parseCommandLine
()
{
# specify valid switches
getopts
('
dhqxfpu:a:l:t:T:
')
||
usage
();
getopts
('
dhqxfpu:a:l:t:
D:
T:
')
||
usage
();
usage
()
if
$opt_h
;
usage
()
unless
$ARGV
[
0
];
...
...
@@ -97,6 +113,7 @@ sub parseCommandLine () {
$quiet
=
1
if
$opt_q
;
$set_date
=
0
if
$opt_x
;
$dns_timeout
=
$opt_t
if
$opt_t
;
$done_file
=
$opt_D
if
$opt_D
;
$res_file
=
$opt_T
if
$opt_T
;
my
@urls
;
...
...
@@ -127,6 +144,7 @@ Usage: $0 [-dhqxf] [-u userid] [-a useragent] [-t dns_timeout] [-T success_file]
-l log to this file rather than to STDOUT
-p paranoid mode: don't set time unless all servers could be reached
-t DNS timeout for wget
-D create this file after quitting in any way
-T create this file after setting time successfully
e.g. $0 -x http://www.microsoft.com/ https://check.torproject.org/
...
...
@@ -272,3 +290,4 @@ my @diffs = grep {
or
error
"
No Date header could be received.
";
my
@sorted_diffs
=
sort
@diffs
;
adjustDate
(
$sorted_diffs
[
int
(
@sorted_diffs
/
2
)]);
done
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment