Thursday, January 5, 2012

Revoke Read Access to ClearCase VOB

Say a VOB (VOB tag: VOB1) only allows a group of developers (group id: GRPa) to have read-write access. All other users do not have any access.

1. Make sure that GRPa is either listed as ownership group or additional group. This privilege defines who can modify the code.

> cleartool desc -l vob:VOB1
VOB ownership:
owner AD\ccadmin
group AD\clearcase
Additional groups:
group AD\GRPa

To add GRPa to the addiontinal group, run command
> clearcase protectvob -add_group GRPa

2. Make sure that the VOB root directory has 770 and owned by GRPa group. This privilege defines who can see the code under VOB root.

> cleartool desc -l VOB1
Element Protection:
User : ccadmin : rwx
Group: GRPa : rwx
Other: : ---

to change the protection of the VOB root directory, run command

> cleartool protect -chmod 770 VOB1

If another group (group id: GRPb) needs only read access to VOB1, then a third group (id GRPc) needs to be created to include both GRPa and GRPb. The group GRPc need to be the group of VOB root element. To change it, run command

> cleartool protect -chgrp GRPc VOB1

How to run cleartool mkattr from ant script

Managing escape charactor is never a simple task, especially when it involves xml, cleartool, ant exec, and trying to publish a piece of html code on a blog. Here is an example of how to set an attribute to a ClearCase baseline.

<!-- set baseline with the new build label-->
<exec dir="${clearcase.bin}" executable="cleartool" failonerror="true" >
   <arg line="mkattr"/>
   <arg line="BuildNO"/>
   <arg line="&apos;\&quot;${build.label}\&quot;&apos;"/>
   <arg line="${}"/>