.title auth_id ID authorization program .ident /V1.07/ .sbttl Documentation ; ; This is the mainline for the AUTH_ID program. The AUTH_ID program ; is a program that allows non-privileged users limited control over ; certain identifiers. For example, a project leader could be given ; the capability to grant and revoke an ID that allows access to the ; project files as people join and/or leave the project. To be able ; to grant and revoke the identifier, he (the project leader) must ; be granted CONTROL of the identifier. In turn, he may also grant ; and revoke control of the identifier to subordinates. ; ; Eric F. Richards ; 6-May-86 ; Gould OSD VAXcluster VAX/VMS V4.3 ; .sbttl Macros, constants, and other stuff $rmsdef ; define RMS messages $ssdef ; define system service messages bufsiz = 256 ; size of get_foreign cmd buffer .enable suppression ; clean up the listing files .disable traceback, debug ; hands off with the debugger .default displacement, word ; program is > 128, < 32767 bytes .sbttl Main Code .psect $code, long, exe, nowrt, pic, shr .entry auth_id, ^m ; entry point, save register(s) subl #bufsiz, sp ; make room for buffer on stack pushl sp ; make a descriptor for said buffer pushl #bufsiz ; ...rest of descriptor movl sp, r3 ; save a pointer to the descr pushl r3 ; call get-foreign to get the cmd line pushl #0 ; don't prompt from within get_foreign pushl r3 ; write the output here calls #3, g^lib$get_foreign ; get the command line blbc r0, last ; on error fubar out tstw (r3) ; null string back? bneq 10$ ; if not, continue on clrl r3 ; else, clear our descriptor movl fp, sp ; reset the stack pointer 10$: calls #0, setup ; open files, set up privs, etc blbc r0, clenup ; on error fubar out pushal prompt ; this is a prompt string pushl s^#prompt_len ; build descr for it pushl sp ; descr goes here... pushal get_input ; this is the arg list for pushal get_input ; DCL_PARSE -- needs input routines, pushal iaf_subcommands ; and command tables, etc pushl r3 ; command line from get_foreign pushl #5 ; 5 args to DCL_PARSE movl sp, r2 ; save pointer to the arg list tstl r3 ; are we using a single command input? beql loop ; if not, skip this stuff bsbb parse ; foreign cmd: parse the command line blbc r0, done ; on error get out bsbb disp ; dispatch to appropriate routine brb clenup ; go to exit handler with error message loop: bsbb parse ; interactive loop: parse input lines cmpl r0, #rms$_eof ; time to go home? beql done ; if so, get out blbc r0, loop ; on error try again bsbb disp ; go to individual routine blbs r0, loop ; on success, keep going pushl r0 ; this is the error code calls #1, putmsg ; signal the error brb loop ; loop around for more... done: movl #ss$_normal, r0 ; set success clenup: pushl r0 ; record error status calls #1, finis ; clean up everything last: ret ; time to go home! parse: callg (r2), g^cli$dcl_parse ; parse the input line rsb ; and return to caller disp: calls #0, g^cli$dispatch ; call the dispatcher rsb ; and return to caller .sbttl Pure data .psect $pdata, noexe, nowrt, pic, shr, long prompt: .ascii /IAF> / ; this is the prompt string prompt_len = . - prompt ; this is its length .end auth_id ; this (!) is the mainline