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
cfb7bb43
Commit
cfb7bb43
authored
Nov 10, 2010
by
T(A)ILS developers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Htpdate: display the logs when the clock synchronization fails.
parent
11b1b94d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/50-htp.sh
..._local-includes/etc/NetworkManager/dispatcher.d/50-htp.sh
+4
-3
config/chroot_local-includes/usr/local/bin/tails-htp-notify-user
...chroot_local-includes/usr/local/bin/tails-htp-notify-user
+27
-1
config/chroot_local-includes/usr/local/sbin/htpdate
config/chroot_local-includes/usr/local/sbin/htpdate
+1
-0
No files found.
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/50-htp.sh
View file @
cfb7bb43
...
...
@@ -7,8 +7,8 @@
# However, since all DNS lookups are normally made through the Tor
# network, which we are not connected to at this point, we use the
# local DNS servers obtained through DHCP if possible, or the OpenDNS
# ones
, el
se.
# local DNS servers obtained through DHCP
,
if possible, or the OpenDNS
# ones
otherwi
se.
# To limit fingerprinting possibilities, we do not want to send HTTP
# requests aimed at an IP-based virtualhost such as https://IP/, but
...
...
@@ -116,7 +116,7 @@ echo "${END_MAGIC}" >> /etc/hosts
touch
"
${
HTPDATE_LOG
}
"
chown
htp:nogroup
"
${
HTPDATE_LOG
}
"
chmod
6
00
"
${
HTPDATE_LOG
}
"
chmod
6
44
"
${
HTPDATE_LOG
}
"
/usr/local/sbin/htpdate
\
-d
\
...
...
@@ -132,6 +132,7 @@ echo "htpdate exited with return code ${HTPDATE_RET}" >>$LOG
cleanup_etc_hosts
echo
"
${
HTPDATE_RET
}
"
>
"
${
DONE_FILE
}
"
touch
"
${
DONE_FILE
}
"
exit
${
HTPDATE_RET
}
config/chroot_local-includes/usr/local/bin/tails-htp-notify-user
View file @
cfb7bb43
...
...
@@ -47,4 +47,30 @@ $notification->show();
until
(
-
e
$htp_done_file
)
{
sleep
1
;
}
$notification
->
close
();
# read the return code from /var/lib/live/htp-done
open
(
my
$htp_done
,
"
<
$htp_done_file
")
or
die
"
Can not read file: $!
";
(
my
$htp_done_code
)
=
(
<
$htp_done
>
=~
/^(\d+)/
);
# in case htpdate went fine, close the 'Please wait...' notification
if
(
$htp_done_code
==
0
)
{
$notification
->
close
();
}
# in case htpdate failed, notify the user with the corresponding logs
else
{
open
(
my
$htp_log
,
"
< /var/log/htpdate.log
")
or
die
"
Can not read file: $!
";
my
$last_log
;
while
(
<
$htp_log
>
)
{
if
(
$_
=~
/Running htpdate./
)
{
$last_log
=
'';
next
;
}
$last_log
.=
$_
;
}
my
$failure_summary
=
gettext
("
Failed to synchronize the clock!
");
my
$failure_body
=
$last_log
;
my
$failure_notification
=
$notify
->
create
(
summary
=>
$failure_summary
,
body
=>
$failure_body
,
timeout
=>
0
);
$failure_notification
->
show
();
}
config/chroot_local-includes/usr/local/sbin/htpdate
View file @
cfb7bb43
...
...
@@ -240,6 +240,7 @@ sub adjustDate {
}
my
@urls
=
parseCommandLine
();
message
("
Running htpdate.
");
my
@diffs
=
grep
{
defined
$_
}
map
{
...
...
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