[comp.os.msdos.programmer] Need help installing passsword protection

jdb@reef.cis.ufl.edu (Brian K. W. Hook) (04/27/91)

I want to install a rudimentary password protection program on my computer
system.  It currently resides as the firstline of my AUTOEXEC.BAT file,
unfortunaetly this can be circumvented via repeated hitting of Ctrl-C on
boot up.

What I would like to do is install it as a device driver in my CONFIG.SYS
file.  I have tried, naively, just using:

DEVICE=C:\PASS.EXE

The program works, however, it bombs on exit.

I tried using SHELL=C:\PASS.EXE and then using an execv() call to
COMMAND.COM to start it as the real command interpreter, but that bombs
too.

I am using Turbo C (BC++ 2.00).  If anyone has some pointers, please fling
em my way please.

Brian

uncal@talgras.UUCP (Al Amet) (04/29/91)

In article <28226@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>I want to install a rudimentary password protection program on my computer
>system.  It currently resides as the firstline of my AUTOEXEC.BAT file,
>unfortunaetly this can be circumvented via repeated hitting of Ctrl-C on
>boot up.
 
You can do it quite easily from within your autoexec.bat file, I know because
I have done it.  The password program I created returns a different error 
levels for each user so I can talyor the personality files for games.
The last line at the end of your autoexec.bat should be the name of a 
loop-back file. The loop back file then contains the following lines:

:BEGIN
COMMAND /C CHCKPASS
IF EXIST BADPASS GOTO BEGIN
REN GOODPASS BADPASS

CHCKPASS is a batch file containing the following lines:

PASSWORD
IF ERRORLEVEL 1 REN BADPASS GOODPASS

All that is necessary is that if a valid password is accepted the program 
returns an error level.  BADPASS/GOODPASS is a dummy file that is used as
a semaphore.  If an attempt is made to break out of the password program
the break condition causes the batch file to shell out of command.com back
into the original loop back batch file.  The only other thing is BREAK and
ECHO must be off while attempting this or they can shell out of the loop
back file.
 

anicolao@watcgl.waterloo.edu (Alex Nicolaou) (04/30/91)

In article <71@talgras.UUCP> uncal@talgras.UUCP (Al Amet (Unc Al)) writes:
>In article <28226@uflorida.cis.ufl.EDU> jdb@reef.cis.ufl.edu (Brian K. W. Hook) writes:
>>I want to install a rudimentary password protection program on my computer
> 
>You can do it quite easily from within your autoexec.bat file, I know because

 ** And what does your batch file do to protect against ^C?
Because I'd like to be able to write batch files that avoid that.
Or were you concentrating on the word `rudimentary'?


alex