info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: User variable (Expert question)


From: Sylvain Lemieux
Subject: RE: User variable (Expert question)
Date: Mon, 10 Feb 2003 14:41:46 -0500

Mark,

I have made few more tests in an attempt to figure out the differences
between my setup and yours. The first one that poped to me is the fact
that my server sits 500Km from my office and runs on a Linux machine. My
first idea was to say that it shouldn't be matter, but it seems that it
does matter. I setup a local server on my machine and got the same error
you shown me in this email using both 1.10 and 1.11.5. (Pre-commit check
failed) However, when I access my real server, the one that is remote, I
get the following error:

cvs server: commitinfo:16: no such user variable ${=COMMITCODE}
Checking in test.txt;
/serv/cvsroot/v700/src/cv/cvbase/test.txt,v  <--  test.txt
new revision: 1.4; previous revision: 1.3
done

Please note that my server still uses cvs 1.10.6 which may be part of
the problem. I will get on it right now and get 1.11.5 running on it to
make further test.

Meanwhile, Can you see any reason why the server would react differently
as opposed to local configuration in this case?

Thanks for spending time on my problem.

--
Sylvain Lemieux, ing.
PCI Geomatics Inc. (The french connection)
On ne peut tomber que si l'on essaie de marcher
Every rain cloud has a silver lining


-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Mark D. Baushke
Sent: Monday, February 10, 2003 1:01 PM
To: Sylvain Lemieux
Cc: address@hidden
Subject: Re: User variable (Expert question) 

Sylvain Lemieux <address@hidden> writes:

> I need the help of a CVS expert that could help solving the following
> problem:
> 
> I have built a program to check commit and have people provide an
> acceptance code when they commit there modification.
>  
> To do so, I am using a user variable in the commitinfo file to pass
the
> extra information. Here is the line I have in my commitinfo.
>  
> DEFAULT /serv/CVSROOT/commitcheck ${=COMMITCODE}
> 
> If I use the following command line:
> 
> cvs -s COMMITCODE=12345 commit
> 
> Then ${=COMMITCODE} will be replaced by 12345 and passed as an extra
> argument.
> 
> However, if people do cvs commit, the variable is left undefined and
my
> commitcheck program isn't called, which create a flaw in my attempt to
> restrict commit. This is real problem for me as people are exploiting
> that flaw to bypass the commit security.
>  
> Is there a way to ensure my program is call even is the variable is
> undefined?
>  
> Any help will be appreciated!

First, a cvs import will not trigger the commitinfo checks, so there is
still a potential hole in your commit process.

Second, using cvs 1.11.5 and the ccvs version I see the following:

  % cvs ci -m test test.c
  cvs server: commitinfo:16: no such user variable ${=COMMITCODE}
  cvs server: Pre-commit check failed
  cvs [server aborted]: correct above errors first!
  % cvs -s COMMITCODE=12345 ci -m test test.c
  RCS file: /tmp/cvs-sanity/cvsroot/CVSROOT/test.c,v
  done
  Checking in test.c;
  /tmp/cvs-sanity/cvsroot/CVSROOT/test.c,v  <--  test.c
  initial revision: 1.1
  done
  cvs server: Rebuilding administrative file database
  % cat -n commitinfo
       1  # The "commitinfo" file is used to control pre-commit checks.
       2  # The filter on the right is invoked with the repository and a
list 
       3  # of files to check.  A non-zero exit of the filter program
will 
       4  # cause the commit to be aborted.
       5  #
       6  # The first entry on a line is a regular expression which is
tested
       7  # against the directory that the change is being committed to,
relative
       8  # to the $CVSROOT.  For the first match that is found, then
the remainder
       9  # of the line is the name of the filter to run.
      10  #
      11  # If the repository name does not match any of the regular
expressions in this
      12  # file, the "DEFAULT" line is used, if it is specified.
      13  #
      14  # If the name "ALL" appears as a regular expression it is
always used
      15  # in addition to the first matching regex or "DEFAULT".
      16  DEFAULT $CVSROOT/CVSROOT/commitcheck foo=${=COMMITCODE}
  % cat /tmp/cvs-santiy/cvsroot/CVSROOT/commitcheck
  #!/bin/sh
  
  case $1 in
    foo=12345) exit 0 ;;
    *) exit 1 ;;
  esac
  %

So, I am unable to reproduce your problem. Perhaps you could try with a
newer version of cvs and see if you still have the problem?

        Enjoy!
        -- Mark


_______________________________________________
Info-cvs mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/info-cvs





reply via email to

[Prev in Thread] Current Thread [Next in Thread]