List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] Update git to v1.8.2.1
@ 2013-04-08  8:00 john
  2013-04-08  8:42 ` mailings
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: john @ 2013-04-08  8:00 UTC (permalink / raw)


This requires a small change to how we handle notes, but otherwise just
works.

Note that we can't use anything from v1.8.0 until v1.8.2.1 because some
of the symbols that we need for graph drawing were made private in
v1.8.0 and this was not reverted until v1.8.2.1.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 Makefile    | 2 +-
 git         | 2 +-
 ui-commit.c | 3 ++-
 ui-log.c    | 6 +++---
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 83d4716..59edab0 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
 pdfdir = $(docdir)
 mandir = $(prefix)/share/man
 SHA1_HEADER = <openssl/sha.h>
-GIT_VER = 1.7.12.4
+GIT_VER = 1.8.2.1
 GIT_URL = https://git-core.googlecode.com/files/git-$(GIT_VER).tar.gz
 INSTALL = install
 MAN5_TXT = $(wildcard *.5.txt)
diff --git a/git b/git
index 7e20105..5bda18c 160000
--- a/git
+++ b/git
@@ -1 +1 @@
-Subproject commit 7e2010537e96d0a1144520222f20ba1dc3d61441
+Subproject commit 5bda18c186e455f8e65f976d3bf333ab1f4b5b53
diff --git a/ui-commit.c b/ui-commit.c
index 0783285..5a552a1 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -36,7 +36,8 @@ void cgit_print_commit(char *hex, const char *prefix)
 	}
 	info = cgit_parse_commit(commit);
 
-	format_note(NULL, sha1, &notes, PAGE_ENCODING, 0);
+	init_display_notes(NULL);
+	format_display_notes(sha1, &notes, PAGE_ENCODING, 0);
 
 	load_ref_decorations(DECORATE_FULL_REFS);
 
diff --git a/ui-log.c b/ui-log.c
index aaffb4e..8d8b235 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -195,9 +195,8 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
 				strbuf_addstr(&msgbuf, info->msg);
 				strbuf_addch(&msgbuf, '\n');
 			}
-			format_note(NULL, commit->object.sha1, &msgbuf,
-			            PAGE_ENCODING,
-			            NOTES_SHOW_HEADER | NOTES_INDENT);
+			format_display_notes(commit->object.sha1,
+					     &msgbuf, PAGE_ENCODING, 0);
 			strbuf_addch(&msgbuf, '\n');
 			strbuf_ltrim(&msgbuf);
 		}
@@ -397,6 +396,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
 		commit->parents = NULL;
 	}
 
+	init_display_notes(NULL);
 	for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) {
 		print_commit(commit, &rev);
 		free(commit->buffer);
-- 
1.8.2.694.ga76e9c3.dirty





^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08  8:00 [PATCH] Update git to v1.8.2.1 john
@ 2013-04-08  8:42 ` mailings
  2013-04-08 13:41 ` Jason
  2013-04-08 18:12 ` mailings
  2 siblings, 0 replies; 24+ messages in thread
From: mailings @ 2013-04-08  8:42 UTC (permalink / raw)


yay.

thanks for the work John!
Now let's try to keep in sync :-)

On 08/04/13 10:00, John Keeping wrote:
> This requires a small change to how we handle notes, but otherwise just
> works.
> 
> Note that we can't use anything from v1.8.0 until v1.8.2.1 because some
> of the symbols that we need for graph drawing were made private in
> v1.8.0 and this was not reverted until v1.8.2.1.
> 
> Signed-off-by: John Keeping <john at keeping.me.uk>
> ---
>  Makefile    | 2 +-
>  git         | 2 +-
>  ui-commit.c | 3 ++-
>  ui-log.c    | 6 +++---
>  4 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 83d4716..59edab0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -14,7 +14,7 @@ htmldir = $(docdir)
>  pdfdir = $(docdir)
>  mandir = $(prefix)/share/man
>  SHA1_HEADER = <openssl/sha.h>
> -GIT_VER = 1.7.12.4
> +GIT_VER = 1.8.2.1
>  GIT_URL = https://git-core.googlecode.com/files/git-$(GIT_VER).tar.gz
>  INSTALL = install
>  MAN5_TXT = $(wildcard *.5.txt)
> diff --git a/git b/git
> index 7e20105..5bda18c 160000
> --- a/git
> +++ b/git
> @@ -1 +1 @@
> -Subproject commit 7e2010537e96d0a1144520222f20ba1dc3d61441
> +Subproject commit 5bda18c186e455f8e65f976d3bf333ab1f4b5b53
> diff --git a/ui-commit.c b/ui-commit.c
> index 0783285..5a552a1 100644
> --- a/ui-commit.c
> +++ b/ui-commit.c
> @@ -36,7 +36,8 @@ void cgit_print_commit(char *hex, const char *prefix)
>  	}
>  	info = cgit_parse_commit(commit);
>  
> -	format_note(NULL, sha1, &notes, PAGE_ENCODING, 0);
> +	init_display_notes(NULL);
> +	format_display_notes(sha1, &notes, PAGE_ENCODING, 0);
>  
>  	load_ref_decorations(DECORATE_FULL_REFS);
>  
> diff --git a/ui-log.c b/ui-log.c
> index aaffb4e..8d8b235 100644
> --- a/ui-log.c
> +++ b/ui-log.c
> @@ -195,9 +195,8 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
>  				strbuf_addstr(&msgbuf, info->msg);
>  				strbuf_addch(&msgbuf, '\n');
>  			}
> -			format_note(NULL, commit->object.sha1, &msgbuf,
> -			            PAGE_ENCODING,
> -			            NOTES_SHOW_HEADER | NOTES_INDENT);
> +			format_display_notes(commit->object.sha1,
> +					     &msgbuf, PAGE_ENCODING, 0);
>  			strbuf_addch(&msgbuf, '\n');
>  			strbuf_ltrim(&msgbuf);
>  		}
> @@ -397,6 +396,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
>  		commit->parents = NULL;
>  	}
>  
> +	init_display_notes(NULL);
>  	for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) {
>  		print_commit(commit, &rev);
>  		free(commit->buffer);
> 

-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08  8:00 [PATCH] Update git to v1.8.2.1 john
  2013-04-08  8:42 ` mailings
@ 2013-04-08 13:41 ` Jason
  2013-04-08 18:12 ` mailings
  2 siblings, 0 replies; 24+ messages in thread
From: Jason @ 2013-04-08 13:41 UTC (permalink / raw)


Thanks John. I've had almost the same patch running in my
jd/zx2c4-deployment branch for quite some time now, and it works well,
so merging this to master.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08  8:00 [PATCH] Update git to v1.8.2.1 john
  2013-04-08  8:42 ` mailings
  2013-04-08 13:41 ` Jason
@ 2013-04-08 18:12 ` mailings
  2013-04-08 18:16   ` mailings
  2013-04-08 18:22   ` john
  2 siblings, 2 replies; 24+ messages in thread
From: mailings @ 2013-04-08 18:12 UTC (permalink / raw)


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...


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







On 08/04/13 10:00, John Keeping wrote:
> This requires a small change to how we handle notes, but otherwise just
> works.
> 
> Note that we can't use anything from v1.8.0 until v1.8.2.1 because some
> of the symbols that we need for graph drawing were made private in
> v1.8.0 and this was not reverted until v1.8.2.1.
> 
> Signed-off-by: John Keeping <john at keeping.me.uk>
> ---
>  Makefile    | 2 +-
>  git         | 2 +-
>  ui-commit.c | 3 ++-
>  ui-log.c    | 6 +++---
>  4 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 83d4716..59edab0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -14,7 +14,7 @@ htmldir = $(docdir)
>  pdfdir = $(docdir)
>  mandir = $(prefix)/share/man
>  SHA1_HEADER = <openssl/sha.h>
> -GIT_VER = 1.7.12.4
> +GIT_VER = 1.8.2.1
>  GIT_URL = https://git-core.googlecode.com/files/git-$(GIT_VER).tar.gz
>  INSTALL = install
>  MAN5_TXT = $(wildcard *.5.txt)
> diff --git a/git b/git
> index 7e20105..5bda18c 160000
> --- a/git
> +++ b/git
> @@ -1 +1 @@
> -Subproject commit 7e2010537e96d0a1144520222f20ba1dc3d61441
> +Subproject commit 5bda18c186e455f8e65f976d3bf333ab1f4b5b53
> diff --git a/ui-commit.c b/ui-commit.c
> index 0783285..5a552a1 100644
> --- a/ui-commit.c
> +++ b/ui-commit.c
> @@ -36,7 +36,8 @@ void cgit_print_commit(char *hex, const char *prefix)
>  	}
>  	info = cgit_parse_commit(commit);
>  
> -	format_note(NULL, sha1, &notes, PAGE_ENCODING, 0);
> +	init_display_notes(NULL);
> +	format_display_notes(sha1, &notes, PAGE_ENCODING, 0);
>  
>  	load_ref_decorations(DECORATE_FULL_REFS);
>  
> diff --git a/ui-log.c b/ui-log.c
> index aaffb4e..8d8b235 100644
> --- a/ui-log.c
> +++ b/ui-log.c
> @@ -195,9 +195,8 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
>  				strbuf_addstr(&msgbuf, info->msg);
>  				strbuf_addch(&msgbuf, '\n');
>  			}
> -			format_note(NULL, commit->object.sha1, &msgbuf,
> -			            PAGE_ENCODING,
> -			            NOTES_SHOW_HEADER | NOTES_INDENT);
> +			format_display_notes(commit->object.sha1,
> +					     &msgbuf, PAGE_ENCODING, 0);
>  			strbuf_addch(&msgbuf, '\n');
>  			strbuf_ltrim(&msgbuf);
>  		}
> @@ -397,6 +396,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
>  		commit->parents = NULL;
>  	}
>  
> +	init_display_notes(NULL);
>  	for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) {
>  		print_commit(commit, &rev);
>  		free(commit->buffer);
> 

-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:12 ` mailings
@ 2013-04-08 18:16   ` mailings
  2013-04-08 18:25     ` cgit
  2013-04-08 18:30     ` john
  2013-04-08 18:22   ` john
  1 sibling, 2 replies; 24+ messages in thread
From: mailings @ 2013-04-08 18:16 UTC (permalink / raw)




On 08/04/13 20:12, 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...

Correction, when reverting back to my previous cgit, I see that these
files are accessed, but cgit works properly there.


> 
> 
> 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
> 
> 
> 
> 
> 
> 
> 
> On 08/04/13 10:00, John Keeping wrote:
>> This requires a small change to how we handle notes, but otherwise just
>> works.
>>
>> Note that we can't use anything from v1.8.0 until v1.8.2.1 because some
>> of the symbols that we need for graph drawing were made private in
>> v1.8.0 and this was not reverted until v1.8.2.1.
>>
>> Signed-off-by: John Keeping <john at keeping.me.uk>
>> ---
>>  Makefile    | 2 +-
>>  git         | 2 +-
>>  ui-commit.c | 3 ++-
>>  ui-log.c    | 6 +++---
>>  4 files changed, 7 insertions(+), 6 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 83d4716..59edab0 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -14,7 +14,7 @@ htmldir = $(docdir)
>>  pdfdir = $(docdir)
>>  mandir = $(prefix)/share/man
>>  SHA1_HEADER = <openssl/sha.h>
>> -GIT_VER = 1.7.12.4
>> +GIT_VER = 1.8.2.1
>>  GIT_URL = https://git-core.googlecode.com/files/git-$(GIT_VER).tar.gz
>>  INSTALL = install
>>  MAN5_TXT = $(wildcard *.5.txt)
>> diff --git a/git b/git
>> index 7e20105..5bda18c 160000
>> --- a/git
>> +++ b/git
>> @@ -1 +1 @@
>> -Subproject commit 7e2010537e96d0a1144520222f20ba1dc3d61441
>> +Subproject commit 5bda18c186e455f8e65f976d3bf333ab1f4b5b53
>> diff --git a/ui-commit.c b/ui-commit.c
>> index 0783285..5a552a1 100644
>> --- a/ui-commit.c
>> +++ b/ui-commit.c
>> @@ -36,7 +36,8 @@ void cgit_print_commit(char *hex, const char *prefix)
>>  	}
>>  	info = cgit_parse_commit(commit);
>>  
>> -	format_note(NULL, sha1, &notes, PAGE_ENCODING, 0);
>> +	init_display_notes(NULL);
>> +	format_display_notes(sha1, &notes, PAGE_ENCODING, 0);
>>  
>>  	load_ref_decorations(DECORATE_FULL_REFS);
>>  
>> diff --git a/ui-log.c b/ui-log.c
>> index aaffb4e..8d8b235 100644
>> --- a/ui-log.c
>> +++ b/ui-log.c
>> @@ -195,9 +195,8 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
>>  				strbuf_addstr(&msgbuf, info->msg);
>>  				strbuf_addch(&msgbuf, '\n');
>>  			}
>> -			format_note(NULL, commit->object.sha1, &msgbuf,
>> -			            PAGE_ENCODING,
>> -			            NOTES_SHOW_HEADER | NOTES_INDENT);
>> +			format_display_notes(commit->object.sha1,
>> +					     &msgbuf, PAGE_ENCODING, 0);
>>  			strbuf_addch(&msgbuf, '\n');
>>  			strbuf_ltrim(&msgbuf);
>>  		}
>> @@ -397,6 +396,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
>>  		commit->parents = NULL;
>>  	}
>>  
>> +	init_display_notes(NULL);
>>  	for (i = 0; i < cnt && (commit = get_revision(&rev)) != NULL; i++) {
>>  		print_commit(commit, &rev);
>>  		free(commit->buffer);
>>
> 

-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:12 ` mailings
  2013-04-08 18:16   ` mailings
@ 2013-04-08 18:22   ` john
  2013-04-08 18:38     ` mailings
  1 sibling, 1 reply; 24+ messages in thread
From: john @ 2013-04-08 18:22 UTC (permalink / raw)


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

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




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:16   ` mailings
@ 2013-04-08 18:25     ` cgit
  2013-04-08 18:31       ` Jason
  2013-04-08 18:30     ` john
  1 sibling, 1 reply; 24+ messages in thread
From: cgit @ 2013-04-08 18:25 UTC (permalink / raw)


On Mon, Apr 08, 2013 at 08:16:14PM +0200, Ferry Huberts wrote:
> 
> 
> On 08/04/13 20:12, 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...
> 
> Correction, when reverting back to my previous cgit, I see that these
> files are accessed, but cgit works properly there.

Works fine here.

You should try to run cgit from the command line (setting all
environment variables that are needed) and see if it crashes. If so,
please get a backtrace.

> 
> 
> > 
> > 
> > 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
> > 
> [...]




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:16   ` mailings
  2013-04-08 18:25     ` cgit
@ 2013-04-08 18:30     ` john
  2013-04-08 18:37       ` Jason
  1 sibling, 1 reply; 24+ messages in thread
From: john @ 2013-04-08 18:30 UTC (permalink / raw)


On Mon, Apr 08, 2013 at 08:16:14PM +0200, Ferry Huberts wrote:
> 
> 
> On 08/04/13 20:12, 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...
> 
> Correction, when reverting back to my previous cgit, I see that these
> files are accessed, but cgit works properly there.

I think this is a behaviour change in Git then.

Having looked a bit more, there are environment variables to suppress
these lookups.  I wonder if we should set them in CGit, or is that
likely to lose behaviour people want?




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:25     ` cgit
@ 2013-04-08 18:31       ` Jason
  0 siblings, 0 replies; 24+ messages in thread
From: Jason @ 2013-04-08 18:31 UTC (permalink / raw)


On Mon, Apr 8, 2013 at 8:25 PM, Lukas Fleischer <cgit at cryptocrack.de> wrote:
> You should try to run cgit from the command line (setting all
> environment variables that are needed) and see if it crashes. If so,
> please get a backtrace.

Exactly. Get a backtrace if possible.

If it is related to a misplaced /root/etc/gitconfig kind of thing,
that's something we should fix in cgit. Perhaps regardless, cgit's git
should be using /dev/null, or not even loading that file anyway.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:30     ` john
@ 2013-04-08 18:37       ` Jason
  0 siblings, 0 replies; 24+ messages in thread
From: Jason @ 2013-04-08 18:37 UTC (permalink / raw)


zx2c4 at thinkpad ~/Projects/cgit $ QUERY_STRING="url=foo/log"
CGIT_CONFIG=tests/trash/cgitrc strace -e access ./cgit 2>&1 >/dev/null
| grep gitconfig
access("/home/zx2c4/etc/gitconfig", R_OK) = -1 ENOENT (No such file or
directory)
access("/home/zx2c4/.gitconfig", R_OK)  = 0
access("/home/zx2c4/etc/gitconfig", R_OK) = -1 ENOENT (No such file or
directory)
access("/home/zx2c4/.gitconfig", R_OK)  = 0


Interesting.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:22   ` john
@ 2013-04-08 18:38     ` mailings
  2013-04-08 18:39       ` Jason
                         ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: mailings @ 2013-04-08 18:38 UTC (permalink / raw)




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




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:38     ` mailings
@ 2013-04-08 18:39       ` Jason
  2013-04-08 18:42         ` mailings
  2013-04-08 18:43       ` 
  2013-04-08 18:47       ` john
  2 siblings, 1 reply; 24+ messages in thread
From: Jason @ 2013-04-08 18:39 UTC (permalink / raw)


On Mon, Apr 8, 2013 at 8:38 PM, Ferry Huberts <mailings at hupie.com> wrote:
> ok that seems to work.
> Adjusting my deploy script.

Would you keep around the crashing config as well though so that we
can be sure we've nabbed it?




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:39       ` Jason
@ 2013-04-08 18:42         ` mailings
  0 siblings, 0 replies; 24+ messages in thread
From: mailings @ 2013-04-08 18:42 UTC (permalink / raw)




On 08/04/13 20:39, Jason A. Donenfeld wrote:
> On Mon, Apr 8, 2013 at 8:38 PM, Ferry Huberts <mailings at hupie.com> wrote:
>> ok that seems to work.
>> Adjusting my deploy script.
> 
> Would you keep around the crashing config as well though so that we
> can be sure we've nabbed it?
> 

that is easy to reproduce: make sure cgit accesses files on which it'll
get a permission denied (don't create the config.mak)

It gets a permission denied because of SELinux.



-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:38     ` mailings
  2013-04-08 18:39       ` Jason
@ 2013-04-08 18:43       ` 
  2013-04-08 18:47       ` john
  2 siblings, 0 replies; 24+ messages in thread
From:  @ 2013-04-08 18:43 UTC (permalink / raw)


Am 08.04.2013 20:38, schrieb Ferry Huberts:
> 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.

I'm pretty sure that this is a flaw in git 1.8.x. My git-server also
broke down due to the very same problem. Had to explicitly set a
non-root/ HOME in the startup script for git-server to circumvent this.

- Ren?




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:38     ` mailings
  2013-04-08 18:39       ` Jason
  2013-04-08 18:43       ` 
@ 2013-04-08 18:47       ` john
  2013-04-08 18:48         ` Jason
  2 siblings, 1 reply; 24+ messages in thread
From: john @ 2013-04-08 18:47 UTC (permalink / raw)


On Mon, Apr 08, 2013 at 08:38:06PM +0200, Ferry Huberts wrote:
> > 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.

There was a change in Git to promote permission denied from a silent
failure to a warning (IIRC).  I'm surprised that this causes CGit to
exit but I haven't followed that code carefully.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Update git to v1.8.2.1
  2013-04-08 18:47       ` john
@ 2013-04-08 18:48         ` Jason
  2013-04-08 18:52           ` [PATCH] Do not load system gitconfig and gitattributes john
  0 siblings, 1 reply; 24+ messages in thread
From: Jason @ 2013-04-08 18:48 UTC (permalink / raw)


On Mon, Apr 8, 2013 at 8:47 PM, John Keeping <john at keeping.me.uk> wrote:
> There was a change in Git to promote permission denied from a silent
> failure to a warning (IIRC).  I'm surprised that this causes CGit to
> exit but I haven't followed that code carefully.

Triaging. Standby.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Do not load system gitconfig and gitattributes
  2013-04-08 18:48         ` Jason
@ 2013-04-08 18:52           ` john
  2013-04-08 18:55             ` Jason
  0 siblings, 1 reply; 24+ messages in thread
From: john @ 2013-04-08 18:52 UTC (permalink / raw)


Since we do not explicitly configure Git's build, the system
configuration directory will point at $HOME/etc which is unlikely to be
useful and may be very bad, for example if the user builds as root then
the files will be inaccessible and cause CGit to exit prematurely.

Fix this by exporting GIT_ATTR_NOSYSTEM=1 and GIT_CONFIG_NOSYSTEM=1 at
the beginning of main.  Note that we use setenv with overwrite=0 so that
users who require this functionality can still get it by setting the
variables to "0" or "false" before invoking CGit.

Reported-by: Ferry Huberts <ferry.huberts at pelagic.nl>
Signed-off-by: John Keeping <john at keeping.me.uk>
---
On Mon, Apr 08, 2013 at 08:48:19PM +0200, Jason A. Donenfeld wrote:
> On Mon, Apr 8, 2013 at 8:47 PM, John Keeping <john at keeping.me.uk> wrote:
> > There was a change in Git to promote permission denied from a silent
> > failure to a warning (IIRC).  I'm surprised that this causes CGit to
> > exit but I haven't followed that code carefully.
> 
> Triaging. Standby.

I think this patch is sensible regardless of the cause...

 cgit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cgit.c b/cgit.c
index f73c7b0..78805c7 100644
--- a/cgit.c
+++ b/cgit.c
@@ -815,6 +815,9 @@ int main(int argc, const char **argv)
 	const char *path;
 	int err, ttl;
 
+	setenv("GIT_ATTR_NOSYSTEM", "1", 0);
+	setenv("GIT_CONFIG_NOSYSTEM", "1", 0);
+
 	prepare_context(&ctx);
 	cgit_repolist.length = 0;
 	cgit_repolist.count = 0;
-- 
1.8.2.694.ga76e9c3.dirty





^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Do not load system gitconfig and gitattributes
  2013-04-08 18:52           ` [PATCH] Do not load system gitconfig and gitattributes john
@ 2013-04-08 18:55             ` Jason
  2013-04-08 19:00               ` mailings
  0 siblings, 1 reply; 24+ messages in thread
From: Jason @ 2013-04-08 18:55 UTC (permalink / raw)


On Mon, Apr 8, 2013 at 8:52 PM, John Keeping <john at keeping.me.uk> wrote:
>> Triaging. Standby.
>
> I think this patch is sensible regardless of the cause...

Just committed the same patch 15 seconds ago! Excellent race! *wipes
sweat off brow*




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Do not load system gitconfig and gitattributes
  2013-04-08 18:55             ` Jason
@ 2013-04-08 19:00               ` mailings
  2013-04-08 19:02                 ` Jason
  0 siblings, 1 reply; 24+ messages in thread
From: mailings @ 2013-04-08 19:00 UTC (permalink / raw)


can you put in John's text and push it out please?

thanks guys

On 08/04/13 20:55, Jason A. Donenfeld wrote:
> On Mon, Apr 8, 2013 at 8:52 PM, John Keeping <john at keeping.me.uk> wrote:
>>> Triaging. Standby.
>>
>> I think this patch is sensible regardless of the cause...
> 
> Just committed the same patch 15 seconds ago! Excellent race! *wipes
> sweat off brow*
> 
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit
> 

-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Do not load system gitconfig and gitattributes
  2013-04-08 19:00               ` mailings
@ 2013-04-08 19:02                 ` Jason
  2013-04-08 19:15                   ` Jason
  0 siblings, 1 reply; 24+ messages in thread
From: Jason @ 2013-04-08 19:02 UTC (permalink / raw)


On Mon, Apr 8, 2013 at 9:00 PM, Ferry Huberts <mailings at hupie.com> wrote:
> can you put in John's text and push it out please?

Not yet, but in a few minutes I should be set. There are still a
couple issues with this. I'm working it out so that there are no
accesses to $HOME or elsewhere outside of the repository, to eliminate
possible attack vectors.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Do not load system gitconfig and gitattributes
  2013-04-08 19:02                 ` Jason
@ 2013-04-08 19:15                   ` Jason
  2013-04-08 19:24                     ` john
  2013-04-08 19:28                     ` mailings
  0 siblings, 2 replies; 24+ messages in thread
From: Jason @ 2013-04-08 19:15 UTC (permalink / raw)


This commit is a little bit more complicated, but gets the job done:

http://git.zx2c4.com/cgit/commit/?h=wip&id=542eb90605bc07f44efe46a0e3ffe0ac4aa0e94b
http://git.zx2c4.com/cgit/patch/?h=wip&id=542eb90605bc07f44efe46a0e3ffe0ac4aa0e94b

It's currently in WIP. I'll merge it to master soon if there are no regressions.

Ferry -- please test?




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Do not load system gitconfig and gitattributes
  2013-04-08 19:15                   ` Jason
@ 2013-04-08 19:24                     ` john
  2013-04-08 19:29                       ` Jason
  2013-04-08 19:28                     ` mailings
  1 sibling, 1 reply; 24+ messages in thread
From: john @ 2013-04-08 19:24 UTC (permalink / raw)


On Mon, Apr 08, 2013 at 09:15:42PM +0200, Jason A. Donenfeld wrote:
> This commit is a little bit more complicated, but gets the job done:
> 
> http://git.zx2c4.com/cgit/commit/?h=wip&id=542eb90605bc07f44efe46a0e3ffe0ac4aa0e94b
> http://git.zx2c4.com/cgit/patch/?h=wip&id=542eb90605bc07f44efe46a0e3ffe0ac4aa0e94b
> 
> It's currently in WIP. I'll merge it to master soon if there are no regressions.
> 
> Ferry -- please test?

Would you mind posting the commit here as well?  It makes it easier for
us to review and provide feedback should there be any.




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Do not load system gitconfig and gitattributes
  2013-04-08 19:15                   ` Jason
  2013-04-08 19:24                     ` john
@ 2013-04-08 19:28                     ` mailings
  1 sibling, 0 replies; 24+ messages in thread
From: mailings @ 2013-04-08 19:28 UTC (permalink / raw)


I built wip 'the old way' and it seems to work ok.
no crash and nothing in the logs.

consider that a

Tested-by: Ferry Huberts <ferry.huberts at pelagic.nl>

On 08/04/13 21:15, Jason A. Donenfeld wrote:
> This commit is a little bit more complicated, but gets the job done:
> 
> http://git.zx2c4.com/cgit/commit/?h=wip&id=542eb90605bc07f44efe46a0e3ffe0ac4aa0e94b
> http://git.zx2c4.com/cgit/patch/?h=wip&id=542eb90605bc07f44efe46a0e3ffe0ac4aa0e94b
> 
> It's currently in WIP. I'll merge it to master soon if there are no regressions.
> 
> Ferry -- please test?
> 

-- 
Ferry Huberts




^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH] Do not load system gitconfig and gitattributes
  2013-04-08 19:24                     ` john
@ 2013-04-08 19:29                       ` Jason
  0 siblings, 0 replies; 24+ messages in thread
From: Jason @ 2013-04-08 19:29 UTC (permalink / raw)


On Mon, Apr 8, 2013 at 9:24 PM, John Keeping <john at keeping.me.uk> wrote:
> Would you mind posting the commit here as well?  It makes it easier for
> us to review and provide feedback should there be any.

With pleasure.




^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-04-08 19:29 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-08  8:00 [PATCH] Update git to v1.8.2.1 john
2013-04-08  8:42 ` mailings
2013-04-08 13:41 ` Jason
2013-04-08 18:12 ` mailings
2013-04-08 18:16   ` mailings
2013-04-08 18:25     ` cgit
2013-04-08 18:31       ` Jason
2013-04-08 18:30     ` john
2013-04-08 18:37       ` Jason
2013-04-08 18:22   ` john
2013-04-08 18:38     ` mailings
2013-04-08 18:39       ` Jason
2013-04-08 18:42         ` mailings
2013-04-08 18:43       ` 
2013-04-08 18:47       ` john
2013-04-08 18:48         ` Jason
2013-04-08 18:52           ` [PATCH] Do not load system gitconfig and gitattributes john
2013-04-08 18:55             ` Jason
2013-04-08 19:00               ` mailings
2013-04-08 19:02                 ` Jason
2013-04-08 19:15                   ` Jason
2013-04-08 19:24                     ` john
2013-04-08 19:29                       ` Jason
2013-04-08 19:28                     ` mailings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).