current version of FreeBSD, this isn't guarenteed by the API.
Custom security modules, or future implementations of the setuid and
setgid may fail.
Submitted by: Erik Cederstrand
Approved by: cperciva
MFC after: 3 days
This structure is not part of POSIX. According to POSIX, gettimeofday()
has the following prototype:
int gettimeofday(struct timeval *restrict tp, void *restrict tzp);
Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is
not used). Remove dead error handling code. Also use NULL for a
nul-pointer instead of integer 0.
While there, change all pieces of code that only use tv_sec to use
time(3), as this provides less overhead.
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
Also add $FreeBSD$ to a few files to keep svn happy.
Discussed with: imp, rwatson
1. If fgets fails, don't go into an infinite cpu-intensive loop. Instead,
check to see if the terminal still exists, and sleep(1) otherwise.
2. When we check to see if the terminal still exists, make sure we're not
mislead by EINTR. This could have been a security issue, but fortunately
the current implementation of tcgetattr doesn't EINTR.
PR: bin/60758
Approved by: rwatson (mentor)
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.
Reviewed by: md5
don't use spaces at the beginning of a line where tabs are normally
used (the worst thing was that half of this file was right (tabs) and
half was wrong (spaces), making for painful reading).
Reviewed by: /sbin/md5, diff -b
/usr/bin/lock can be used to lock a terminal much like xlock does
for your X-windows session. Problem is, /usr/bin/lock cannot lock
your terminal indefinately. Rather you must specify a timeout
value, after which, your terminal is unlocked and become unsecured.
I have added a ``-n'' no timeout option to /usr/bin/lock
Currently the only way to get this functionality is to use a huge
timeout value and hope it is long enought (in time). This method
also requires you to know the maxium number of minutes you are
allowed to specify.
Submitted by: David E. O'Brien <obrien@Nuxi.cs.ucdavis.edu>