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

Re: [PATCH] Allow git-shell to be used as a ssh forced-command

From
Mike Hommey <mh@glandium.org>
Date
Apr 17, 2009, 23:44 UTC
Message-ID
<20090417234425.GC17753@glandium.org>
In-Reply-To
<20090417224104.GT23604@spearce.org>
On Fri, Apr 17, 2009 at 03:41:04PM -0700, Shawn O. Pearce wrote:
Show 18 quoted lines
> Mike Hommey <mh@glandium.org> wrote:
> > On Sat, Apr 18, 2009 at 01:00:35AM +0400, Dmitry Potapov wrote:
> > > Besides, you made SSH_ORIGINAL_COMMAND to take precedent over explicitly
> > > specified parameters given to git-shell. Maybe it should be the other
> > > way around?
> > 
> > If SSH_ORIGINAL_COMMAND is set, which means forced-commands are in use,
> > I don't see why other parameters should be more important.
> 
> Gitosis runs by forced-command, and invokes git-shell to get to
> the real requested git command.  I'm not sure if it unsets the
> SSH_ORIGINAL_COMMAND environment variable before launching the
> git-shell...
> 
> But, in git, command line arguments override environment variables,
> which in turn override config files, which override any defaults
> that may be guessed from the host.  So Dimtry is asking that you
> follow that same convention.

Except SSH_ORIGINAL_COMMAND is not a traditional environment variable like GIT_USER_EMAIL or such. SSH_ORIGINAL_COMMAND is the only way to know from a ssh forced-command what the remote wanted to call originally. Setting a forced-command with options after git-shell, which would have to be "-c something" or "cvs server", is pointless, because you don't need it and should put that "something" as forced-command directly.

However, the patch in its current form will definitely break gitosis if it doesn't unset SSH_ORIGINAL_COMMAND.

Mike
Previous: Shawn O. PearceNext: Matthieu Moy
Message 7 of 18 in “Allow git-shell to be used as a ssh forced-command”
  1. Allow git-shell to be used as a ssh forced-commandMike Hommey, Apr 16, 2009
  2. Dmitry PotapovApr 17, 2009
  3. Mike HommeyApr 17, 2009
  4. Dmitry PotapovApr 17, 2009
  5. Mike HommeyApr 17, 2009
  6. Shawn O. PearceApr 17, 2009
  7. Mike HommeyApr 17, 2009
  8. Matthieu MoyApr 18, 2009
  9. Junio C HamanoApr 17, 2009
  10. Tommi VirtanenApr 17, 2009
  11. Junio C HamanoApr 18, 2009
  12. Mike HommeyApr 18, 2009
  13. Allow git-shell to be used as a ssh forced-commandMike Hommey, Apr 21, 2009
  14. Dmitry PotapovApr 21, 2009
  15. Eygene RyabinkinApr 21, 2009
  16. Junio C HamanoApr 21, 2009
  17. Mike HommeyApr 21, 2009
  18. Dmitry PotapovApr 21, 2009

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.