[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

459.0. "dcinput rejection key..." by CHFV03::DITTMERG () Fri May 01 1987 17:11

    HEY GANG,
    
    	i am interested in getting a dcl program to do the following...
    
    at the prompt, want it to disreguard input unless a character 
    
    string is input.  for instance, 
    
    
    			$ xyz sho users
   				this whould show the users on the system
    			$ sho users
    				this would give an error messa stating
    				incorrect inp.  also, i would like to
    				be able to write a special error message
    				like " that line is incorrect "
    
    the key would be that the keyboard input would be rejected if the
    " xyz " was not input..
    
    
    
    				any ideas appreciated
    
    
    				grant dittmer...
T.RTitleUserPersonal
Name
DateLines
459.1Just loop endlessly...KALLON::EIRIKURFri May 01 1987 19:2641
    I thought about this a while back when I was thinking of customizing
    my command environment.
    
    I suggest that you read the input line yourself, validate your "xyz"
    prefix, (giving the error if needbe) and then pass the string to DCL
    with your prefix stripped off.  You should probably point the user mode
    logical for sys$input to sys$command, ($ DEF/USER sys$input
    sys$command) because programs with otherwise assume that the command
    file is going to provide the input.  In practice this doesn't seem
    necessary. 
    
    You should be able to do everything in a loop, with $ SET NOCONTROL=Y
    in effect so that the DCL loop won't abort if the user aborts a
    program.
    
    $ set nocontrol=y
    $ loop:
    $ inquire/nopunctuation my_cmd_line "$ "
    $ ! do your parsing here, and report error
    $ ! goto loop if error
    $ 'parsed_cmd_line'
    $ goto loop
    
    Here's a tiny working example:
    
$ set nocontrol=y
$ loop:
$ inquire/nopun a "> "
$ if a .eqs. "EXIT" then goto the_exit
$ def/user sys$input sys$command
$ 'a'
$ goto loop
$ the_exit:
$ set control=y
$ exit
    
    
    What are you really trying to do with this prefix validation?
    
        Eirikur
    
459.2DCL != secure environmentANGORA::ZARLENGAWatch for 'Beverly Hills Buntz'!Fri May 01 1987 20:346
    	I hope this isn't supposed to be secure!!
    
    	If so, you'd better look through notes from about 6 - 12
    months ago.  Especially look for the string f$pid("goto").
    
    -mike
459.3this just answers .0's needSARAH::EIRIKURFri May 01 1987 21:278
    Yes, this solution is not at all secure.  It only provides a means
    of accomplishing exactly what was asked for in the base note, which
    was requiring the use of a prefix on DCL commands.  It could be
    made more secure by plugging all the loopholes pointed to by .2
    
    
    	Eirikur
    
459.4forget security...CHFV03::DITTMERGSun May 03 1987 00:2710
    the reason that i asked will probably seem funny, but security
    doesn't have anything to do with it.  i am teaching a young 
    nephew to do things with the system, and i want him to type 
    please before each line. example: " please show users " i want 
    to work fine, and " show users " not to work...
    
    			thanks  
    					
    
    			grant...
459.52B::ZAHAREEMichael W. ZahareeMon Jun 01 1987 03:013
    Why?
    
    - M