Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
d8be2b95
Commit
d8be2b95
authored
Jul 02, 2014
by
Mike Hibler
Browse files
Cut the caller some slack when determining if a time is in the future.
parent
dd90db5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
clientside/os/frisbee.redux/mserver.c
View file @
d8be2b95
...
...
@@ -1168,16 +1168,18 @@ handle_put(int sock, struct sockaddr_in *sip, struct sockaddr_in *cip,
/*
* They gave us an mtime and it is "bad", return an error.
* XXX somewhat arbitrary: cannot set a time in the future.
* XXX cut them some slack on the future time thing, up to 10s okay.
*/
if
(
mtime
)
{
struct
timeval
now
;
gettimeofday
(
&
now
,
NULL
);
if
(
mtime
>
now
.
tv_sec
)
{
if
(
mtime
>
(
now
.
tv_sec
+
10
)
)
{
rv
=
MS_ERROR_BADMTIME
;
FrisWarning
(
"%s: client %s %s failed: "
"attempt to set mtime in the future"
,
imageid
,
clientip
,
op
);
"attempt to set mtime in the future "
"(%u > %u)
\n
"
,
imageid
,
clientip
,
op
,
mtime
,
now
.
tv_sec
);
msg
->
body
.
putreply
.
error
=
rv
;
goto
reply
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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