z/OS Using REXX and z/OS UNIX System Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


chown

z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00

Read syntax diagramSkip visual syntax diagram
>>-chown--pathname--uid--gid-----------------------------------><

Function

chown invokes the chown callable service to change the owner or group for a file or directory.

Parameters

pathname
The pathname of a file or directory.
uid
The numeric UID for the new owner of the file or the present UID, or -1 if there is no change.
gid
The numeric GID for the group for the file or the present GID, or -1 if there is no change.

Usage notes

  1. The chown service changes the owner UID and owner GID of a file. Only a superuser can change the owner UID of a file.
  2. The owner GID of a file can be changed by a superuser, or if a caller meets all of these conditions:
    • The effective UID of the caller matches the file's owner UID.
    • The uid value specified in the change request matches the file's owner UID.
    • The gid value specified in the change request is the effective GID, or one of the supplementary GIDs, of the caller.
  3. The set-user-ID-on-execution and set-group-ID-on-execution permissions of the file mode are automatically turned off.
  4. If the change request is successful, the change time for the file is updated.
  5. Values for both uid and gid must be specified as they are to be set. If you want to change only one of these values, the other must be set to its present value to remain unchanged.

Example

In the following example, assume that pathname, uid, and gid were assigned a value earlier in the exec:
"chown (pathname) (uid) (gid)"

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014