16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

–R Recursively change file mode bits. For each pathname operand that names<br />

a directory, chmod will change the file mode bits of the directory and all<br />

files in the file hierarchy below it.<br />

chmod never changes the permissions of symbolic links (or external links),<br />

because, on a z/<strong>OS</strong> system, the permissions on symbolic links (and external links)<br />

are never used. When -h is not specified, and symbolic links (or external links) are<br />

specified or encountered during the file hierarchy traversal, the links are followed,<br />

and the resolved directory (and files and subdirectories) are changed.<br />

You can specify the mode value on the command line in either symbolic form or as<br />

an octal value.<br />

The symbolic form of the mode argument has the form:<br />

[who] op permission[op permission ...]<br />

The who value is any combination of the following:<br />

u Sets owner (user or individual) permissions.<br />

g Sets group permissions.<br />

o Sets other permissions.<br />

a Sets all permissions; this is the default. If a who value is not specified, the<br />

default is a, modified by umask.<br />

The op part of a symbolic mode is an operator that tells chmod to turn the<br />

permissions on or off. The possible values are:<br />

+ Turns on a permission.<br />

− Turns off a permission.<br />

= Turns on the specified permissions and turns off all others.<br />

The permission part of a symbolic mode is any combination of the following:<br />

r Read permission. If this is off, you cannot read the file.<br />

x Execute permission. If this is off, you cannot run the file.<br />

X Execute or search permission for a directory; or execute permission for a<br />

file only when the current mode has at least one of the execute bits set.<br />

w Write permission. If this is off, you cannot write to the file.<br />

s If in owner permissions section, the set-user-ID bit is on; if in group<br />

permissions section, the set-group-ID bit is on.<br />

Note: A superuser or the file owner can use a chmod command or chmod()<br />

function to change two options for an executable file. The options<br />

are set in two file mode bits:<br />

v Set-user-ID (S_ISUID) with the setuid option<br />

v Set-group-ID (S_ISGID) with the setgid option<br />

chmod<br />

If one or both of these bits are on, the effective UID, effective GID,<br />

or both, plus the saved UID, saved GID, or both, for the process<br />

running the program are changed to the owning UID, GID, or both,<br />

for the file. This change temporarily gives the process running the<br />

program access to data the file owner or group can access.<br />

In a new file, both bits are set off. Also, if the owning UID or GID of a<br />

file is changed or if the file is written in, the bits are turned off. In<br />

shell scripts, these bits are ignored.<br />

Chapter 2. Shell command descriptions 125

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!