Changes permissions or ownership of a VOB object
ClearCase (cleartool subcommand), Attache (command)
The protect command sets the owner, group, or permissions for one or more elements, shared derived objects, or named VOB objects. This information is maintained in the VOB database.
NOTE: This command does not apply to files loaded in a snapshot view.
The main use of protect is to control access by standard programs to an element or object's data. For example, you may make some elements readable by anyone, and make others readable by only their group members.
Modifying the permissions of an element changes the permissions of all of its source containers and (if applicable) cleartext containers. That is, the change affects all versions, not just the version selected by the current view. There is no way to change the permissions of an individual version.
Some forms of protect affect ClearCase access. For example, a checkout or checkin is permitted only if the user is the element's owner, or is a member of the element's group.
This command does not affect view-private objects. For this reason, entering a protect command sometimes seems to have no effect:
You can change the permissions on any view-private object (including a checked-out version), with the standard Windows commands. In particular, you can switch a view-private file between read-write and read-only states with the attrib command's -R and +R options.
A winked-in DO is not really a view-private object, but it behaves like one (so that users in different views can build software independently). Moreover, changing the permissions of a winked-in DO actually converts it to a view-private file in your view. See Working with Derived Objects and Configuration Records in Building Software with ClearCase.
The initial owner of an element is the user who creates it with mkelem or mkdir. The initial owner of a named VOB object is the user who creates it. The initial owner of a derived object is the user who builds it with clearmake. When the derived object is winked in and becomes shared, its data container is promoted to a VOB storage pool. This process preserves the derived object's ownership, no matter who performs the build that causes the winkin.
See the permissions reference page for a list of operations that can be performed by an element's owner.
The initial group of an element or named VOB object is the primary group of its creator. The new group specified in a protect -chgrp command must be one of the groups on the VOB's group list.
See the permissions reference page for a list of operations that can be performed by members of an element's or derived object's group.
The read and execute permissions of an element or shared derived object control access to its data in the standard manner. The permissions are also applied to all its associated data containers.
NOTE: protect sometimes adds group-read permission to your specification. This ensures that the owner of an element always retains read permission to its data containers.
The meaning of the write permission varies with the kind of object:
Changing the protection of a global type or a local copy of a global type changes the protection of the global type and all its local copies. You must have permission to change the protection of the global type.
If the protection cannot be changed on one or more of the local copies, the operation fails and the global type's protection is not changed. You must fix the problem and run the protect command again.
For more information, see Administering ClearCase.
Permissions Checking: For each object processed, you must be one of the following: owner, VOB owner, member of the ClearCase group. See the permissions reference page.
NOTE: With protect -chgrp, you must be a member of the new group, and it must also be in the VOB's group list.
Locks: An error occurs if any of the following objects are locked: VOB, element type, element, pool (non-directory elements only). For named objects, an error occurs if the VOB, object, or object's type is locked.
SPECIFYING PERMISSION CHANGES. Default: None.
u | user/owner |
g | group |
o | other |
a | all (owner, group, and other) |
and permission is any combination of
r | read |
w | write |
x | execute |
To combine the forms, separate them with a comma (no white space). For example, to specify read and write permissions for an element's owner and no access by group or other:
cmd-context protect -chmod u=rw,go-rwx test.txt
EVENT RECORDS AND COMMENTS. Default: Creates one or more event records, with commenting controlled by your .clearcase_profile file (default: -nc). See CUSTOMIZING COMMENT HANDLING in the comments reference page. Comments can be edited with chevent.
SPECIFYING THE OBJECTS. Default: None.
attribute-type-selector | attype:type-name[@vob-selector] | |
branch-type-selector | brtype:type-name[@vob-selector] | |
element-type-selector | eltype:type-name[@vob-selector] | |
hyperlink-type-selector | hltype:type-name[@vob-selector] | |
label-type-selector | lbtype:type-name[@vob-selector] | |
trigger-type-selector | trtype:type-name[@vob-selector] | |
pool-selector | pool:pool-name[@vob-selector] | |
hlink-selector | hlink:hlink-id[@vob-selector] | |
oid-obj-selector | oid:object-oid[@vob-selector] | |
The following object selector is valid only if you use MultiSite: | ||
replica-selector | replica:replica-name[@vob-selector] | |
PROCESSING OF DIRECTORY ELEMENTS. Default: Any pname argument that specifies a directory causes the directory element itself to be changed.
Examples including wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.
In cleartool single-command mode, cmd-context represents the command interpreter prompt. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt. In Attache, cmd-context represents the workspace prompt.
cmd-context protect -chmod +r hello.c
Changed protection on "hello.c".
cmd-context protect -recurse -chgrp user src
Changed protection on "src".
Changed protection on "src\cm_fill.c".
Changed protection on "src\convolution.c".
Changed protection on "src\hello.c".
Changed protection on "src\msg.c".
Changed protection on "src\util.c".
cmd-context protect -chown tester brtype:qa_test
Changed protection on "qa_test".
cmd-context protect -chmod 770 hello
Changed protection on "hello".
|
Feedback on the documentation in this site? We welcome any comments!
Copyright © 1999 by Rational Software Corporation. All rights reserved. |