From:	HENRY::IN%"AWPSYS%ritvax.bitnet%wiscvm.wisc.edu%kl.sri.com%csnet-relay.CSNET%relay.cs.net@RCA.COM" 15-JUN-1987 08:56
To:	INFO-VAX@kl.sri.com
Subj:	How to (properly) use new System services

Here is a program to demo the use of $GETUAI system service.
This program uses the service exactly as documented in
the DOCs.

Points to note:


        1)  many fields in the UAF are counted ascii
        2)  The password is in incripted form. Useless unless you
            want to verify an account password.  (To do this you need
            to enter HPWD.MAR from the fiche.
        3)  You need no priv to read info about your OWN account only.
            You need Grpprv to read about accounts in your Group and
            SYSPRV for all others.

We like these services...The make our life a lot easier.
They obviously need a lot of work to complete them.

        THis demo can be modified to do a SETUAI to change UAF items
        (From Suitably Prived accounts)

*
*
*
        implicit integer(a-z)
*
        include'($uaidef)'
        character*64 lgicmd
        character*(12) username
        character*32 owner

        structure /itmlist_struct/

         union
          map
           integer*2 buff_len              ! length of equiv name
           integer*2 item_code             ! code saying type of Eqiv name
           integer*4 buffaddr              ! address of equiv name
           integer*4 ret_lenadr            ! return addr for actual length
          end map
          map
           integer*4 end_list              ! code to end list
          end map
         end union
        end structure
*
        record /itmlist_struct/ uaflist(5)
        integer dummy
*
        nularg = 0

        call lib$get_input(username,'Enter User: ',l_u)
        uaflist(1).buff_len = 32
        uaflist(1).item_code = UAI$_OWNER
        uaflist(1).buffaddr = %loc(owner)
        uaflist(1).ret_lenadr = %loc(dummy)

        uaflist(2).buff_len = 64
        uaflist(2).item_code = UAI$_LGICMD
        uaflist(2).buffaddr = %loc(lgicmd)
        uaflist(2).ret_lenadr = %loc(dummy)

*
        uaflist(3).end_list = 0

        istat = sys$getuai(,,username(1:l_u),uaflist(1),,,)
        if (.not.istat) call lib$stop(%val(istat))
*
        len_own = ichar(owner(1:1))
        if (len_own.lt.1) then
           owner = ' '
           len_own = 1
        else
          owner = owner(2:len_own+1)
        endif

        len_lgi = ichar(lgicmd(1:1))
        if (len_own.lt.1) then
           lgicmd = ' '
           len_lgi = 1
        else
          lgicmd = lgicmd(2:len_lgi+1)
        endif
        print *,'Owner:   '//owner(:len_own)
        print *,'LGICMD:  '//lgicmd(:len_lgi)
        end
