[Swan-commit] Changes to ref refs/heads/master

Paul Wouters paul at vault.libreswan.fi
Mon Jun 20 19:07:28 UTC 2016


New commits:
commit 31696a9cd7bd32cfc9994b2dce888c8e4ba4024f
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Mon Jun 20 15:06:47 2016 -0400

    scripts: avoid bashism and other risks of echo
    
    -e and -n are arguments to /bin/echo and work in bash's builtin echo.
    
    Other shells, like posh and dash, do not support -e and -n.
    
    With /bin/sh supplied by dash, i see:
    
    ```
    0 dkg at alice:~$ /usr/sbin/ipsec --help
    Usage: ipsec <command> <argument ...>
    where <command> is one of:
    
    	start-e -n
    stop
    	restart-e -n
    status
    	import-e -n
    initnss
    	checknss-e -n
    checknflog
    	addconn-e -n
    auto
    	barf-e -n
    ikeping
    	look-e -n
    newhostkey
    	pluto-e -n
    readwriteconf
    	rsasigkey-e -n
    setup
    	showhostkey-e -n
    verify
    	whack
    
    See also: man ipsec <command> or ipsec <command> --help
    See <https://libreswan.org/> for more general info.
    Linux Libreswan 3.18dr2 (netkey) on 4.5.0-2-amd64
    0 dkg at alice:~$
    ```
    
    Also, when supplying variables as the first part text to echo, there
    is a risk that the parameters may start with a -.  In that case, some
    implementations of echo will treat the entire string as arguments,
    which will likely fail.
    
    Using printf instead resolves these problems.  This patch fixes ipsec
    and newhostkey.  It would probably be wortwhile to scan through the
    rest of the code to fix issues like this (perhaps just uniformly
    remove echo in most places?), but i have not had time to do so.

commit 5bd3ce0e2b07d5232f7b56a32efcad60a7f8cdd1
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Mon Jun 20 15:05:02 2016 -0400

    avoid another flex/gcc warning
    
    Signed-off-by: Paul Wouters <pwouters at redhat.com>



More information about the Swan-commit mailing list