git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Local git server can't serve https until repos owned by http, can't serve ssh unless repos owned by user after 2.45.1

From
DRDavid C. Rankin <drankinatty@gmail.com>
Date
Jul 28, 2024, 06:57 UTC
Message-ID
<0ae914c6-70be-44b8-a6b8-53f0b15d5674@gmail.com>
In-Reply-To
<202407280346.46S3khd9005129@donotpassgo.dyslexicfish.net>
On 7/27/24 10:46 PM, Jamie Landeg-Jones wrote:
Show 11 quoted lines
>  From what I gather, the idea was to stop a client user from unintentionally
> running potential hook scripts that could be evil. A similar protection was
> already present, I note, for other methods (I couldn't run git log and other
> commands directly on a repo i had unix-level read access to, but were owned
> by another user until I added the safe directory thing in .gitconfig)
> 
> Closing this hole to make security more consistent is fair enough... however,
> in the case of git-http-backend the "safe directory" method doesn't work at
> all!
> 
> Is this an accurate summary of the situation?
Yes it is.
   Prior to the change, the repositories on my git server were owned by the 
user with push privileges and all repositories would still be cloned over 
https. Now unless the files are owned by http (what the web server runs as on 
Archlinux), https users cannot update their repositories anymore. Changes 
pushed to the server by the user with ssh access (and owner of the files) 
cannot be pulled over https.
   On the other side of the issue, if I make the webserver the owner of the 
repos, the ssh user cannot push or pull.
   Gitweb remains happy no matter the ownership.
   I'm all for more security and welcome it, but you have to provide a way to 
configure it so that prior functionality is simply not broken. I'll have to 
search and find the little truth-table style of repo user:group ownership and 
the resulting succeed:fail with push/pull from the server.
   I'd be happy if the docs were just updated with a concise explanation of 
how to support both ssh and https to the same repo running under Apache -- if 
that is doable. It must be, github does it. I haven't had the time I'd like to 
to further investigate. Next month looks better.
-- 
David C. Rankin, J.D.,P.E.
Previous: Jamie Landeg-JonesNext: Jamie Landeg-Jones
Message 16 of 20 in “Local git server can't serve https until repos owned by http, can't serve ssh unless repos owned by user after 2.45.1”
  1. David C. RankinJun 17, 2024
  2. Junio C HamanoJun 17, 2024
  3. Michal SuchánekJun 17, 2024
  4. Michal SuchánekJun 25, 2024
  5. Junio C HamanoJun 25, 2024
  6. Michal SuchánekJun 25, 2024
  7. Phillip WoodJun 26, 2024
  8. Junio C HamanoJun 26, 2024
  9. Phillip WoodJun 26, 2024
  10. Junio C HamanoJun 26, 2024
  11. Michal SuchánekSep 25, 2024
  12. Joey HessAug 29, 2024
  13. Jamie Landeg-JonesJul 26, 2024
  14. David C. RankinJul 26, 2024
  15. Jamie Landeg-JonesJul 28, 2024
  16. David C. RankinJul 28, 2024
  17. [SOLVED] Re: Local git server can't serve https until repos owned by http, can't serve ssh unless repos owned by user after 2.45.1Jamie Landeg-Jones, Aug 1, 2024
  18. Junio C HamanoAug 2, 2024
  19. David C. RankinJun 18, 2024
  20. Junio C HamanoJun 24, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.