Fix files utility not to set timestamps

Commit f33b96b1 (v4.3.12) made files again set timestamps.  That was
intentionally suppressed in commit 990eb46b (v4.3.10), because it
facilitates attacks against the PRNG.  Commit 8f98e53a (v4.3.0) had
added it as a feature.

Fix by making files's main() pass new flag EFF_NOTIME to ef_open().
Implement the flag in do_write().
This commit is contained in:
Markus Armbruster 2008-05-17 19:35:22 +02:00
parent 2a125c5463
commit 967122ae0b
3 changed files with 7 additions and 4 deletions

View file

@ -369,7 +369,7 @@ do_write(struct empfile *ep, void *buf, int id, int count)
return -1;
if (ep->flags & EFF_TYPED) {
now = time(NULL);
now = ep->flags & EFF_NOTIME ? (time_t)-1 : time(NULL);
for (i = 0; i < count; i++) {
/*
* TODO Oopses here could be due to bad data corruption.
@ -380,7 +380,8 @@ do_write(struct empfile *ep, void *buf, int id, int count)
elt->ef_type = ep->uid;
if (CANT_HAPPEN(elt->uid != id + i))
elt->uid = id + i;
elt->timestamp = now;
if (now != (time_t)-1)
elt->timestamp = now;
}
}