Woes executing SVN from CGI
From: David W. Wilson <wilson.d_at_anseri.com>
 
Date: 2007-10-11 15:52:57 CEST 
>>I tried the
 >>obvious, adding --username and --password options to the "svn" command
 >>but no luck, same behavior.
 > 
 >Can you post the output from the CGI (in both CLI and CGI) with these
 >options added? I assume you've realised that the CLI runs under a
 >different user from Apache (normally), so the CGI version can't use
 >the cached credentials from the CLI user.
 > 
 >Greg
  
 I am of course aware that CGI runs within Apache's environment.
  
 Is there a way to specify credentials for CGI scripts?
  
 How about "runas"? With its /savecred option? I haven't been able to get
  
 At any rate, here is my script with username and password options set:
  
 ------------------------------------------------------------------------
 # Print HTTP header
 print "Content-type: text/plain; charset=iso-8859-1\n\n";
  
 # Print environment
 print "Environment:\n";
 foreach $var (sort(keys(%ENV))) {
     $val = $ENV{$var};
     $val =~ s|\n|\\n|g;
     $val =~ s|"|\\"|g;
     print "${var}=\"${val}\"\n";
 }
 print "\n";
  
 # Command to get the contents of a SVN file on SVN server
 my $command = "\"c:/Program Files/CollabNet Subversion Server/svn\" \"cat\"
  
 # Run the command
 my $output = `$command 2>&1`;
  
 # Print the command and output
 print "Command:\n$command\n\nOutput:\n$output\n";
  
 # Finish happily
 exit 0;
 ------------------------------------------------------------------------
  
 Here is the CLI output:
  
 ------------------------------------------------------------------------
 Content-type: text/plain; charset=iso-8859-1
  
 Command:
 "c:/Program Files/CollabNet Subversion Server/svn" "cat" "--non-interactive"
  
 Output:
 This is a test.
 ------------------------------------------------------------------------
  
 Here is the CGI output:
  
 ------------------------------------------------------------------------
 Command:
 "c:/Program Files/CollabNet Subversion Server/svn" "cat" "--non-interactive"
  
 Output:
 svn: PROPFIND request failed on '/svn/src/project/wilsond/test.txt'
 svn: PROPFIND of '/svn/src/project/wilsond/test.txt': 403 Forbidden
 ------------------------------------------------------------------------
  
 The SVN server Apache access log is similar as well. For CLI accesses, the
  
 I find this in the Subversion documentation:
  
 One last word about client authentication behavior: a bit of explanation
  
 ... and in this case, the server apparently does not request them.
  
  
  
  | 
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.