🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: vmsnet.misc
Article #41

Re: How to determin a rightsidentifier in FORTRAN?

#41
From: William Brennessel
Date: Wed, 29 Jul 1992 05:21
80 lines
3170 bytes
In article <1992Jul28.231632.16827@wega.rz.uni-ulm.de>, ORAKEL@rzmain.rz.uni-ulm.de (Framstag) writes...
>I want to check in a FORTRAN program the existens of a VMS rights
>identifier, which are listed as "Process rights" in SHOW PROCESS/PRIV.
> 
>A simple example would be fine ... or a hint where to look in which fine
>manual :-)
> 
>thanx - Ulli

Since this is not the first time someone has asked, I will post a FORTRAN
function that performs this operation.

The following is a logical function that will return true if a user
possesses a specific rights identifier.

As far as I know these item codes are not in the manual...

Thanks,
Bill

-------------------------------------CUT HERE-----------------------------------

* This function returns true if a person has the identifier passed in
* set in his/her process rightslist.

      logical *4 function id_set (ident)
      implicit none

* Parameter lsize set to 512 will allow for the first 256 (approximately)
* identifiers of a process.  Should a user have more than 256 identifiers
* set, then this number should be increased.

      parameter lsize = 512
      character *(*) ident
      character *31 name
      integer *4 status,rights_size,rights_len,sys$getjpi,i,context
      integer *4 rights(lsize),name_dsc(2)/31,0/,sys$idtoasc,length
      structure /item_list_3/
        union
          map
            integer *2 buf_len,it_code
            integer *4 buf_adr,ret_len
          end map
          map
            integer *4 end,%fill
          end map
        end union
      end structure
      record /item_list_3/ list(2)

      list(1).buf_len = 16
* Parameter JPI$_RIGHTS_SIZE (value 817) is not currently in FORSYSDEF.TLB.
      list(1).it_code = 817
      list(1).buf_adr = %loc(rights_size)
      list(1).ret_len = 0
      list(2).end = 0
      status = sys$getjpi(,,,list,,,)
      if (.not.status) call lib$signal(%val(status))

      list(1).buf_len = rights_size
* Parameter JPI$_PROCESS_RIGHTS (value 814) is not currently in FORSYSDEF.TLB.
      list(1).it_code = 814
      list(1).buf_adr = %loc(rights)
      list(1).ret_len = %loc(rights_len)
      list(2).end = 0
      status = sys$getjpi(,,,list,,,)
      if (.not.status) call lib$signal(%val(status))

      name_dsc(2) = %loc(name)
      id_set = .false.
      context = 0

      do i = 1,lsize
        status = sys$idtoasc(%val(rights(i)),length,name_dsc,,,context)
        if (name.eq.ident) id_set = .true.
      enddo

      end

-----------------------------------END OF CUT-----------------------------------
Technical Details
Message-ID: <Bs4urI.Lnu@acsu.buffalo.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!ub!acsu.buffalo.edu!ubvmsb.cc.buffalo.edu!masmummy
References: <1992Jul28.231632.16827@wega.rz.uni-ulm.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!ub!acsu.buffalo.edu!ubvmsb.cc.buffalo.edu!masmummy
From: masmummy@ubvmsb.cc.buffalo.edu (William Brennessel)
Newsgroups: vmsnet.misc
Subject: Re: How to determin a rightsidentifier in FORTRAN?
Message-ID: <Bs4urI.Lnu@acsu.buffalo.edu>
Date: 29 Jul 92 05:21:00 GMT
References: <1992Jul28.231632.16827@wega.rz.uni-ulm.de>
Sender: nntp@acsu.buffalo.edu
Organization: University at Buffalo
Lines: 80
News-Software: VAX/VMS VNEWS 1.41
Nntp-Posting-Host: ubvmsb.cc.buffalo.edu