Permalink
Commits on Mar 14, 2016
  1. Bump default java to 1.8

    committed Mar 14, 2016
  2. Fix the bluetooth daemon

    committed Mar 14, 2016
Commits on Jan 27, 2016
  1. Add GNU parallel

    committed Jan 27, 2016
  2. Remove eclipse

    committed Jan 27, 2016
Commits on Jan 19, 2016
  1. Ignore config/

    committed Jan 19, 2016
  2. Remove pentadactyl config

    committed Jan 19, 2016
Commits on Jan 11, 2016
  1. Delete old and unused config

    committed Jan 11, 2016
Commits on Nov 26, 2015
  1. colored completions

    committed Nov 26, 2015
  2. ignore minified js files

    committed Nov 26, 2015
  3. Set `$SHELL` to /bin/bash, to get `ssh`'s `-oProxyCommand` to work se…

    …emlessly
    
    `ssh` uses the value of `$SHELL` to execute the proxy command, so this value
    needs to be the path to an actual shell.
    
    ---
    
    The issue manifests itself like this:
    
        $ ssh some-host
        bash: No such file or directory
        ssh_exchange_identification: Connection closed by remote host
        $ ssh -vvv some-host
        OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
        debug1: Reading configuration data /etc/ssh/ssh_config
        debug1: Applying options for *
        debug2: ssh_connect: needpriv 0
        debug1: Executing proxy command: exec /usr/bin/sss_ssh_knownhostsproxy -p 22 some-host
        debug1: permanently_drop_suid: 850801287
        bash: No such file or directory
        debug1: identity file /home/adaboville/.ssh/identity type -1
        debug1: identity file /home/adaboville/.ssh/identity-cert type -1
        debug1: identity file /home/adaboville/.ssh/id_rsa type -1
        debug1: identity file /home/adaboville/.ssh/id_rsa-cert type -1
        debug1: identity file /home/adaboville/.ssh/id_dsa type -1
        debug1: identity file /home/adaboville/.ssh/id_dsa-cert type -1
        debug1: identity file /home/adaboville/.ssh/id_ecdsa type -1
        debug1: identity file /home/adaboville/.ssh/id_ecdsa-cert type -1
        ssh_exchange_identification: Connection closed by remote host
        $
    
    Similar errors are common:
    
        $ <fake :
        bash: fake: No such file or directory
        $ ./fake
        bash: ./fake: No such file or directory
        $
    
    This left me confused. How could `/usr/bin/sss_ssh_knownhostsproxy` not be
    found despite being an absolute path? Maybe `ssh` wasn't executing what I
    thought it was? To make sure I checked
    `strace -ff -v -s128 -o out- ssh some-host`, it showed the following:
    
        execve("bash", ["bash", "-c", "exec /usr/bin/sss_ssh_knownhostsproxy -p 22 some-host"]
    
    Which seems to work fine in my shell:
    
        $ bash -c "exec /usr/bin/sss_ssh_knownhostsproxy -p 22 some-host"
        SSH-2.0-OpenSSH_5.3
    
    So what's the issue then? I started digging into OpenSSH's source code, in
    `sshconnect.c` in particular:
    
           1 →       if ((shell = getenv("SHELL")) == NULL || *shell == '\0')
        194  →       →       shell = _PATH_BSHELL;
        ...
          11 →       /* Fork and execute the proxy command. */
          12 →       if ((pid = fork()) == 0) {
        ...
          31 →       →       /* Stderr is left as it is so that error messages get
          32 →       →          printed on the user's terminal. */
          33 →       →       argv[0] = shell;
          34 →       →       argv[1] = "-c";
          35 →       →       argv[2] = command_string;
          36 →       →       argv[3] = NULL;
        ...
          42 →       →       execv(argv[0], argv);
    
    The code clearly shows that it `execv` the content of `$SHELL` if it's set, but
    `execv` unlike `execvp` doesn't care about `$PATH`, hence the following error:
    
    > bash: No such file or directory
    
    The `execv`/`execvp` could have been found just looking at the `strace` output,
    that being said the source code would have been needed anyway to find out that
    `ssh` was using `$SHELL`.
    
    Setting `$SHELL` to an absolute path fixes the issue:
    
        host $ SHELL=/bin/bash ssh some-host
        some-host $ # we're in!
    
    It turns out that `$SHELL` should be a pathname to an actual shell, as
    specified by POSIX, so it's definitely a bug with my configuration rather than
    `ssh`'s (though it might be a bug in `screen` too):
    
    > SHELL
    > This variable shall represent a pathname of the user's preferred command
    > language interpreter. If this interpreter does not conform to the Shell
    > Command Language in XCU Shell Command Language, utilities may behave
    > differently from those described in POSIX.1-2008.
    committed Nov 26, 2015
Commits on Nov 11, 2015
  1. Compute sum using awk

    committed Nov 11, 2015
Commits on Nov 5, 2015
Commits on Oct 22, 2015
  1. q + --with-default-names

    committed Oct 22, 2015
  2. fix manpath and gpg

    committed Oct 22, 2015
Commits on Sep 15, 2015
  1. add pass config

    committed Sep 15, 2015
  2. ignore /private/var/folders

    committed Sep 15, 2015
  3. replace file-line by vim-fetch

    committed Sep 15, 2015
Commits on Sep 8, 2015
Commits on Sep 7, 2015
  1. Run gradle as a daemon

    committed Sep 7, 2015
Commits on Aug 17, 2015
  1. file line plugin

    committed Aug 17, 2015
Commits on Jul 31, 2015
  1. make jared happy

    committed Jul 31, 2015
Commits on Jul 22, 2015
  1. pull.ff = only

    committed Jul 22, 2015
Commits on Jul 21, 2015
  1. remove useless cruft

    committed Jul 21, 2015
  2. quickly toggle mouse

    committed Jul 21, 2015
Commits on Jul 16, 2015
  1. gnu-tar

    committed Jul 16, 2015
  2. add mou

    committed Jul 16, 2015
Commits on Jul 15, 2015
  1. add pycharm

    committed Jul 15, 2015
  2. display man pages without list

    committed Jul 15, 2015