Re: [Bugs] unknown IPsec command `verify' when file there but nox +x

Michael Richardson <[email protected]>
Newsgroups gmane.network.freeswan.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----


>>>>> "Paul" == Paul Wouters <[email protected]> writes:
    Paul> While copying a downloaded verify command, it ended up in the libexec
    Paul> tree without execution bit set.
    Paul> The error I got was:

    Paul> /usr/local/sbin/ipsec: unknown IPsec command `verify' (`ipsec --help' for list)

    Paul> Perhaps a slightly less misleading error could replace it?

    Paul> /usr/local/sbin/ipsec: unknown IPsec command `verify' failed to execute 

    Paul> or something like that?

  Hmm. I've changed the logic as follows.

  If it is in libexec, then if it exists, then it must be legit. If it does
not execute, then we warn about it. If it exists only in LIBDIR, then it must
be executable, otherwise, we do not consider it a valid command.

  Does this seem reasonable?

path="$IPSEC_EXECDIR/$cmd"

if test ! -f "$path" 
then
    path="$IPSEC_LIBDIR/$cmd"
    if test ! -x "$path"
    then
	echo "$0: unknown IPsec command \`$cmd' (\`ipsec --help' for list)" >&2
	exit 1
    fi
fi

if test ! -x "$path"
then
    echo "$0: unknown IPsec command \'$cmd' - not executable >&2"
fi

exec $path "$@"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Finger me for keys

iQCVAwUBPkE//oqHRg3pndX9AQFt3gP/ZK9/U0O5jEZ+stH+JF5kKVSBIoB+qREr
XxXGvJi2zaqDLIYARq8dGElu31+axZI4Va3vDtxz48DxySrIHarim8evQirC1uTd
wDFYJqBfcHqMlUln1EPw3izR7d/5yrv9y29BW+VYTpe/OL6TReki/7nOdAyuEH10
DozovG2OOkI=
=YhcX
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.