Showing posts with label owner. Show all posts
Showing posts with label owner. Show all posts

Sunday, December 19, 2010

Transfer to New Owner of all streams in a ClearCase VOB / Possible script?

That the real pain point with the lock mechanism: if you unlock (which you need to do if you want to perform a cleartool protect -chown), you are loosing the list of users you excluded from a given lock.

A starting point to script that kind of operation is this IBM document "How to list locked VOBs":

Windows: for /F %v in ('cleartool lsvob -short') do cleartool lslock vob:%vUnix: for i incleartool lsvob -short -host ; do cleartool lslock vob:$i; done

Leave me as a comment the Os on which you will perform those operations, and I will complete this answer with a script.

For instance, a quick DOS script chown_locked.cmd would be:

@ECHO offSETLOCAL ENABLEDELAYEDEXPANSIONdoskey ct=cleartool $*set ucmObject=%1 & REM #project:aProject@\aPVob or stream:aStream@\aPVobset anOldUser=%2 & REM #previous owner of the streamsset anOldUser=%anOldUser:~0,-1%set lsstreamCmd=ct lsstream -in %ucmObject% -fmt "%%Xn %%[locked]p %%u\n"for /F "tokens=1-3" %%a in ( ' %lsstreamCmd% ') do ( rem echo '%%a' rem echo '%%b' rem echo '%%c' if "%%b" EQU "locked" ( if "%%c" EQU "%anOldUser%" ( call:chown %%a %USERNAME% ) else ( echo.ignore locked %%a because not owned by %anOldUser%, but by '%%c' ) ) else ( echo.ignore unlocked %%a ))goto end:chown ucmObject -- chown on a ucm object:: if lock, will restore the nusers lock exception list:: -- streamName [in] name of the UCM object:: -- newOwner [in] name of new owner SETLOCAL ENABLEDELAYEDEXPANSIONset ucmObject=%~1set newOwner=%~2set cmd=ct lslock %ucmObject%for /F "tokens=4*" %%a in ( ' %cmd% ^| find "Locked except for users:" ') do set lslock=%%bset lslock=%lslock:~0,-1%rem echo lslock '%lslock%'if "%lslock%" NEQ "~0,-1" goto lslockecho.chown locked '%ucmObject%%' for '%newOwner%'ct protect -chown %newOwner%2 %ucmObject% & goto endchown:lslockset lslock2=%lslock: =,%rem echo lslock2 '%lslock2%'echo.chown locked '%ucmObject%' for '%newOwner%' while retaining '%lslock2%'ct unlock %ucmObject%ct protect -chown %newOwner% %ucmObject%ct lock -nusers %lslock2% %ucmObject%:endchown( ENDLOCAL)EXIT /b:end( ENDLOCAL)

Call it on a project, or a stream (with sub-streams) within a project, like so:

chown_locked.cmd project:myProject@\aPVobName aPreviousOwnerchown_locked.cmd stream:aStream@\aPVobName aPreviousOwner

It will protect any sub-stream to the current user if said sub-streams are:

lockedlocked with the right owner (the previous one who has left)

If a sub-stream is locked with a -nusers list of excluded users (excluded from the lock), this list is saved before the unlock, and restore when locking the stream again.

Of course, it will only work if the current user is ClearCase administrator (i.e. is in the same group than the ClearCase_albd user): only this king of user can do a chown on a ClearCase object.


View the original article here

Sunday, December 5, 2010

Re: Without being owner , anybody can check-out and check-in element

This question is not answered.
Permlink Replies: 4 - Pages: 1 - Last Post: Nov 30, 2010 8:41 AM Last Post By: Anthony Coluzzi Threads: [ Previous | Next ]
Posts: 2
Registered: Nov 26, 2010 06:49:15 AM Without being owner , anybody can check-out and check-in element
Posted: Nov 29, 2010 01:56:48 AM hello,

i found that setting someone's else view and not even being owner of that element i can checkout and check in the element

what could be the issue behind it ?

Regards


Posts: 80
Registered: Mar 20, 2008 09:44:51 AM Re: Without being owner , anybody can check-out and check-in element
Posted: Nov 29, 2010 03:07:49 AM   in response to: Deepakds in response to: Deepakds's post This is the usual behaviour of ClearCase which looks OK to me...

check the view permissions.
My assumption is that you'll find out that the group has same permissions as the view's owner.

that can be changed after the view creation but easier to prevent.
E.G. (Linux/Unix) set you umask to 002 BEFORE you create the view.

HTH
YG


Posts: 426
Registered: Mar 15, 2005 04:40:07 AM Re: Without being owner , anybody can check-out and check-in element
Posted: Nov 29, 2010 05:10:56 AM   in response to: Deepakds in response to: Deepakds's post Deepakds wrote:
> what could be the issue behind it ?

What do you mean, 'the issue'?
You don't need to use anybody else's view: it depends on the config spec.

If you don't want to share files, don't use an SCM system. The whole purpose is to make development manageable by avoid duplication of information.
If you want to protect your version, apply a label on it, and lock it. And rename the branch away so that next time you can branch off it, whether orr not somebody else has created a 'next' version.

Marc


Posts: 2
Registered: Nov 26, 2010 06:49:15 AM Re: Without being owner , anybody can check-out and check-in element
Posted: Nov 30, 2010 01:03:09 AM   in response to: yarongolan in response to: yarongolan's post thanks ,

umask works for the view that wd be created in future

now the issue is what to do with the views already created

Foe Example:

ct desc /net/eingrna001/vol/vol_view1/cs_1views/eadiaza/eadiaza_vivr_fc_a152-pmr644.vws
Non-MVFS directory "/net/eingrna001/vol/vol_view1/cs_1views/eadiaza/eadiaza_vivr_fc_a152-pmr644.vws"
Modified: Tue Nov 30 10:44:08 2010
Protection:
User : eadiaza : rwx
Group: grcs : rwx
Other: : r-x


Is changing the permission with chmod is the right solution ??

>chmod 0755 /net/eingrna001/vol/vol_view1/cs_1views/eadiaza/eadiaza_vivr_fc_a152-pmr644.vws

%ingrx025:/net/eingrna001/vol/vol_view1/cs_1views/eadiaza/eadiaza_vivr_fc_a152-pmr644.vws >ct desc /net/eingrna001/vol/vol_view1/cs_1views/eadiaza/eadiaza_vivr_fc_a152-pmr644.vws
Non-MVFS directory "/net/eingrna001/vol/vol_view1/cs_1views/eadiaza/eadiaza_vivr_fc_a152-pmr644.vws"
Modified: Tue Nov 30 10:44:08 2010
Protection:
User : eadiaza : rwx
Group: grcs : r-x
Other: : r-x


Posts: 203
Registered: Jan 15, 2005 05:15:03 PM Re: Without being owner , anybody can check-out and check-in element
Posted: Nov 30, 2010 08:41:03 AM   in response to: Deepakds in response to: Deepakds's post Deepakds,

Not to be rude but those problematics are explained in the Rational ClearCase Admin training and documented in the official manuals.

Groups and Users is the chapter in question.I would suggest you to read also ClearCase Unix/Windows interop publication.
On your last post you are touching another problem: view ownership and view creation view ownership is done via fix_protCI protection is done via cleartool protectview storage properties reflect user's Unix/Linux rights
If you run the Unix/Linux chmod and/or chown native commands in a view you will screw things upHelp

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

Use the search field to find all types of content in My developerWorks with that tag. Use the slider bar to see more or fewer tags. Popular tags shows the top tags for this particular type of content or application that you're viewing. My tags shows your tags for this particular type of content or application that you're viewing.MoreLess 
Point your RSS reader here for a feed of the latest messages in all forums

View the original article here