udhcpd: add code which rejects lease files with suspicious or old timestamp.

*: s/time(0)/time(NULL)/g
This commit is contained in:
Denis Vlasenko
2009-02-02 10:48:06 +00:00
parent 512c8ae053
commit 04158e0459
11 changed files with 45 additions and 43 deletions

View File

@ -273,7 +273,7 @@ int blkid_probe_all(blkid_cache cache)
return -BLKID_ERR_PARAM;
if (cache->bic_flags & BLKID_BIC_FL_PROBED &&
time(0) - cache->bic_time < BLKID_PROBE_INTERVAL)
time(NULL) - cache->bic_time < BLKID_PROBE_INTERVAL)
return 0;
blkid_read_cache(cache);
@ -335,7 +335,7 @@ int blkid_probe_all(blkid_cache cache)
fclose(proc);
cache->bic_time = time(0);
cache->bic_time = time(NULL);
cache->bic_flags |= BLKID_BIC_FL_PROBED;
blkid_flush_cache(cache);
return 0;