[cvsnt] Module information

Thomas Jensen cbm_silverflame at yahoo.com
Wed Oct 3 08:48:36 BST 2007


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Thomas Jensen wrote:

> How can I setup CVSNT to disallow all actions but
export on a certain
> module in a reposetory?

> I tried setting "disallow all actions on module
blabla except export" up
> in premodule and it worked fine because of the %o
variable is available
> in premodule. 
> 
> But the problem is that premodule apparently doesn't
stop the cvsnt
> server from actually performing the command.

What do you call "worked fine"? From
<http://www.cvsnt.org/manual/html/premodule.html>:
"Not all command pass
through premodule. In particular sandbox-related
commands use the
information in CVS/Repository and do not use the
module system."


> ALL C:/modchk.bat %c %o

Are you sure that your bat file is being called? They
say here all the time
that CVSNT wants an executable there. Not sure whether
a bat file counts as
executable (e.g. an otherwise executable Python script
doesn't count) or
whether you'd have to call it through cmd.exe.


> I tried the same in precommand but it doesn't
recognize %o and it doesn't
> recognize the blabla module.

What do you mean by "doesn't recognize"?

Gerhard

----

> How can I setup CVSNT to disallow all actions but
> export on a certain module in a reposetory?

Write a precommand script and pass %c:

http://www.cvsnt.org/manual/html/commit-files.html

and

http://www.cvsnt.org/manual/html/precommand.html

As Gerhard pointed out the command you call from a
script MUST be an executable.  If you want to run a
batch file you need to do something like this (example
for loginfo):

DEFAULT c:\\windows\\system32\\cmd.exe /c
c:\\cvsrepo\\cvsroot\\loginfo.bat %b

Regards,


Arthur Barrett

----

Gerhard & Arthur, I am very gratefull for the
feedback, but you are both missing what I am trying to
do.

I am not trying to disallow export, I want to disallow
all commands BUT export on a specific module in my
repo.

In other words, I have a module in a repo, that I want
to impose restrictions on.

The restriction I want to implement, is that only an
export is allowed on that particular module.

I have a precommand file that looks like this:

ALL C:/precmdtest.bat $USER %r %c %d

This bat file is called without problems and this is
the output of the bat file:

User: cvsadmin
Location: /TESTREPO
Command: update
Timestamp: "Wed Oct  3 07:21:57 2007"

This means that $USER passes the username,
%r passed reposetory name, %c passes command and %d
passes a timestamp.

My premodule file looks like this:

ALL C:/modchk.bat %c %o

And again %c passes the command but %o passes the
module name. But unfortunatly a script that exits with
error code 1 will not stop the operation just as you
guys told me, and just as it is specified on 
http://www.cvsnt.org/manual/html/commit-files.html

However this is the problem, I need the information
from %o in a file that is able to stop the command
from being executed.

This is my modchk.bat file:

@echo off

if %2 == blabla goto :blabla

goto deny

:blabla
if %1 == export goto :allow

goto deny

:allow
echo Operation %1 allowed on %2
EXIT 0

:deny
echo Operation %1 NOT allowed on %2
EXIT 1

This bat file is also called and executes cirrectly,
that is, it types that the operation allowed on the
module if and only if the module is not blabla
combined with the another command than export. 

BUT even though it calls EXIT 1 in the :deny section,
it doesnt stop the cvsnt server. 

As I see it, the only option I can see currently, is
that I make a seperate reposetory for the blabla
module and then use precommand to check reposetory
name and command and denies access that way.

But I was hoping to be able to avoid having to create
a seperate reposetory on my test cvs server for this
purpose. If the %o variable information was available
in the precommand file, then my problem would be
solved and I could control the module acces in great
detail.

Alternatively, I need to make a cvs proxy program or
use one of the script plugins available to the CVSNT
server program.

Regards from CVSAdmin CBMFreak.


      ___________________________________________________________ 
Skal du købe ny bil? Sammenlign priser på brugte biler med Kelkoo og find et godt tilbud! - Se mere her http://dk.yahoo.com/r/pat/mmb


More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook