Date: Tue, 11 Jan 2000 11:40:03 -0800 (PST) From: Daniel Hagan <dhagan@cs.vt.edu> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/4238 - chpass time delay sensitivity [PATCH] Message-ID: <200001111940.LAA12539@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/4238; it has been noted by GNATS. From: Daniel Hagan <dhagan@cs.vt.edu> To: John Polstra <jdp@polstra.com> Cc: freebsd-gnats-submit@freebsd.org Subject: Re: bin/4238 - chpass time delay sensitivity [PATCH] Date: Tue, 11 Jan 2000 14:29:55 -0500 (EST) Ok, given that the nsec granularity isn't available, would a work-around like this be more appropriate? Daniel Index: edit.c =================================================================== RCS file: /src/cvs/src/usr.bin/chpass/edit.c,v retrieving revision 1.16 diff -r1.16 edit.c 41a42 > #include <sys/time.h> 67a69 > struct timeval temp_time[2]; 69a72,81 > /* > * Avoid race condition when user edits file in under a > * second by back-dating file. > */ > gettimeofday(&(temp_time[0]), NULL); > gettimeofday(&(temp_time[1]), NULL); > temp_time[1].tv_sec--; > if (utimes(tempname, temp_time)) > pw_error(tempname, 1, 1); > -- Daniel Hagan Computer Science CSE dhagan@cs.vt.edu http://www.cs.vt.edu/~dhagan/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001111940.LAA12539>