Re: [PATCH] nwfilter: use /bin/sh rather than requiring bash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/15/2010 07:18 PM, Eric Blake wrote:
On 11/13/2010 05:04 PM, Stefan Berger wrote:
On 11/13/2010 04:52 PM, Eric Blake wrote:
* src/nwfilter/nwfilter_ebiptables_driver.c
(ebiptablesWriteToTempFile): Use /bin/sh.
(bash_cmd_path): Delete.
(ebiptablesDriverInit, ebiptablesDriverShutdown): No need to
search for bash.
(CMD_EXEC): Prefer $() over ``, since we can assume POSIX.
(iptablesSetupVirtInPost): Use portable 'test' syntax.
(iptablesLinkIPTablesBaseChain): Use POSIX $(()) syntax.
Since you are the expert with shells and I trust that the TCK tests now
pass with all possible /bin/sh's, you get my ACK.
Well, at least with all POSIX-compliant /bin/sh, which is what Linux is
likely to have, and nwfilter requires Linux.

It won't work with Solaris /bin/sh, but that's a much harder portability
target since it is so old (bourne shell, which pre-dates POSIX).  But
thankfully not an issue for this patch.

I've gone ahead and pushed it.

Unfortunately it doesn't work. The code produces a file like this now for some basic probing. The file now has a syntax error.

#!/bin/sh
cmd='/sbin/iptables -n -L FORWARD'
eval res=\$("${cmd}")
if [ $? -ne 0 ]; then echo "Failure to execute command '${cmd}'."; exit 1;fi

   Stefan

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]