Previous Topic: LOCAL Command PrefixNext Topic: MACLOAD Command


LOCK Command

Use the LOCK command to lock a USER or IDENTITY directory entry, a directory profile, or a CMS file.

LOCK {"Parms"} [("Options"]

Parms:
  FILE filename filetype filemode
| PROFILE profilename
| USERID userid

Options:
[FILE [filename ]]
[MSG | NOMSG]
[STACK [FIFO | LIFO]]
[FIFO]
[LIFO]

Note: Options can be entered in any order.

Definitions

FILE filename filetype filemode

Specifies the file to lock. Pattern-matching is not allowed in the file specification.

PROFILE profilename

Specifies the directory profile to lock.

USER userid

Specifies the user ID of the directory entry to lock.

[FILE [ filename]]
[MSG | NOMSG]
[STACK [FIFO | LIFO]
[FIFO]
[LIFO]

These options are explained in Common API Command Options.

Description

The LOCK command prevents updates to a user ID, directory profile, or CMS file. No one can update a locked item until you or another authorized user ID unlocks it using the UNLOCK command.

The LOCK command creates two permanent locks for each user ID, directory profile, or CMS file that you lock and writes them to a CMS file called PERMLOCK FILE A on the CA VM:Director A-disk. For user IDs and directory profiles, the locks have the following form:

SHARED DISK filename filetype filemode
PRIVATE LOCKUSER userid 
PRIVATE LOCKUSER profilename

For CMS files, the form is as follows:

SHARED DISK filename filetype filemode
PRIVATE LOCKFILE filename filetype filemode

The LOCK command creates permanent locks that are maintained across CA VM:Director initializations. Other commands that manipulate user ID or profile entries create temporary locks that are not written to any file and do not last beyond the duration of the command.

CA VM:Director removes entries from the PERMLOCK FILE A file when you clear the lock. If this file exists at initialization, CA VM:Director reads it to re-establish any previously existing permanent locks.

When processing a user or profile entry, the LOCK and UNLOCK commands use the same internal locks as the GETENTRY and REPENTRY commands. Thus, you cannot distinguish between the locks from the LOCK command and the locks from those commands. Do not use the GETENTRY command with the NOLOCK option and lock it later with the LOCK command. The user ID may have been updated in the meantime.

Return Codes and Error Messages

The following table lists the return codes and error messages for the LOCK command.

Return Code

Message Number

Text

1

0127E

USER userid1 EXCEEDED USER userid2 type PASSWORD LIMIT

2

0038E

MISSING PARAMETER

3

0531E

PARAMETER parameter IS TOO LONG

4

0643E

EXTRA PARAMETERS parameters WERE ENTERED AND ARE NOT ALLOWED

10

0039E

INVALID PARAMETER parameter

11

0265E

NOT AUTHORIZED FOR: authorization words

12

0349E

PASSWORD IS INCORRECT

13

0018E

INVALID OPTION option

14

0080E

USER userid DOES NOT EXIST

15

0680E

{ USERID | PROFILE } entryid IS ALREADY LOCKED BY userid

16

0364E

FILE filename filetype filemode IS BEING UPDATED

17

0687E

YOU MUST USE LOCK USER OR LOCK PROFILE TO LOCK A USERID OR PROFILE

18

0682E

FILE filename filetype filemode HAS ALREADY BEEN LOCKED BY userid

19

0270W

PROFILE profid DOES NOT EXIST

20

0038E

MISSING PARAMETER

28

0681E

FILE filename filetype filemode DOES NOT EXIST

Note: