Commit d8be2b95 authored by Mike Hibler's avatar Mike Hibler
Browse files

Cut the caller some slack when determining if a time is in the future.

parent dd90db5d
...@@ -1168,16 +1168,18 @@ handle_put(int sock, struct sockaddr_in *sip, struct sockaddr_in *cip, ...@@ -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. * They gave us an mtime and it is "bad", return an error.
* XXX somewhat arbitrary: cannot set a time in the future. * 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) { if (mtime) {
struct timeval now; struct timeval now;
gettimeofday(&now, NULL); gettimeofday(&now, NULL);
if (mtime > now.tv_sec) { if (mtime > (now.tv_sec + 10)) {
rv = MS_ERROR_BADMTIME; rv = MS_ERROR_BADMTIME;
FrisWarning("%s: client %s %s failed: " FrisWarning("%s: client %s %s failed: "
"attempt to set mtime in the future", "attempt to set mtime in the future "
imageid, clientip, op); "(%u > %u)\n",
imageid, clientip, op, mtime, now.tv_sec);
msg->body.putreply.error = rv; msg->body.putreply.error = rv;
goto reply; goto reply;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment