[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

629.0. "Account add procedure" by ENOUGH::HEAFEY () Mon Dec 14 1987 13:27

	Hi all,
	I'm in the process of writing an account add procedure ( OH NO!!,
	you say. Not another one!). The way I check for existing UIC's
	is to execute a MCR AUTHORIZE SHOW [group,member] and check for
	a successful $status. I would like to be able to open SYSUAF.DAT
	shared but, I can't quite figure out in what format UIC's are
	stored in SYSUAF.DAT. Any ideas?

	Thanks in advance,
	Dave H.
T.RTitleUserPersonal
Name
DateLines
629.1BMT::MISRAHIat the tone, please leave your ...Mon Dec 14 1987 13:321
    Hopefully using GETUAI calls .
629.2ClarificationENOUGH::HEAFEYMon Dec 14 1987 14:155
	I should have specified in the topic note that I'm writing
	this procedure in DCL. Sorry for the lack of info.

	Dave H.
	
629.3STAR::PIPERDerrell Piper - VAX/VMS DevelopmentMon Dec 14 1987 17:2819
    The UAF has four keys of which only 2 are currently used.  The first
    key is the 32 character space filled username. The second key is the
    longword binary UIC.  For example, the UIC [11,636] would be stored as
    %X0009019E (remember that UICs are in octal). 

    But what does this have to do with opening the UAF shared?

    If you want to open the UAF from DCL, you can do something like this:

	$ SET PROC/PRIV=SYSPRV
    	$ OPEN/SHARE=WRITE/READ/WRITE UAF SYS$SYSTEM:SYSUAF.DAT
	$ READ/KEY="PIPER"/INDEX=0 UAF RECORD


    But you can't access the UIC from DCL because DCL can't deal with
    binary keys.

    Your best bet is to use $GETUAI/$SETUAI in an image.  It'll be faster
    and it won't break if we reformat the UAF in the future. 
629.4read/index=1 sysuafFROST::W_PIPERbill piperMon Dec 14 1987 18:3519
    re: .3
    
>>> But you can't access the UIC from DCL because DCL can't deal with
>>> binary keys.
    
    Sure it can.  Like so (assuming Username = Identifier)

$ uic = f$identifier (f$getjpi(0,"Username"), "Name_to_Number")
$ key[0,32] = uic
$
$ Open /Read /Share=Write uaf Sys$System:SysUAF.dat
$ Read /err=99 uaf record /key=&key /index=1
$ User = f$edit (f$extract(4,32,record), "Trim")
$ Show Symbol User
$ 99:
$ close uaf
$ exit

    -piper
629.5STAR::PIPERDerrell Piper - VAX/VMS DevelopmentTue Dec 15 1987 10:141
    Neat!  Finally a real use for the "&" operator...
629.6"&" is buggy!USHS01::BLANDOReality, what a concept!Wed Dec 16 1987 23:167
    Actually, there would be many uses for the "&".  I found one not
    too long ago, but found a "glitch/feature" in that the CALL statement
    and the "@" procedure invocation ignore it.  I submited an SPR,
    and was told to use the "'".  Which did not help since I needed
    the delaid translation of the "&" after "'".
    
    FJBlando