List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 1/1] scan-tree: handle error in git_config_from_file()
Date: Tue, 8 Mar 2016 14:59:08 +0000	[thread overview]
Message-ID: <20160308145908.GE17523@serenity.lan> (raw)
In-Reply-To: <20160308155422.1c529572@leda.localdomain>

On Tue, Mar 08, 2016 at 03:54:22PM +0100, Christian Hesse wrote:
> John Keeping <john at keeping.me.uk> on Tue, 2016/03/08 14:36:
> > On Tue, Mar 08, 2016 at 03:26:23PM +0100, Christian Hesse wrote:
> > > John Keeping <john at keeping.me.uk> on Tue, 2016/03/08 14:11:  
> > > > On Tue, Mar 08, 2016 at 02:51:46PM +0100, Christian Hesse wrote:  
> > > > > From: Christian Hesse <mail at eworm.de>
> > > > > 
> > > > > Signed-off-by: Christian Hesse <mail at eworm.de>    
> > > > 
> > > > Is this solving a particular problem or did you just notice that the
> > > > return value is ignored?
> > > > 
> > > > I don't think returning when this fails is correct because we've already
> > > > added the repository to the list by this point and a lot of the
> > > > remaining code in this function will do something sensible even if
> > > > git_config_from_file() fails.
> > > > 
> > > > In fact, git_config_from_file() sets the die_on_error flag for
> > > > do_config_from() so the only case that gives us an error here is if the
> > > > config file cannot be opened.  I don't think it's unreasonable to print
> > > > an error if that happens but bailing out of the function at this point
> > > > is wrong.  
> > > 
> > > Ok, probably you are right...
> > > 
> > > Actually I do have a particular problem, but it is not solved by
> > > this patch. :-p Just stumbled and thought it is a good idea.
> > > 
> > > I have a repository that has a config with bad permissions, so http
> > > server's user can not read it. cgit does not print http headers and http
> > > server bails out with error 500. What path does it take?  
> > 
> > Hmm... bad permissions should result in fopen(2) failing, which would
> > take the path altered in your patch.
> > 
> > Can you run cgit as the http server's user from a terminal like this:
> > 
> > 	CGIT_CONFIG=/path/to/cgitrc QUERY_STRING=url=/ cgit
> > 
> > ?  It might produce an error message that your http server isn't
> > logging.
> 
> It gives:
> 
> Error reading config /path/to/repository.git/config: Permission denied (13)
> fatal: unable to access '/path/to/repository.git/config': Permission denied
> 
> Looks like this is fatal in git...

Is that when listing repositories or when trying to display that
specific repo?  I suspect that's a result of prepare_repo_cmd() setting
up for a specific repository.


  reply	other threads:[~2016-03-08 14:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 13:51 list
2016-03-08 14:05 ` Jason
2016-03-08 14:11 ` john
2016-03-08 14:26   ` list
2016-03-08 14:36     ` john
2016-03-08 14:54       ` list
2016-03-08 14:59         ` john [this message]
2016-03-08 15:01           ` list
2016-03-08 15:05             ` john
2016-03-08 15:08             ` list
2016-03-09 10:16 ` [PATCH v2 " list
2016-03-09 11:05   ` Jason
2016-03-11  7:49     ` list

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160308145908.GE17523@serenity.lan \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).