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

Re: [PATCH v2] Ensure that SSH runs in non-interactive mode

From
FTFredrik Tolf <fredrik@dolda2000.com>
Date
Jul 21, 2008, 13:04 UTC
Message-ID
<1216645452.3673.29.camel@pc7.dolda2000.com>
In-Reply-To
<alpine.DEB.1.00.0807211221310.8986@racer>
On Mon, 2008-07-21 at 12:22 +0100, Johannes Schindelin wrote:
Show 23 quoted lines
> Hi,
> 
> On Mon, 21 Jul 2008, Jeff King wrote:
> 
> > On Mon, Jul 21, 2008 at 12:56:14PM +0200, Johannes Schindelin wrote:
> > 
> > > > or syntax used in RPM spec macros
> > > > 
> > > >   %{?p:-P %p}
> > > > 
> > > > (and there is complementing %{!?<var>:<expansion>} in RPM spec macro
> > > > language).
> > > 
> > > Yes, this is overkill.  I would even have passed the port argument 
> > > _always_, since the port 22 for ssh is as likely to change as hell will 
> > > not freeze over.  Actually, I am not so sure about the latter.
> > 
> > But keep in mind that "-p 22" on the command line _overrides_ what the
> > user has in their ssh config, so it is not a good idea to pass it all
> > the time.
> 
> Oh, good point.  So we might need something distasteful as what Jakub 
> proposed... Hrmpf.
Two suggestions:
 * Use %P as I suggested. I know it is kind of ugly, but I might still
   consider it less ugly than adding full shell-style substitution to
   the code. Especially considering that it would almost only have to be
   used inside of Git. Users outside of the Git source would only very
   seldomly have to touch it. (It would essentially only be those users
   who both use alternative SSH ports *and* has an non-standard default
   in their ssh_config *and* use a custom SSH command...)
 * Put the SSH port number and host name in the environment and call
   "/bin/sh -c" with the textual concatenation of the SSH command and
   the command that Git wants to call. While a bit more ugly than
   handling word splitting internally, I don't really think that it has
   any real ill effects, seeing how the Git command is word-split on the
   remote side anyhow (I think that has to be SSH's most stupid
   "feature").
Fredrik Tolf
Previous: Johannes Schindelin
Message 8 of 8 in “Ensure that SSH runs in non-interactive mode”
  1. Ensure that SSH runs in non-interactive modeFredrik Tolf, Jul 21, 2008
  2. Johannes SchindelinJul 21, 2008
  3. Fredrik TolfJul 21, 2008
  4. Jakub NarebskiJul 21, 2008
  5. Johannes SchindelinJul 21, 2008
  6. Jeff KingJul 21, 2008
  7. Johannes SchindelinJul 21, 2008
  8. Fredrik TolfJul 21, 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.