HP3000-L Archives

March 2002, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"VANCE,JEFF (HP-Cupertino,ex1)" <[log in to unmask]>
Reply To:
VANCE,JEFF (HP-Cupertino,ex1)
Date:
Mon, 11 Mar 2002 01:04:27 -0500
Content-Type:
multipart/mixed
Parts/Attachments:
text/plain (1633 bytes) , chkudc.txt (5 kB)
Long ago Dovid asked:

> From: Dovid Samber [mailto:[log in to unmask]]
> Sent: Thursday, January 24, 2002 6:24 AM
>
> How does one determine (in an easy and straightforward way)
>
> 1.the logon UDC file for every user for  an account.
> 2. the user name for every active UDC file for an account.

And I think he might not have been the only customer asking
this question, so attached is a text (.txt) file that contains
a script that I hope answers Davod's questions.

Here is some sample output:

:chkudc @.vance
 UserName           FileName                    Level   LogonCmd
 -----------------  --------------------------  ------  ----------------
 JEFF.VANCE         UDC.PUB.VANCE               USER    LOGON
                    SYS41801.UDC.SYS            SYSTEM  LOGONUDC
                    HPPXUDC.PUB.SYS             SYSTEM

 MGR.VANCE          SYS41801.UDC.SYS            SYSTEM  LOGONUDC
                    HPPXUDC.PUB.SYS             SYSTEM

 USER1.VANCE        SYS41801.UDC.SYS            SYSTEM  LOGONUDC
                    HPPXUDC.PUB.SYS             SYSTEM

:chkudc @.sup@
 UserName           FileName                    Level   LogonCmd
 -----------------  --------------------------  ------  ----------------
 FIELD.SUPPORT      BUILDUDC.MITBLD.SUPPORT     ACCT
                    SYS41801.UDC.SYS            SYSTEM  LOGONUDC
                    HPPXUDC.PUB.SYS             SYSTEM

 MANAGER.SUPPORT    BUILDUDC.MITBLD.SUPPORT     ACCT
                    SYS41801.UDC.SYS            SYSTEM  LOGONUDC
                    HPPXUDC.PUB.SYS             SYSTEM
  ...


If anyone finds this useful I'd be happy to place the script on
Jazz.

 Jeff Vance, CSY




PARM [log in to unmask], entry=main # Version A.01 # This script determines the logon UDCs for each user in "useracct". Logon # UDCs can occur at the user, account and system levels. This script also # reports which UDC files are cataloged by "useracct". # # The "useracct" parameter can be wildcarded for both user and acct names. # if '!entry' = 'main' then    setvar _cu_ua ups("!useracct")    setvar _cu_levels "USER ACCT SYSTEM"    # qualify user.acct    if pos('.',_cu_ua) = 0 then       setvar _cu_ua _cu_ua + "." + hpaccount    endif    # see if user.acct exists    setvar hpcierr 0    continue    listuser !_cu_ua;format=brief >chkudclu    if hpcierr <> 0 then       print chkudclu       escape    endif    # write header    echo UserName FileName Level LogonCmd    echo ----------------- -------------------------- ------ ----------------    # process the output of the above :listuser command    xeq !hpfile !_cu_ua entry=read_listuser <chkudclu    #deletevar _cu_@    return elseif '!entry' = 'read_listuser' then    # input redirected from the output of :listuser;format=brief    #    setvar _cu_eof_lu finfo(hpstdin,'eof')    # read each record in input file    while setvar(_cu_eof_lu,_cu_eof_lu-1) >= 0 do       # read the user.acct name       setvar _cu_ua rtrim(input())       # show the UDCs cataloged for this user.acct       setvar hpcierr 0       continue       showcatalog user=!_cu_ua >chkudcsc       if hpcierr <> 0 then          print chkudcsc          escape       endif       # process the showcatalog output for this user.acct       xeq !hpfile !_cu_ua entry=read_showcat <chkudcsc       echo    endwhile    return elseif '!entry' = 'read_showcat' then    # Input has been redirected from the output of :showcatalog user=usr.acct    #    # :showcatalog output always ends in a blank(empty) record.    #    setvar _cu_indx 0    while setvar(_cu_indx,_cu_indx+1) <= 3 do       setvar _cu_lev word(_cu_levels,,_cu_indx)       setvar _cu_logon_seen false       setvar _cu_first true       # skip the header record       input _cu_f       # now process all UDC files at this level       while setvar(_cu_f,ltrim(rtrim(input()))) <> "" do          if lft(_cu_f,3) <> "NO " then             # at least 1 UDC file is cataloged at this level             # delete trailing nul in filename, thanks to :showcatalog             setvar _cu_f setvar(_cu_ftmp,lft(_cu_f,len(_cu_f)-1))             setvar _cu_logon_name ""             if not _cu_logon_seen then                # prepare to read this UDC file looking for 1st option logon udc                # verify that user has read access to udc file                setvar hpcierr 0                setvar _cu_haveR false                continue                listfile !_cu_f,4 >chkudclf                if hpcierr = 0 then                   # verify read access                   print chkudclf;start=-1 >chkudcR                   # read in the last record: "FOR USER.ACCT: bla, blah, blaah"                   input _cu_rec <chkudcR                   setvar _cu_haveR (pos('READ',word(_cu_rec,":",-1)) > 0)                endif                if _cu_haveR then                   # get the lockword, if any                   setvar _cu_lkwd ""                   setvar hpcierr 0                   setvar hpmsgfence 2                   continue                   setvar _cu_lkwd finfo(_cu_f,'lockword')                   setvar hpmsgfence 0                   if hpcierr = 0 and _cu_lkwd <> "" then                      # add lockword to qualified MPE filename                      setvar _cu_ftmp word(_cu_f,'.')+"/" + _cu_lkwd + "." + &                                      xword(_cu_f,'.')                   elseif hpcierr <> 0 then                      # can't get lockword, but there might not be a lockword!                      setvar hpcierr 0                      continue                      print !_cu_f;end=1 >$null                   endif                   # look for first logon UDC in this file                   if hpcierr = 0 then                      xeq !hpfile _cu_logon_seen entry=read_UDC_file <!_cu_ftmp                   else                      setvar _cu_logon_name "(no access)"                   endif                endif             endif             # write username, filename, level and logon UDC name (if any)             echo !_cu_ua ![rpt(" ",17-len(_cu_ua))] !_cu_f &                   ![rpt(" ",26-len(_cu_f))] !_cu_lev &                   ![rpt(" ",6-len(_cu_lev))] !_cu_logon_name             if _cu_first then                # only display user.acct name once per user                setvar _cu_first false                setvar _cu_ua ""             endif          endif       endwhile    endwhile    return elseif '!entry' = 'read_UDC_file' then    # Input redirected to a UDC file. Parm-1 is the name of the variable to    # indicating if an OPTION LOGON UDC command is present in this UDC file.    #    setvar _cu_eof_f finfo(hpstdin,'eof')    while setvar(_cu_eof_f,_cu_eof_f-1) >= 0 do       # read the UDC command and parm line(s)       setvar _cu_rec ups(ltrim(rtrim(input())))       # concatenate input records       while rht(_cu_rec,1) = '&' do          setvar _cu_eof_f _cu_eof_f - 1          setvar _cu_rec _cu_rec + ups(ltrim(rtrim(input())))       endwhile       # save the UDC command name and read next record       # (there are no UDC options on the command line)       setvar _cu_cmd, word(_cu_rec)       # read the rest of this UDC looking for OPTION LOGON       while setvar(_cu_eof_f,_cu_eof_f-1) >= 0 and lft(_cu_rec,1) <> '*' do          setvar _cu_rec ups(ltrim(rtrim(input())))          # concatenate input records          while rht(_cu_rec,1) = '&' do             setvar _cu_eof_f _cu_eof_f - 1             setvar _cu_rec _cu_rec + ups(ltrim(rtrim(input())))          endwhile          if word(_cu_rec) = "OPTION" and &             pos('LOGON',_cu_rec) > 0 and pos('NOLOGON',_cu_rec) = 0 then             setvar !useracct true             setvar _cu_logon_name _cu_cmd             return          endif       endwhile    endwhile    return endif 

ATOM RSS1 RSS2