Download PDF Vol. I
Transcript
Lexical Functions
F$SETPRV
Process rights:
INTERACTIVE
LOCAL
System rights:
SYS$NODE_TOKNOW
$ NEWPRIVS = F$SETPRV(NEWPRIVS)
$ SHOW PROCESS/PRIVILEGE
05-JUN-2001 16:05:07.23
Process privileges:
OPER
RTA1:
User: JERROM
operator privilege
Process rights identifiers:
INTERACTIVE
LOCAL
In this example, the DCL command SHOW PROCESS/PRIVILEGE is used
to determine the current process privileges. Note that the process has no
privileges enabled.
The F$SETPRV function is then used to process the ALL keyword and enable
all privileges recording the previous state of each privilege in the symbol
NEWPRIVS. Next, F$SETPRV processes the NOOPER keyword and disables
the OPER (operator) privilege, recording the previous state of OPER in
NEWPRIVS. Note that the OPER privilege appears in the returned string
twice: first as NOOPER and then as OPER.
Entering the command SHOW PROCESS/PRIVILEGE now shows that the
current process has all privileges enabled except OPER.
If the returned string is used as the parameter to F$SETPRV, the process
has the OPER privilege enabled. This occurs because the OPER command
was present twice in the symbol NEWPRIVS. As a result, F$SETPRV looked
at the first keyword NOOPER and disabled the privilege. Finally, after
processing several other keywords in the NEWPRIVS string, the OPER
keyword is presented, allowing F$SETPRV to enable the OPER privilege.
If you are using the ALL or NOALL keywords to save your current privilege
environment, HP recommends that you perform the following procedure to
modify the process for a command procedure:
$ CURRENT_PRIVS = F$SETPRV("ALL")
$ TEMP = F$SETPRV("NOOPER")
If you use this procedure, you can then specify the following command
statement at the end of your command procedure so that the original privilege
environment is restored:
$ TEMP = F$SETPRV(CURRENT_PRIVS)
3.
$ SAVPRIV = F$SETPRV("NOGROUP")
$ SHOW SYMBOL SAVPRIV
SAVPRIV = "GROUP"
$ TEST = F$PRIVILEGE("GROUP")
$ SHOW SYMBOL TEST
TEST = "TRUE"
In this example, the process is not authorized to change the GROUP privilege;
however, the F$SETPRV function still returns the current setting for the
GROUP privilege.
DCLI–433
Related documents
HP OpenVMS DCL Dictionary - Hewlett Packard Enterprise Support
HP OpenVMS DCL Dictionary: A–M - Hewlett Packard Enterprise
OpenVMS DCL Dictionary: A–M
PDF Part I
OpenVMS DCL Dictionary: N–Z
HP OpenVMS DCL Dictionary: N–Z - Hewlett Packard Enterprise
PDF Vol. II
CHARON-VAX / Linux for Hobbyists
OpenVMS User`s Manual - Living Computer Museum
OpenVMS System Services Reference Manual: GETUTC–Z
Indy User`s Manual
OpenVMS System Messages and Recovery Procedures