[comp.lang.pascal] Password Program!

mcdonghj@unix1.tcd.ie (Lizard King....) (05/28/91)

I wrote a small routine to run a pascal program to check for a
password when you log in to a PC, but one can break out by Ctrl
C!
Is there any way of stopping this??
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RSVP:mcdonghj@unix1.tcd.ie        |"Father,Yes Son?,I want to kill you!
                                  |  Mother.....I want to ..f*** you!!"
Lizard King {John mc Donagh}      |        -The Lizard King,1967

caster@jove.cs.pdx.edu (Brad J. Caster) (05/29/91)

In article <mcdonghj.675446470@unix1.tcd.ie> mcdonghj@unix1.tcd.ie (Lizard King....) writes:
>I wrote a small routine to run a pascal program to check for a
>password when you log in to a PC, but one can break out by Ctrl
>C!
>Is there any way of stopping this??
...
A simple solution would be to write an interrupt handler to
check if Ctrl is being pressed.  If it is not, just pass the
input to the regular interrupt handler.  So, you can't use
Ctrl while entering your password.  That shouldn't be a
problem.

If anyone would like to see how this is done, e-mail to me
and I'll get to it tomorrow, then post the solution.

Another thing that can be done is to make the password
program an interrupt handler.  It unloads itself once the
right keys are pressed - otherwise it intercepts all keyboard
input.  Ctrl-C and Ctrl-Break have no effect on this type of
program.

caster@jove.cs.pdx.edu

gt0652b@prism.gatech.EDU (I don't know man, he was just here) (05/29/91)

I don't remember this exactly, but pascal has a break command that 
shuts off control breaking (Not a new kind of dance).

See Ya

Josh Guttman

-- 
***************************************** They are one person,
* Joshua Isaac Guttman	                * They are two alone,
* gt0652b@prism.gatech.edu              * They are three toghther,  
* (404)355-3908 Home/(404)355-0001 Work * They are for eachother. - C.S.N.Y.

tpirnat@wpi.WPI.EDU (Thomas Charles Pirnat) (05/29/91)

  Why not just put :
           CheakBreak:=False;
  as the first few lines of you program.  This has been talked about
  many times in this newsgroup (a candidate for a FAQ listint?).

-Thomas Pirnat-
-- 
  |       o    |  Thomas Pirnat (WPI X5505 or email tpirnat @ wpi.wpi.edu)   |
  |   _  /-+_  |  Chinese Proverb: He who asks is a fool for 5 minutes, but  |
  |  (_) > (_) |                he who does not ask remains a fool forever.  |
  +------------+-------------------------------------------------------------+

greg@athena.cs.uga.edu (Greg Whitlock) (05/30/91)

In article <2753@pdxgate.UUCP> caster@jove.UUCP (Brad J. Caster) writes:
>In article <mcdonghj.675446470@unix1.tcd.ie> mcdonghj@unix1.tcd.ie (Lizard King....) writes:
>>I wrote a small routine to run a pascal program to check for a
>>password when you log in to a PC, but one can break out by Ctrl
>>C!
>>Is there any way of stopping this??
>...
>A simple solution would be to write an interrupt handler to
>check if Ctrl is being pressed.  If it is not, just pass the
>input to the regular interrupt handler.  So, you can't use
>Ctrl while entering your password.  That shouldn't be a
>problem.
>

Do you mean when Ctrl-c is being pressed before or after the program runs?

If your program is started with a batch file then if anyone starts banging
on Ctrl-c when they boot up then they can break the batch file, anyway.


___________________________________________________________________________
Greg Whitlock                          |      
Department of Computer Science         | "Chivalry is not dead...
ACM chairman of UGA                    |  it just got left holding the door."
University of Georgia, Athens          |  
E-mail: greg@athena.cs.uga.edu         |                           -Greg (me)
_______________________________________|___________________________________

caster@titania.cs.pdx.edu (Brad J. Caster) (05/30/91)

In article <1991May29.191859.20733@athena.cs.uga.edu> greg@athena.cs.uga.edu (Greg Whitlock) writes:
>In article <2753@pdxgate.UUCP> caster@jove.UUCP (Brad J. Caster) writes:
>>In article <mcdonghj.675446470@unix1.tcd.ie> mcdonghj@unix1.tcd.ie (Lizard King....) writes:
>>>I wrote a small routine to run a pascal program to check for a
>>>password when you log in to a PC, but one can break out by Ctrl
>>>C!
...
>>A simple solution would be to write an interrupt handler to
...
>Do you mean when Ctrl-c is being pressed before or after the program runs?
>
>If your program is started with a batch file then if anyone starts banging
>on Ctrl-c when they boot up then they can break the batch file, anyway.
...


What if it is run from config.sys?  Can you then break out of it?
Wait.  I'll log out and try it.  I don't think you can.


I'll post a simple solution later, when I get it to work.
(It will work.)

caster@jove.cs.pdx.edu