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

Re: [PATCH] "git shell" won't work, need "git-shell"

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 25, 2008, 20:28 UTC
Message-ID
<alpine.DEB.1.00.0808252225520.24820@pacific.mpi-cbg.de.mpi-cbg.de>
In-Reply-To
<alpine.DEB.1.00.0808252206150.24820@pacific.mpi-cbg.de.mpi-cbg.de>
Hi,
On Mon, 25 Aug 2008, Johannes Schindelin wrote:
Show 35 quoted lines
> On Mon, 25 Aug 2008, Mikael Magnusson wrote:
> 
> > 2008/8/25 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
> >
> > > On Mon, 25 Aug 2008, Paolo Bonzini wrote:
> > >
> > >> > That would involve you actually finding out what's happening, 
> > >> > though.
> > >>
> > >> He said so:
> > >>
> > >> > test:x:1001:1001:,,,:/home/test:/usr/bin/git shell
> > >> >
> > >> > just makes ssh loop asking for a password, logging
> > >> >
> > >> > "User test not allowed because shell /usr/bin/git shell does not 
> > >> > exist"
> > >
> > > Okay, so this means that you cannot pass arguments to the login shell. 
> > > Makes me wonder... I had the impression that bash was called with 
> > > --login.
> > 
> > When you login, a '-' is prepended in argv[0], ie, bash checks if it's 
> > called "-bash". This is documented in man bash, but I couldn't find it 
> > in man login or man agetty, not sure where else it might be written 
> > down.
> 
> Thanks!
> 
> So does this mean that we could check in git.c if there is a leading "-" 
> in argv[0]?  If so, then the builtin git-shell should be called by 
> default.
> 
> At least I do not expect many instances of git being called with argv[0] 
> starting with a "-"... :-)

Oh, well. I just tested again, and slapped my head when it did not work, remembering that we do _not_ call Git as a login shell. Instead, we call ssh with the "-c" option, which just passes it to the shell. Consequently, argv[0] does not get a "-" prepended.

I seem to remember that Hannes had some code to support "-c" as an indicator that Git should execute git-shell, but I just might have dreamt that, too.

Ciao, Dscho

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 11 of 28 in “"git shell" won't work, need "git-shell"”
  1. "git shell" won't work, need "git-shell"Tommi Virtanen, Aug 24, 2008
  2. Junio C HamanoAug 24, 2008
  3. Tommi VirtanenAug 24, 2008
  4. Junio C HamanoAug 24, 2008
  5. Tommi VirtanenAug 24, 2008
  6. Johannes SchindelinAug 25, 2008
  7. Paolo BonziniAug 25, 2008
  8. Johannes SchindelinAug 25, 2008
  9. Mikael MagnussonAug 25, 2008
  10. Johannes SchindelinAug 25, 2008
  11. Johannes SchindelinAug 25, 2008
  12. 1/2 git wrapper: Make while loop more reader-friendlyJohannes Schindelin, Aug 25, 2008
  13. 2/2 git wrapper: execute git-shell when argv[1] is '-c'Johannes Schindelin, Aug 25, 2008
  14. Tommi VirtanenAug 25, 2008
  15. Johannes SchindelinAug 25, 2008
  16. Tommi VirtanenAug 25, 2008
  17. Johannes SchindelinAug 26, 2008
  18. Matthieu MoyAug 26, 2008
  19. Junio C HamanoAug 26, 2008
  20. Mike RalphsonAug 26, 2008
  21. Petr BaudisAug 25, 2008
  22. Dmitry PotapovAug 25, 2008
  23. Tommi VirtanenAug 25, 2008
  24. Dmitry PotapovAug 25, 2008
  25. Johannes SchindelinAug 25, 2008
  26. Dmitry PotapovAug 25, 2008
  27. Mike HommeyAug 25, 2008
  28. Dmitry V. LevinOct 28, 2008

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.