Aharpo.539
net.bugs.4bsd
utzoo!decvax!harpo!alb
Sat Apr 24 10:55:54 1982
lock bugs and fixes
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 <= <="18;" SEE FOR ANYONE T ANYTHING T++) WITH DOES </PRE WRONG THESE? (T="1;" 16; TO:>
<HR>
This Usenet Oldnews Archive
article may be copied and distributed freely, provided:
<P>
1. There is no money collected for the text(s) of the articles.
<BR>
2. The following notice remains appended to each copy:
<P>
<EM>The Usenet Oldnews Archive: Compilation Copyright&copy 1981, 1996
<BR> Bruce Jones, Henry Spencer, David Wiseman.</EM>
<P>
<HR>
Goto <A HREF="82.04.27_ucbarpa.1236_net.bugs.4bsd.html">NEXT</A> article in NET.bugs.4bsd Newsgroup
<BR>Return to <A HREF="NET.bugs.4bsd-index.html">NET.bugs.4bsd index</A>
<BR>Return to the
       <A HREF="../index.html">Usenet Oldnews Archive index</A>
</HTML>

-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <[email protected]>
of http://communication.ucsd.edu/A-News/


This Usenet Oldnews Archive
article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.