[PATCH] Update git to v1.8.2.1

Ferry Huberts mailings at hupie.com
Mon Apr 8 20:38:06 CEST 2013



On 08/04/13 20:22, John Keeping wrote:
> On Mon, Apr 08, 2013 at 08:12:09PM +0200, Ferry Huberts wrote:
>> I'm sorry to report that this patch, commit
>> 849ecd961df9454d6f849eac34e6f501395c4f01, breaks on my CentOS 6.4 servers.
>>
>> I'm getting an 'Internal Server Error' with entries like the following
>> in the logs, and cgit just dies.
>>
>>> [Mon Apr 08 20:01:38 2013] [error] [client 192.168.180.8] warning: unable to access '/root/etc/gitconfig': Permission denied, referer: https://git/reposerf/cgit/
>>> [Mon Apr 08 20:01:38 2013] [error] [client 192.168.180.8] warning: unable to access '/root/etc/gitattributes': Permission denied, referer: https://git/reposerf/cgit/
>>>
>>> [Mon Apr 08 20:07:19 2013] [error] [client 192.168.180.8] fatal: unable to access '/root/etc/gitconfig': Permission denied, referer: http://git/reposerf/cgit/
>>> [Mon Apr 08 20:07:19 2013] [error] [client 192.168.180.8] Premature end of script headers: reposerfCgit.cgi, referer: http://git/reposerf/cgit/
>>>
>>> [Mon Apr 08 20:07:28 2013] [error] [client 192.168.180.8] fatal: unable to access '/root/etc/gitconfig': Permission denied, referer: http://git/reposerf/cgit/
>>> [Mon Apr 08 20:07:28 2013] [error] [client 192.168.180.8] Premature end of script headers: reposerfCgit.cgi, referer: http://git/reposerf/cgit/
>>
>>
>>
>> Why are these files suddenly accessed?
>> They weren't before...
> 
> At a guess, I'd say that Git (embedded in CGit) thinks that its system
> configuration file is at '/root/etc/gitconfig'.
> 
> I think you're being bitten by Git's default configuration (assuming
> that you built as root, or at least with $HOME set to /root), which
> looks like this:
> 
>     prefix = $(HOME)
>     bindir_relative = bin
>     bindir = $(prefix)/$(bindir_relative)
>     mandir = share/man
>     infodir = share/info
>     gitexecdir = libexec/git-core
>     mergetoolsdir = $(gitexecdir)/mergetools
>     sharedir = $(prefix)/share
>     gitwebdir = $(sharedir)/gitweb
>     localedir = $(sharedir)/locale
>     template_dir = share/git-core/templates
>     htmldir = share/doc/git-doc
>     ETC_GITCONFIG = $(sysconfdir)/gitconfig
>     ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
> 
> You may need to create a "config.mak" inside the "git" subdirectory of
> your CGit clone and add the line:
> 
>     prefix = /usr


ok that seems to work.
Adjusting my deploy script.


This indicates to me that there is a bug somewhere.
A permission denied should not crash cgit. It should treat that as 'file
not there', the same as with the config.mak hack.


PS.

I do have to do a 'make get-git' _before_ doing the rest.

  git remote update --prune
  git clean -fdx
  git reset --hard origin/master

  # create cgit.conf

  make get-git

  # create git/config.mak

  make install install-man install-html



> 
> This shouldn't have any untoward effects since you're never going to
> install Git from that build or use any of the command-line tools built
> there.
> 
> That will cause ETC_GITCONFIG (and ETC_GITATTRIBUTES) to point at
> /usr/etc/... which won't exist but should at least avoid permissions
> errors.
> 
>> My build config (cgit.conf) is
>>
>>> CGIT_SCRIPT_NAME = reposerfCgit.cgi
>>> CGIT_SCRIPT_PATH = /var/www/cgi-bin
>>> CGIT_DATA_PATH = /home/reposerf/cgit/httpd.html
>>> CGIT_CONFIG = /home/reposerf/cgit/cgit.d/cgitrc
>>> CACHE_ROOT = /var/cache/reposerf.cgit
>>> filterdir = /home/reposerf/cgit/cgit.filters

-- 
Ferry Huberts




More information about the CGit mailing list