lock bugs and fixes

utzoo!decvax!harpo!alb utzoo!decvax!harpo!alb
Sat Apr 24 10:55:54 AEST 1982


The program lock should disallow locking up a terminal owned by
root, since someone can come along with the master key, unlock
the terminal, and play around to his/her heart's content.  The
fix is very simple:  Before it goes through the for loop for
ignoring signals, add the lines:

	if (getuid() == 0) {
		fprintf(stderr, "you have too many privileges to be locked.\n");
		exit(0);
	}

[Some systems also have special groups of people in /etc/group that
can automatically become root in some way or another.  For these
systems, I have prepared routines that check the real user (as found
in utmp) and then check to see is he/she is in that group.  If he/she
is, it won't lock up either.  Any who wants these should mail me (I'm not
posting them since not everyone needs them.)]

Another problem I found was that with the new tty driver, ^Z effectively
unlocks the terminal, since it puts lock into the background.  Again, the
fix is simple.  Change the line reading:
	for (t = 1; t <= 16; t++)
to:
	for (t = 1; t <= 18; t++)
Does anyone see anything wrong with these?



More information about the Comp.bugs.4bsd.ucb-fixes mailing list