426 lines
18 KiB
HTML
426 lines
18 KiB
HTML
|
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head><META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Change Owner (CHGOWN)</title>
|
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<a name="CHGOWN.Top_Of_Page"></a>
|
|
<h2>Change Owner (CHGOWN)</h2>
|
|
<table width="100%">
|
|
<tr>
|
|
<td valign="top" align="left"><b>Where allowed to run: </b>All environments (*ALL)<br>
|
|
<b>Threadsafe: </b>No
|
|
</td>
|
|
<td valign="top" align="right">
|
|
<a href="#CHGOWN.PARAMETERS.TABLE">Parameters</a><br>
|
|
<a href="#CHGOWN.COMMAND.EXAMPLES">Examples</a><br>
|
|
<a href="#CHGOWN.ERROR.MESSAGES">Error messages</a></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div> <a name="CHGOWN"></a>
|
|
<p>The Change Owner (CHGOWN) command transfers ownership of an object or group of objects from one user to another. An object name pattern can be used to change authority for a group of related objects. The authority that other users have to the object does not change.
|
|
</p>
|
|
<p>The CHGOWN command can also be used to change the owner of a directory tree where the directory, its contents, and the contents of all of its subdirectories are to have the owner changed. If SUBTREE(*ALL) is specified, this command will attempt to change the owner of all objects within the subtree. A diagnostic message will be sent for each object that could not have its owner changed and, when all of the objects have been attempted, an escape message will be sent. If all of the objects had their owner changed with no errors, a completion message will be sent.
|
|
</p>
|
|
<p>If a symbolic link object is encountered, either specified in the <b>Object (OBJ)</b> parameter or encountered in the processing of a subtree, the value specified for the <b>Symbolic link (SYMLNK)</b> parameter will be applied to that symbolic link object. If processing a subtree, the processing of that branch of the subtree then stops because a symbolic link object itself cannot have subtrees.
|
|
</p>
|
|
<p>The owner of an object always has all the authorities applicable to the object unless they are explicitly revoked. The owner of an object has the authority to grant any authorities to any user for that object. Owners can also grant to themselves authorities that were previously revoked. Owners may, for example, remove some of their specific authorities as a precautionary measure, and then, when the need arises, grant those same authorities to themselves again.
|
|
</p>
|
|
<p>A user with all object (*ALLOBJ) special authority has complete authority for all objects and can transfer the ownership of any object. All users have add (*ADD) and delete (*DLT) authorities for their own user profiles; that is, users can add objects to or delete objects (that they created) from their own user profiles by transferring the ownership of the object.
|
|
</p>
|
|
<p>For more information about integrated file system commands, see the Integrated file system information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
|
|
</p>
|
|
<p><b>Restrictions:</b>
|
|
</p>
|
|
<ul>
|
|
<li>To transfer ownership of an object in the QSYS.LIB or independent ASP QSYS.LIB file system, you must have all of the following:
|
|
<ul>
|
|
<li>Object existence (*OBJEXIST) authority for the object
|
|
</li>
|
|
<li>Object operational (*OBJOPR) and *OBJEXIST authorities if the object is a file, library, or subsystem description
|
|
</li>
|
|
<li>*ALLOBJ special authority or ownership if the object is an authorization list
|
|
</li>
|
|
<li>*ADD authority for the new owner's user profile
|
|
</li>
|
|
<li>*DLT authority for the present owner's user profile
|
|
</li>
|
|
<li>*ALLOBJ and security administrator (*SECADM) special authorities to change the object owner of a program that adopts authority.
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>Changing the ownership of an object that has an authority holder associated with it also changes the ownership of the authority holder.
|
|
</li>
|
|
<li>When doing subtree processing, you must have read (*R) and execute (*X) authorities to the path name and all subdirectories within that path.
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#CHGOWN.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
|
|
<div>
|
|
<h3><a name="CHGOWN.PARAMETERS.TABLE">Parameters</a></h3>
|
|
<table border="1" cellpadding="4" cellspacing="0">
|
|
<!-- col1="10" col2="15" col3="30" col4="10" -->
|
|
<tr>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Keyword</th>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Description</th>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Choices</th>
|
|
<th bgcolor="aqua" valign="bottom" align="left">Notes</th>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#CHGOWN.OBJ"><b>OBJ</b></a></td>
|
|
<td valign="top">Object</td>
|
|
<td valign="top"><i>Path name</i></td>
|
|
<td valign="top">Required, Positional 1</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#CHGOWN.NEWOWN"><b>NEWOWN</b></a></td>
|
|
<td valign="top">New owner</td>
|
|
<td valign="top"><i>Name</i></td>
|
|
<td valign="top">Required, Positional 2</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#CHGOWN.RVKOLDAUT"><b>RVKOLDAUT</b></a></td>
|
|
<td valign="top">Revoke current authority</td>
|
|
<td valign="top">*NO, <b><u>*YES</u></b></td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#CHGOWN.SUBTREE"><b>SUBTREE</b></a></td>
|
|
<td valign="top">Directory subtree</td>
|
|
<td valign="top"><b><u>*NONE</u></b>, *ALL</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
<tr>
|
|
<td valign="top"><a href="#CHGOWN.SYMLNK"><b>SYMLNK</b></a></td>
|
|
<td valign="top">Symbolic link</td>
|
|
<td valign="top"><b><u>*NO</u></b>, *YES</td>
|
|
<td valign="top">Optional</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#CHGOWN.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
</div>
|
|
<div> <a name="CHGOWN.OBJ"></a>
|
|
<h3>Object (OBJ)</h3>
|
|
<p>Specifies the object, or a pattern to match multiple objects, for which ownership is to be changed.
|
|
</p>
|
|
<p>For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
|
|
</p>
|
|
<p>This is a required parameter.
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>path-name</i></b></dt>
|
|
<dd>Specify the path name of the objects whose ownership is to be changed.
|
|
<p>The object path name can be either a simple name or a name that is qualified with the name of the directory in which the object is located. A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#CHGOWN.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="CHGOWN.NEWOWN"></a>
|
|
<h3>New owner (NEWOWN)</h3>
|
|
<p>Specifies the user profile of the new owner for the object. The user profile must exist when this command is run.
|
|
</p>
|
|
<p>This is a required parameter.
|
|
</p>
|
|
<dl>
|
|
<dt><b><i>name</i></b></dt>
|
|
<dd>Specify the name of the user profile.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#CHGOWN.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="CHGOWN.RVKOLDAUT"></a>
|
|
<h3>Revoke current authority (RVKOLDAUT)</h3>
|
|
<p>Specifies whether the authorities for the current owner are revoked when ownership is transferred to the new owner specified for the <b>New owner (NEWOWN)</b> parameter.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*YES</u></b></dt>
|
|
<dd>The authorities for the current owner are revoked when the object is transferred to the new owner.
|
|
</dd>
|
|
<dt><b>*NO</b></dt>
|
|
<dd>The current owner's authority is not changed when the object is transferred to the new owner.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#CHGOWN.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="CHGOWN.SUBTREE"></a>
|
|
<h3>Directory subtree (SUBTREE)</h3>
|
|
<p>Specifies whether or not to change the objects within the subtree if the object specified by the <b>Object (OBJ)</b> parameter is a directory or a library.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NONE</u></b></dt>
|
|
<dd>The objects specified by the OBJ parameter are changed. If the object is a directory or a library, it will be changed, but the directory or library contents will not be changed.
|
|
</dd>
|
|
<dt><b>*ALL</b></dt>
|
|
<dd>The objects specified by the OBJ parameter are changed. If the object is a directory or a library, it will be changed as well as the contents of the directory or library and the contents of all subdirectories.
|
|
<p>
|
|
<b>Note: </b>Pattern matching from the OBJ parameter only applies to the first level objects. If the first level object is a directory or a library, the pattern matching does not apply to the directory or library contents or the contents of the subdirectories.
|
|
</p>
|
|
<p>
|
|
<b>Note: </b>This command may run a long time when SUBTREE(*ALL) is specified if there are many subdirectories to be processed.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#CHGOWN.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<div> <a name="CHGOWN.SYMLNK"></a>
|
|
<h3>Symbolic link (SYMLNK)</h3>
|
|
<p>If the object is a symbolic link, specifies whether or not to change the symbolic link or the object pointed to by the symbolic link.
|
|
</p>
|
|
<dl>
|
|
<dt><b><u>*NO</u></b></dt>
|
|
<dd>The symbolic link object is not changed. The object pointed to by the symbolic link is changed.
|
|
</dd>
|
|
<dt><b>*YES</b></dt>
|
|
<dd>If the object is a symbolic link, the symbolic link is changed. The object pointed to by the symbolic link is not changed.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#CHGOWN.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
<div><h3><a name="CHGOWN.COMMAND.EXAMPLES">Examples</a> </h3>
|
|
<p><b>Example 1: Changing the owner of a program</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
CHGOWN OBJ('/QSYS.LIB/USERLIB.LIB/PROGRAM1.PGM') NEWOWN(ANN)
|
|
</pre>
|
|
</p>
|
|
<p>This command assigns ownership of the program named PROGRAM1, located in the user library named USERLIB, to the user named ANN. The authority is revoked from the current owner.
|
|
</p>
|
|
<p><b>The following examples use the chart below:</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
* sym1 (symbolic link to dir1)
|
|
*
|
|
*
|
|
* dir1
|
|
* * * *
|
|
* * * *
|
|
* * * *
|
|
* dir2.1 dir2.2 dir2.3
|
|
* * * *
|
|
* * * *
|
|
* dir3.1 dir3.2 sym3.3 (symbolic link to dirA)
|
|
*
|
|
*
|
|
* dirA
|
|
* * * *
|
|
* * * *
|
|
* * * *
|
|
* dirB.1 dirB.2 dirB.3
|
|
*
|
|
</pre>
|
|
</p>
|
|
<p><b>Example 2: Changing the owner of a symbolic link when SYMLNK(*NO)</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
CHGOWN OBJ('/sym1') NEWOWN(SAM) SUBTREE(*ALL) SYMLNK(*NO)
|
|
</pre>
|
|
</p>
|
|
<p>This command will first determine if there are subtrees to process. Since the object specified in the OBJ parameter is a symbolic link, the SUBTREE parameter will be ignored because a symbolic link object does not have subtrees. Next, the object pointed to by symbolic link sym1 (dir1) will be changed because the SYMLNK parameter specifies that the symbolic link object not be changed.
|
|
</p>
|
|
<p>In this example, the owner of dir1 is changed to SAM and the authority is revoked from the current owner. It does not change the owner of the symbolic link object (sym1) and it does not change the owner of the contents of dir1.
|
|
</p>
|
|
<p><b>Example 3: Changing the owner a symbolic link when SYMLNK(*YES)</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
CHGOWN OBJ('/sym1') NEWOWN(JOE) SUBTREE(*ALL) SYMLNK(*YES)
|
|
</pre>
|
|
</p>
|
|
<p>This command will first determine if there are subtrees to process. Since the object specified in the OBJ parameter is a symbolic link, the SUBTREE parameter will be ignored because a symbolic link object does not have subtrees. Next, the symbolic link object (sym1) will be changed because the SYMLNK parameter specifies that the symbolic link object be changed.
|
|
</p>
|
|
<p>In this example, the owner of sym1 is changed to JOE and the authority is revoked from the current owner. It does not change the owner of the object pointed to by the symbolic link (dir1) and it does not change the owner of the contents of dir1.
|
|
</p>
|
|
<p><b>Example 4: Changing the owner of a directory when SUBTREE(*ALL) and SYMLNK(*NO)</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
CHGOWN OBJ('/dir1') NEWOWN(PETE) SUBTREE(*ALL) SYMLNK(*NO)
|
|
</pre>
|
|
</p>
|
|
<p>This command will first determine if there are subtrees to process. Since the object specified in the OBJ parameter is a directory, the subtrees will be processed. When the processing of the tree encounters a *SYMLNK object, the value for the SYMLNK parameter will be applied to that *SYMLNK object. When the SYMLNK parameter is *NO, the object the symbolic link points to will be changed. The processing of that branch of the tree then stops because the *SYMLNK object itself does not have a subtree.
|
|
</p>
|
|
<p>In this example, the owner of dir1, dir2.1, dir2.2, dir2.3, dir3.1, dir3.2, dirA is changed to PETE and the authority to those directories is revoked from their current owners. The owner of sym3.3, dirB.1, dirB.2, dirB.3 is not changed.
|
|
</p>
|
|
<p><b>Example 5: Changing the owner of a directory when SUBTREE(*ALL) and SYMLNK(*YES)</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
CHGOWN OBJ('/dir1') NEWOWN(GEORGE) SUBTREE(*ALL) SYMLNK(*YES)
|
|
</pre>
|
|
</p>
|
|
<p>This command will first determine if there are subtrees to process. Since the object specified in the OBJ parameter is a directory, the subtrees will be processed. When the processing of the tree encounters a *SYMLNK object, the value for the SYMLNK parameter will be applied to the *SYMLNK object. When the SYMLNK parameter is *YES, the symbolic link object will be changed. The processing of that branch of the tree then stops because the *SYMLNK object itself does not have a subtree.
|
|
</p>
|
|
<p>In this example, the owner of dir1, dir2.1, dir2.2, dir2.3, dir3.1, dir3.2, sym3.3 is changed to GEORGE and the authority is revoked from their current owners. The owner of dirA, dirB.1, dirB.2, dirB.3 is not changed.
|
|
</p>
|
|
<p><b>Example 6: Changing the owner of a directory when SUBTREE(*NONE) and SYMLNK(*NO)</b>
|
|
</p>
|
|
<p>
|
|
<pre>
|
|
CHGOWN OBJ('/dir1') NEWOWN(BETTY) SUBTREE(*NONE) SYMLNK(*NO)
|
|
</pre>
|
|
</p>
|
|
<p>This command will not process subtrees. Since the object specified in the OBJ parameter is not a symbolic link, the SYMLNK parameter will be ignored.
|
|
</p>
|
|
<p>The owner of dir1 is changed to BETTY and the authority is revoked from the current owner.
|
|
</p>
|
|
<p><b>NOTE:</b>
|
|
</p>
|
|
<p>The only way to change dirB.1, dirB.2, and dirB.3 is to specify them individually in the OBJ parameter of the change command, or to specify the change command with OBJ(dirA) and SUBTREE(*ALL).
|
|
</p>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#CHGOWN.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
<hr size="2" width="100%">
|
|
<div><h3><a name="CHGOWN.ERROR.MESSAGES">Error messages</a> </h3>
|
|
<p><b><u>*ESCAPE Messages</u></b>
|
|
</p>
|
|
<dl>
|
|
<dt><b>CPE3101</b></dt>
|
|
<dd>A non-recoverable I/O error occurred.
|
|
</dd>
|
|
<dt><b>CPE3408</b></dt>
|
|
<dd>The address used for an argument was not correct.
|
|
</dd>
|
|
<dt><b>CPE3418</b></dt>
|
|
<dd>Possible APAR condition or hardware failure.
|
|
</dd>
|
|
<dt><b>CPE3474</b></dt>
|
|
<dd>Unknown system state.
|
|
</dd>
|
|
<dt><b>CPFA0AA</b></dt>
|
|
<dd>Error occurred while attempting to obtain space.
|
|
</dd>
|
|
<dt><b>CPFA0AB</b></dt>
|
|
<dd>Operation failed for object. Object is &1.
|
|
</dd>
|
|
<dt><b>CPFA0AD</b></dt>
|
|
<dd>Function not supported by file system.
|
|
</dd>
|
|
<dt><b>CPFA0A2</b></dt>
|
|
<dd>Information passed to this operation was not valid.
|
|
</dd>
|
|
<dt><b>CPFA0A3</b></dt>
|
|
<dd>Path name resolution causes looping.
|
|
</dd>
|
|
<dt><b>CPFA0A4</b></dt>
|
|
<dd>Too many open files for process.
|
|
</dd>
|
|
<dt><b>CPFA0A7</b></dt>
|
|
<dd>Path name too long.
|
|
</dd>
|
|
<dt><b>CPFA0A9</b></dt>
|
|
<dd>Object not found. Object is &1.
|
|
</dd>
|
|
<dt><b>CPFA0B1</b></dt>
|
|
<dd>No objects satisfy request.
|
|
</dd>
|
|
<dt><b>CPFA0C1</b></dt>
|
|
<dd>CCSID &1 not valid.
|
|
</dd>
|
|
<dt><b>CPFA0CE</b></dt>
|
|
<dd>Error occurred with path name parameter specified.
|
|
</dd>
|
|
<dt><b>CPFA0DD</b></dt>
|
|
<dd>Function was interrupted.
|
|
</dd>
|
|
<dt><b>CPFA0D4</b></dt>
|
|
<dd>File system error occurred. Error number &1.
|
|
</dd>
|
|
<dt><b>CPFA08B</b></dt>
|
|
<dd>Path name cannot begin with *.
|
|
</dd>
|
|
<dt><b>CPFA08C</b></dt>
|
|
<dd>Pattern not allowed in path name directory.
|
|
</dd>
|
|
<dt><b>CPFA085</b></dt>
|
|
<dd>Home directory not found for user &1.
|
|
</dd>
|
|
<dt><b>CPFA086</b></dt>
|
|
<dd>Matching quote not found in path name.
|
|
</dd>
|
|
<dt><b>CPFA087</b></dt>
|
|
<dd>Path name contains null character.
|
|
</dd>
|
|
<dt><b>CPFA088</b></dt>
|
|
<dd>Path name pattern not valid.
|
|
</dd>
|
|
<dt><b>CPFA089</b></dt>
|
|
<dd>Pattern not allowed in path name.
|
|
</dd>
|
|
<dt><b>CPFA09C</b></dt>
|
|
<dd>Not authorized to object. Object is &1.
|
|
</dd>
|
|
<dt><b>CPFA09D</b></dt>
|
|
<dd>Error occurred in program &1.
|
|
</dd>
|
|
<dt><b>CPFA09E</b></dt>
|
|
<dd>Object in use. Object is &1.
|
|
</dd>
|
|
<dt><b>CPFA091</b></dt>
|
|
<dd>Pattern not allowed in user name.
|
|
</dd>
|
|
<dt><b>CPFA092</b></dt>
|
|
<dd>Path name not converted.
|
|
</dd>
|
|
<dt><b>CPFA094</b></dt>
|
|
<dd>Path name not specified.
|
|
</dd>
|
|
<dt><b>CPFBC50</b></dt>
|
|
<dd>Path name or path names not found.
|
|
</dd>
|
|
<dt><b>CPF220A</b></dt>
|
|
<dd>New owner &1 does not have a uid.
|
|
</dd>
|
|
<dt><b>CPF2204</b></dt>
|
|
<dd>User profile &1 not found.
|
|
</dd>
|
|
<dt><b>CPF2213</b></dt>
|
|
<dd>Not able to allocate user profile &1.
|
|
</dd>
|
|
<dt><b>CPF2217</b></dt>
|
|
<dd>Not authorized to user profile &1.
|
|
</dd>
|
|
<dt><b>CPF223A</b></dt>
|
|
<dd>&1 objects changed, &2 objects not changed.
|
|
</dd>
|
|
<dt><b>CPF22F0</b></dt>
|
|
<dd>Unexpected errors occurred during processing.
|
|
</dd>
|
|
<dt><b>CPF3BF6</b></dt>
|
|
<dd>Path Type value is not valid.
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<table width="100%">
|
|
<tr><td align="right"><a href="#CHGOWN.Top_Of_Page">Top</a></td></tr>
|
|
</table>
|
|
</body>
|
|
</html>
|