extattr - Set, reset, and display extended attributes for files

Format

extattr [+alps] [-alps] [-Fformat] file ...
Note: l is a lowercase L, not an uppercase i.

Description

extattr sets, resets, and displays extended attributes for files.

Extended attributes

The following extended attributes are defined:
a
When this attribute is set (+a) on an executable program file (load module), it behaves as if loaded from an APF-authorized library. For example, if this program is exec()ed at the job step level and the program is linked with the AC=1 attribute, the program will be executed as APF-authorized.

To be able to use the extattr command for the +a option, you must have at least read access to the BPX.FILEATTR.APF resource in the FACILITY class profile. For more information about BPX.FILEATTR.APF, see Commonly used environment variables in z/OS UNIX System Services Planning.

l
When this attribute is set (+l) on an executable program file (load module), it will be loaded from the shared library region.

To be able to use the extattr command for the +l option, you must have at least read access to the BPX.FILEATTR.SHARELIB resource in the FACILITY class. For more information about BPX.FILEATTR.SHARELIB, see Commonly used environment variables in z/OS UNIX System Services Planning.

Note: l is a lowercase L, not an uppercase i.
p
When this attribute is set (+p) on an executable program file (load module), it causes the program to behave as if an RDEFINE had been done for the load module to the PROGRAM class. When this program is brought into storage, it does not cause the environment to be marked dirty.

To be able to use the extattr command for the +p option, you must have at least read access to the BPX.FILEATTR.PROGCTL resource in the FACILITY class. For more information about BPX.FILEATTR.PROGCTL, see Commonly used environment variables in z/OS UNIX System Services Planning.

s
When this attribute is not set (-s), the _BPX_SHAREAS=YES and _BPX_SHAREAS=REUSE environment variable settings are ignored when the file is spawn()ed. Use of the _BPX_SHAREAS=MUST setting and the -s option will result in a spawn() failure. By default, this attribute is set (+s) for all executable files.
Note: In addition to the access permissions to the BPX.FILEATTR.XXXX (XXXX is APF, SHARELIB or PROGCRTL) profiles in the FACILITY class described in the command description, the user must have write access to the file or have SUPERUSER authority. The SUPERUSER.FILESYS UNIXPRIV class profile does not grant authority to update any extended attributes.

Options

-F format file ...
extattr command will accept the -F option flag with values consistent with the cp command to indicate the format of the file. The command will set the file format accordingly.

Setting the file format flag on a file does not modify the data in the file. Use the ls -H to display the file format.

For format, you can specify:
BIN
Binary data
CR
Carriage return
CRLF
Carriage return followed by line feed
CRNL
Carriage return followed by a newline character
LF
Line feed
LFCR
Line feed followed by carriage return
NA
Not specified
NL
Newline character
REC
File data consists of records with prefixes. The record prefix contains the length of the record that follows.
The format option can be specified in lowercase, uppercase or in mixed cases. The format option can also be specified with a space or no space after the file format flag (-F). For example: extattr -FLFcr file
The file format flag (-F) can be used with other extattr flags (+alps/-alps), but it must be separated by a space or tab. For example:
  • extattr +aps -F BIN file is a valid entry.
  • extattr -apsF NA file is not a valid entry.

Usage notes

The APF-authorized (a), shared library (l) and program-control (p) attributes are reset by the system if the file is opened for write, an external link to the file is created, or the file is renamed.

Examples

Following are valid examples of the use of extattr:
extattr +ap -F BIN -sl <filename>
extattr -F NA -aps +l <filename>
extattr -FCRnl <filename>
To have the c89 and tso utilities not run in an address space shared with other processes, issue:
extattr -s /bin/c89 /bin/tso

Related information

chtag, ls, ISHELL