git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: David McGough <dmcgough@opentext.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Smart HTTP push permissions failure
Date: Wed, 24 Aug 2016 13:00:28 -0400	[thread overview]
Message-ID: <20160824170028.y4kr5jchsnb5xdge@sigill.intra.peff.net> (raw)
In-Reply-To: <89CBBBEBEE33F5469A9FA456B5F70625CCDB9BEB@otwlxg20.opentext.net>

On Tue, Aug 23, 2016 at 03:45:33PM +0000, David McGough wrote:

> When I try to push to the server I get this message:
> remote: error: insufficient permission for adding an object to repository database ./objects
> remote: fatal: failed to write object
> [...]
> So I am pretty confused about what the issue.  Which OS user is git
> using to write the files?  I hope somebody can help me understand why
> the project cannot be pushed to the git server.

For a smart-http push, it will be whatever user the web server execs the
CGI as. So I'd think "apache" would be the default, but it's possible
that it runs CGIs as a different user, depending on your config.

One possibility may be to add a simple shell script CGI that does
something like:

  #!/bin/sh
  echo "Content-type: text/plain"
  echo
  id

just to see what's happening.

Based on the data you showed, here are some wild possibilities I can
think of:

  - the CGI runs as "apache", but your files are owned by "git".
    "apache" is in the "staff" group, and the directories all have write
    permission for that group. But are we sure that apache does not shed
    any group permissions when running a CGI? The "id" script above
    should hopefully show that.

  - You mentioned CentOS. It has been a while since I dealt with RHEL
    and its derivatives, but I think selinux is turned on by default
    there. Is it possible that the webserver runs in an selinux profile
    that does not allow writing to the repository directory?

    I don't recall the specifics of debugging selinux problems, but
    there may be logs there.

Sorry those are just stabs in the dark, but I don't see anything else
obviously wrong with what you've posted.

-Peff

  reply	other threads:[~2016-08-24 17:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 15:45 Smart HTTP push permissions failure David McGough
2016-08-24 17:00 ` Jeff King [this message]
2016-08-25 18:33   ` David McGough

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20160824170028.y4kr5jchsnb5xdge@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=dmcgough@opentext.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).