Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
34b5d194
Commit
34b5d194
authored
Jul 27, 2015
by
Kevin Darbyshire-Bryant
Committed by
Simon Kelley
Jul 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update DNSSEC timestamp file on process TERM.
parent
d6cb7e48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
src/dnsmasq.c
src/dnsmasq.c
+9
-0
src/dnsmasq.h
src/dnsmasq.h
+1
-0
src/dnssec.c
src/dnssec.c
+5
-6
No files found.
src/dnsmasq.c
View file @
34b5d194
...
@@ -1321,6 +1321,15 @@ static void async_event(int pipe, time_t now)
...
@@ -1321,6 +1321,15 @@ static void async_event(int pipe, time_t now)
if
(
daemon
->
lease_stream
)
if
(
daemon
->
lease_stream
)
fclose
(
daemon
->
lease_stream
);
fclose
(
daemon
->
lease_stream
);
#ifdef HAVE_DNSSEC
/* update timestamp file on TERM if time is considered valid */
if
(
daemon
->
back_to_the_future
)
{
if
(
utime
(
daemon
->
timestamp_file
,
NULL
)
==
-
1
)
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
}
#endif
if
(
daemon
->
runfile
)
if
(
daemon
->
runfile
)
unlink
(
daemon
->
runfile
);
unlink
(
daemon
->
runfile
);
...
...
src/dnsmasq.h
View file @
34b5d194
...
@@ -992,6 +992,7 @@ extern struct daemon {
...
@@ -992,6 +992,7 @@ extern struct daemon {
#endif
#endif
#ifdef HAVE_DNSSEC
#ifdef HAVE_DNSSEC
struct
ds_config
*
ds
;
struct
ds_config
*
ds
;
int
back_to_the_future
;
char
*
timestamp_file
;
char
*
timestamp_file
;
#endif
#endif
...
...
src/dnssec.c
View file @
34b5d194
...
@@ -427,13 +427,12 @@ static int serial_compare_32(unsigned long s1, unsigned long s2)
...
@@ -427,13 +427,12 @@ static int serial_compare_32(unsigned long s1, unsigned long s2)
*/
*/
static
time_t
timestamp_time
;
static
time_t
timestamp_time
;
static
int
back_to_the_future
;
int
setup_timestamp
(
void
)
int
setup_timestamp
(
void
)
{
{
struct
stat
statbuf
;
struct
stat
statbuf
;
back_to_the_future
=
0
;
daemon
->
back_to_the_future
=
0
;
if
(
!
daemon
->
timestamp_file
)
if
(
!
daemon
->
timestamp_file
)
return
0
;
return
0
;
...
@@ -447,7 +446,7 @@ int setup_timestamp(void)
...
@@ -447,7 +446,7 @@ int setup_timestamp(void)
/* time already OK, update timestamp, and do key checking from the start. */
/* time already OK, update timestamp, and do key checking from the start. */
if
(
utime
(
daemon
->
timestamp_file
,
NULL
)
==
-
1
)
if
(
utime
(
daemon
->
timestamp_file
,
NULL
)
==
-
1
)
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
back_to_the_future
=
1
;
daemon
->
back_to_the_future
=
1
;
return
0
;
return
0
;
}
}
return
1
;
return
1
;
...
@@ -487,17 +486,17 @@ static int check_date_range(unsigned long date_start, unsigned long date_end)
...
@@ -487,17 +486,17 @@ static int check_date_range(unsigned long date_start, unsigned long date_end)
and start checking keys */
and start checking keys */
if
(
daemon
->
timestamp_file
)
if
(
daemon
->
timestamp_file
)
{
{
if
(
back_to_the_future
==
0
&&
difftime
(
timestamp_time
,
curtime
)
<=
0
)
if
(
daemon
->
back_to_the_future
==
0
&&
difftime
(
timestamp_time
,
curtime
)
<=
0
)
{
{
if
(
utime
(
daemon
->
timestamp_file
,
NULL
)
!=
0
)
if
(
utime
(
daemon
->
timestamp_file
,
NULL
)
!=
0
)
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
my_syslog
(
LOG_ERR
,
_
(
"failed to update mtime on %s: %s"
),
daemon
->
timestamp_file
,
strerror
(
errno
));
back_to_the_future
=
1
;
daemon
->
back_to_the_future
=
1
;
set_option_bool
(
OPT_DNSSEC_TIME
);
set_option_bool
(
OPT_DNSSEC_TIME
);
queue_event
(
EVENT_RELOAD
);
/* purge cache */
queue_event
(
EVENT_RELOAD
);
/* purge cache */
}
}
if
(
back_to_the_future
==
0
)
if
(
daemon
->
back_to_the_future
==
0
)
return
1
;
return
1
;
}
}
else
if
(
option_bool
(
OPT_DNSSEC_TIME
))
else
if
(
option_bool
(
OPT_DNSSEC_TIME
))
...
...
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