Directory structures do not apply to tape volumes. However, you can use the DIRECTORY command to search for files on tape volumes. Section 9.5 describes how to access tape files for read and write operations and also explains the use of the DIRECTORY command for tapes.
The DCL command SHOW PROTECTION displays the current process default protection. This protection is applied to files created during your terminal session or to batch jobs, where defaults from directories or previously existing versions are not available.
Note
To use the SHOW PROTECTION command to display the default protection of magnetic tapes, you must specify the /PROTECTION qualifier with the INITIALIZE command when you initialize the magnetic tape volume. Otherwise, the protection is not written to the magnetic tape volume. See the description of initializing magnetic tape volumes in Section 8.3.
The next example illustrates how you can use the SHOW PROTECTION command to display the default protection characteristics for disk files.
Example
$ SHOW PROTECTION SYSTEM=RWED, OWNER=RWED, GROUP=RE, WORLD=NO ACCESS
In this example, the SHOW PROTECTION command requests a display of the current protection defaults.
Each file on a disk has its own protection code, which is distinct from the protection that applies to the disk volume itself. Files residing on disk volumes have the access types shown in Table 9-2.
If you do not define a protection code for a file when you create it, the system applies default protection. If a version of the file already exists, protection is taken from the previous version.
For a new file, the system determines protection in two major ways:
For disk volumes, each file on the volume can have a different protection associated with it. The SET SECURITY/PROTECTION command and other file-manipulating commands allow you to define the protection for individual files.
Note
To protect a file completely, you must protect both the file itself and the directory that lists the file. To protect a file against unauthorized access, specify the proper protection both for the directory that lists the file and for the file itself. See Section 9.3.4 for instructions on protecting directories.
The following sections explain how to perform these tasks:
Task | Section |
---|---|
Set default disk file protection | Section 9.3.3.1 |
Set explicit disk file protection | Section 9.3.3.2 |
Modify disk file protection characteristics | Section 9.3.3.3 |
A new file receives default UIC-based protection and the default access control entries (ACEs), if any, of its parent directory. A new version of an existing file receives the UIC-based protection and ACL of the previous version.
The protection of a renamed file is unchanged unless you use the RENAME/INHERIT command.
How to Change Default UIC Protection
The operating system provides each process with a default UIC-based protection of (S:RWED,O:RWED,G:RE,W). To change the default protection that is applied to files created by that process, enter the SET PROTECTION/DEFAULT command using the following format:
SET PROTECTION[=(code)]/DEFAULT
where:
code | Defines the protection to be applied to the specified files. If you omit the code, the access is set to the current default protection. |
For example, if you place the following command in your login command procedure, you grant all processes read and execute access to any files that you subsequently create:
$ SET PROTECTION = (S:RWED,O:RWED,G:RE,W:RE)/DEFAULT(Remember that you must execute the login command procedure for this command to take effect.)
You can explicitly specify UIC-based protection for a new file with the /PROTECTION qualifier (valid with the BACKUP, COPY, RENAME, and CREATE commands), as shown in the following command line:
$ CREATE MAST12.TXT/PROTECTION=(S:RWED,O:RWED,G,W)
After a file is created and you have created an ACL for the file, you can modify the ACL and add as many ACEs to the ACL as you want. The protection specified by the ACL overrides the UIC protection of the file.
Following are examples showing how to check and specify protection codes.
Examples
$ SHOW PROTECTION SYSTEM=RWED, OWNER=RWED, GROUP=RE, WORLD=NO ACCESS
$ SHOW SECURITY IMAGES.DIR DBA1:[SADAMS]IMAGES.DIR;1 object of class FILE Owner: [SAM,SADAMS] Protection: (System: RWE, Owner: RWE, Group: RE, World: E) Access Control List: (IDENTIFIER=[SAM,SADAMS],ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL)
$ DIRECTORY/SECURITY IMAGES.DIR Directory DBA1:[SADAMS] IMAGES.DIR;1 [VMS,SADAMS] (RWE,RWE,RE,E) (IDENTIFIER=[VMS,SADAMS],ACCESS=READ+WRITE+EXECUTE+DELETE+CONTROL) Total of 1 file.
$ COPY/PROTECTION=(SYSTEM:RW,OWNER:RWED,GROUP:RW,WORLD) ABC.DAT XYZ.DAT
$ SET SECURITY/PROTECTION=(SYSTEM:RWE,OWNER:RWED,GROUP:RE,WORLD) ABC.DAT
Table 9-3 shows the DCL commands that you can use to establish and modify the protection characteristics of files.
Command | Description | For More Information |
---|---|---|
SET DIRECTORY | Modifies the characteristics of one or more directories. The directory protection can override the protection of individual files within the directory. | See Section 9.3.4. |
SET FILE | Modifies the characteristics of one or more files, including the version limits on files. | See Section 9.3.3.3.2. |
SET PROTECTION/DEFAULT | Sets the default UIC protection on files. | See the OpenVMS Guide to System Security. |
SET SECURITY |
Modifies the security profile of an object. Such a profile contains the
following characteristics:
|
See the OpenVMS Guide to System Security and the OpenVMS DCL Dictionary. |
SET VOLUME | Changes the characteristics of one or more mounted Files-11 volumes. The /FILE_PROTECTION qualifier sets the default protection to be applied to all files on the specified disk volume. | See Section 8.4.1.2. |
For a complete list of the command qualifiers and parameters applicable to each of these DCL commands, see the OpenVMS DCL Dictionary.
To change or reset the protection characteristics of one or more files, use the following format:
SET SECURITY/PROTECTION = code file-spec[,...]
where:
code | Defines the protection to be applied to the specified files. You cannot omit the code. |
file-spec | Specifies one or more files for which the protection is to be changed. A file name and file type are required. If you omit a version number, the protection is changed only for the highest existing version of the file. Wildcard characters are allowed. |
The following examples show ways to change file protection.
Examples
$ DELETE INCOME.DAT;3 %DELETE-W-FILNOTDEL, error deleting DISK1:[SMITH]INCOME.DAT;3 -RMS-E-PRV, insufficient privilege or file protection violation $ SET SECURITY/PROTECTION=OWNER:D INCOME.DAT;3 $ DELETE INCOME.DAT;3
$ SET SECURITY/PROTECTION=(SYSTEM:R,OWNER:RWED,GROUP:RW) PAYROLL.LIS
You can use the DCL command SET FILE to modify the characteristics of one or more files or to assign an additional name, or alias, to a file. The following examples illustrate ways you can use the SET FILE command.
Examples
$ SET FILE/EXPIRATION_DATE=15-APR-1996:11:00 BATCH.COM;3
$ SET FILE/BEFORE=15-APR-96/ERASE_ON_DELETE PERSONNEL*.SAL
$ SET FILE/OWNER_UIC=[DOCUMENTATION,GRAY]/VERSION_LIMIT=100 MYFILE.DAT
$ SET FILE OLD_FILENAME.DAT/ENTER=NEW_FILENAME.DAT
Each directory has a protection associated with it. Directory protection can override the protection of individual files within the directory. For example, if a directory denies world access, world users cannot look up files in that directory even though the files permit world access.
For directory protection, you can use the access types shown in Table 9-4.
Using UIC Directory Protection
You cannot completely protect a file without applying at least the same protection to the directory in which the file resides. For example, if you deny a user all access to a file but allow that user read access to the file's directory, the user cannot access the contents of the file but can see that it exists. Conversely, a user allowed access to a file and denied access to the file's directory (or one of the parent directories) cannot see that the file exists.
Note
To protect sensitive files, the directory protection alone is not adequate. You must also protect each individual file contained within the directory. Section 9.3.3 contains instructions for protecting disk files.
By default, top-level directories receive UIC-based protection (S:RWE,O:RWE,G:RE,W:E) and no ACL. A newly created subdirectory receives the same protection as its parent directory, but delete access is removed from all categories.
Following are guidelines for specifying UIC-based protection on a directory:
The following sections explain how to change directory protection characteristics and default ACL protection.
The DCL command SET DIRECTORY modifies the characteristics of one or more directories.
Example
$ SET DIRECTORY/OWNER_UIC=[360,020] [DAVIS],[USERS]
The SET DIRECTORY command in this example modifies both the [DAVIS] and [USERS] directories, changing their owner UICs. Using the /OWNER_UIC qualifier requires SYSPRV (system privilege).
You can override default UIC protection for specified directories or subdirectories by placing a default protection ACE in the ACL of the appropriate directory file. The default protection specified in the ACE is applied to any new file created in the specified directory or in any subdirectory of the directory.
Example
The following ACE, which must be in the ACL of a directory file, specifies that the default protection (for files created in the directory and its subdirectories) will allow system and owner processes full access, group processes read and execute access, and world users no access:
(DEFAULT_PROTECTION,S:RWED,O:RWED,G:RE,W:)
Because tapes are single-user devices, tape protection is only at the volume level. The protection codes for magnetic tape volumes are usually assigned with the INITIALIZE command.
You cannot use DCL commands to change protection characteristics on magnetic tape volumes. See Section 8.5.1 for more information.
This section describes how to use DCL commands to access files at the file level, not at the record level. This applies to reading files on disks, which is explained in this section, as well as to copying tape files, which is explained in Section 9.6.1.
Although DCL does allow you to manipulate files at the record level, for reasons of performance, you probably want to use a conventional programming language instead. Digital recommends that you write programs using the OpenVMS Record Management Services (RMS) facilities, which are specifically designed to access files at the record level. You can write these programs in any higher-level language that the operating system supports.
To access disk files at the file level, you can use DCL commands. You cannot, however, use DCL commands to read or write files that are not in the standard formats supported by the operating system. If the file formats are not standard, you must mount the volumes on which they reside with the /FOREIGN qualifier to have read and write access.
Although the examples used in this section show how to access disk files on RA90 disk packs, they also apply to other devices.
To read the contents of a disk file, use the DCL command TYPE, which displays the contents of a file on your terminal. To find the exact location of the disk file you want to read, use the DCL command DIRECTORY.
How to Perform This Task
If, for example, you want to read the contents of a file named HISFILE, which is located somewhere in the directory [CHARLES] on a disk device whose logical name is DISK$DOCUMENT, follow these steps:
$ DIRECTORY DISK$DOCUMENT:[CHARLES...]HISFILE.*
Directory DISK$DOCUMENT:[CHARLES.MEMO] HISFILE.UPD;1 Total of 1 file.
$ TYPE [CHARLES.MEMO]HISFILE.UPD
This section describes file-level access for tapes. When you request access to a standard-labeled volume or a file, the operating system checks at the volume and file level to ensure that your process can access the volume or file. The level at which the system checks access depends on the operation you request and the type of access the operation requires.
When you access a volume or a file, the operating system software reads the volume- and file-header labels to determine whether access to the volume or file is restricted. Which label is read depends on the operation requested. For example, if you want to mount a volume, your process must have access to it.
The protection set on a file determines your access to the file. The expiration date field in the header can prevent you from overwriting or appending to a file immediately preceding the one in question. If the expiration date field has not been reached, a file has not expired.
To overwrite an unexpired file, you must specify the /OVERRIDE=EXPIRATION qualifier when you mount the volume. Performing this operation requires that you have read or write access.
Following a section that explains tape file names are sections that tell how to perform these tasks:
Task | Section |
---|---|
Locate standard-labeled tape files | Section 9.5.2 |
Use wildcards with tape files | Section 9.5.3 |
Read files on tape volumes | Section 9.5.4 |
Write files to tape volumes | Section 9.5.5 |
OpenVMS systems accept two types of file names for magnetic tapes:
Table 9-5 compares characteristics of OpenVMS extended names and standard names.
Characteristic | OpenVMS Extended Names | Standard Names |
---|---|---|
Valid with... | Tape and disk volumes | Tape volumes |
Format | filename.type;version | filename.;version ( Version is optional.) |
Length | 39.39; | 17.; |
Valid Characters | A through Z; 0 through 9; ampersand (&), hyphen (-), underscore ( _ ), and dollar sign ($); wildcard characters asterisk (*) and percent sign (%) | ASCII "a"¹ characters enclosed in quotation marks (" "). Note that within a file name, DCL interprets a double set of quotation marks ("") as a single set ("). If a name has fewer than 17 characters, the system pads the name on the right with spaces to arrive at the 17-character maximum length. |
Examples | OPENVMS_FILENAME.DAT;23 | "GENLABEL#123";2 |
Before accessing a particular file for a read or write operation, you might want to search the magnetic tape volume for that file. Use the DCL command DIRECTORY to locate a file or group of files on a tape volume.
6017P027.HTM OSSG Documentation 22-NOV-1996 14:21:55.91
Copyright © Digital Equipment Corporation 1996. All Rights Reserved.