[cvsnt] Re: Any possibility to control branch acl on a per-filelevel using a "cvs chacl" -like command?

Kim Hansen kha at mita-teknik.com
Thu Aug 12 20:19:41 BST 2004


John Kinson wrote:
>You're right Glen, the commitinfo hook could be used for this.  The 
>script is invoked with the first parameter containing 
>"/repository/module[/subdirectory/...]", and a list of files being 
>committed within that directory is supplied on stdin.
>
>Kim, you need to write a commitinfo script as discussed in the cvsnt 
>documentation that checks whether the CVS_USER environment variable 
>matches one of your two authorised users, and if not, checks whether the 
>restricted files are present in the supplied data.  If they are, then 
>your script should return a non-zero value to prevent the commit from 
>proceding, and return 0 otherwise.

I still can't get this right.... For testing purposes I have tried to insert a 
line like this in commitinfo:

Testmodules/kha/testacl AllowCommitOnHead -user:$USER -allowedusers:kha -restrictedfiles:OnlyKHACommitOnHead.txt

where the cmd line arguments are some I parse to the AllowCommitOnHead batch file, which use the arguemnts to determine whether a commit is allowed. In addition to these arguments,
cvsnt adds the module, that is Testmodules/kha/testacl to the script, but how do I get hold of the list of files that are being committed to that folder? 

I need those as weel in the script. 

As John wrote, these files are supplied on stdin, but how do I parse that to the script as an additional argument?

Had it only been in a file like loginfo, where %s, could have been used easily.....

Cheers,

Kim



More information about the cvsnt mailing list