]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Merge branch 'master' into install-raid
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 Oct 2014 12:52:30 +0000 (14:52 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 Oct 2014 12:52:30 +0000 (14:52 +0200)
Conflicts:
config/rootfiles/common/bash
lfs/bash

63 files changed:
config/firewall/firewall-lib.pl
config/firewall/rules.pl
config/rootfiles/core/84/exclude [moved from config/rootfiles/core/82/exclude with 100% similarity]
config/rootfiles/core/84/filelists/bash [new symlink]
config/rootfiles/core/84/filelists/dnsmasq [new symlink]
config/rootfiles/core/84/filelists/files [new file with mode: 0644]
config/rootfiles/core/84/filelists/readline [new symlink]
config/rootfiles/core/84/filelists/squid [new symlink]
config/rootfiles/core/84/meta [moved from config/rootfiles/core/82/meta with 100% similarity]
config/rootfiles/core/84/update.sh [new file with mode: 0644]
config/rootfiles/oldcore/82/exclude [new file with mode: 0644]
config/rootfiles/oldcore/82/filelists/armv5tel/gmp [moved from config/rootfiles/core/82/filelists/armv5tel/gmp with 100% similarity]
config/rootfiles/oldcore/82/filelists/batctl [moved from config/rootfiles/core/82/filelists/batctl with 100% similarity]
config/rootfiles/oldcore/82/filelists/boost [moved from config/rootfiles/core/82/filelists/boost with 100% similarity]
config/rootfiles/oldcore/82/filelists/files [moved from config/rootfiles/core/82/filelists/files with 100% similarity]
config/rootfiles/oldcore/82/filelists/i586/gmp [moved from config/rootfiles/core/82/filelists/i586/gmp with 100% similarity]
config/rootfiles/oldcore/82/filelists/iputils [moved from config/rootfiles/core/82/filelists/iputils with 100% similarity]
config/rootfiles/oldcore/82/filelists/libnl-3 [moved from config/rootfiles/core/82/filelists/libnl-3 with 100% similarity]
config/rootfiles/oldcore/82/filelists/mpfr [moved from config/rootfiles/core/82/filelists/mpfr with 100% similarity]
config/rootfiles/oldcore/82/filelists/openssl-compat [moved from config/rootfiles/core/82/filelists/openssl-compat with 100% similarity]
config/rootfiles/oldcore/82/filelists/ppp [moved from config/rootfiles/core/82/filelists/ppp with 100% similarity]
config/rootfiles/oldcore/82/meta [new file with mode: 0644]
config/rootfiles/oldcore/82/update.sh [moved from config/rootfiles/core/82/update.sh with 100% similarity]
config/rootfiles/oldcore/83/exclude [new file with mode: 0644]
config/rootfiles/oldcore/83/filelists/bash [new symlink]
config/rootfiles/oldcore/83/filelists/files [new file with mode: 0644]
config/rootfiles/oldcore/83/filelists/findutils [new symlink]
config/rootfiles/oldcore/83/filelists/squid [new symlink]
config/rootfiles/oldcore/83/meta [new file with mode: 0644]
config/rootfiles/oldcore/83/update.sh [new file with mode: 0644]
html/cgi-bin/firewall.cgi
html/cgi-bin/fwhosts.cgi
html/cgi-bin/logs.cgi/ids.dat
html/cgi-bin/proxy.cgi
html/cgi-bin/urlfilter.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/bash
lfs/dnsmasq
lfs/glibc
lfs/parted
lfs/squid
lfs/squid-accounting
make.sh
src/initscripts/init.d/dhcrelay [changed mode: 0755->0644]
src/initscripts/init.d/firewall
src/initscripts/init.d/network
src/paks/squid-accounting/install.sh
src/patches/bash/bash32-052 [new file with mode: 0644]
src/patches/bash/bash32-053 [new file with mode: 0644]
src/patches/bash/bash43-027 [new file with mode: 0644]
src/patches/bash/bash43-028 [new file with mode: 0644]
src/patches/bash/bash43-029 [new file with mode: 0644]
src/patches/bash/bash43-030 [new file with mode: 0644]
src/patches/dnsmasq-2.71-support-nettle-3.0.patch [deleted file]
src/patches/dnsmasq-2.71-use-nettle-with-minigmp.patch [deleted file]
src/patches/dnsmasq-2.72rc2-Add-support-to-read-ISC-DHCP-lease-file.patch [moved from src/patches/dnsmasq-2.70-Add-support-to-read-ISC-DHCP-lease-file.patch with 94% similarity]
src/patches/glibc/glibc-rh1008310.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh1022022.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh1091162.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh1098050.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh1133809-1.patch [new file with mode: 0644]
src/patches/glibc/glibc-rh1133809-2.patch [new file with mode: 0644]

index c4a19e5d80caa17b6cc0dc68b612c8814da14c59..9b3f2bff43525e2d6a93c151354f006460705df8 100755 (executable)
@@ -217,7 +217,7 @@ sub get_std_net_ip
        }elsif($val eq 'BLUE'){
                return "$netsettings{'BLUE_NETADDRESS'}/$netsettings{'BLUE_NETMASK'}";
        }elsif($val eq 'RED'){
-               return "0.0.0.0/0 -o $con";
+               return "0.0.0.0/0";
        }elsif($val =~ /OpenVPN/i){
                return "$ovpnsettings{'DOVPN_SUBNET'}";
        }elsif($val =~ /IPsec/i){
@@ -226,6 +226,23 @@ sub get_std_net_ip
                return ;
        }
 }
+sub get_interface
+{
+       my $net=shift;
+       if($net eq "$netsettings{'GREEN_NETADDRESS'}/$netsettings{'GREEN_NETMASK'}"){
+               return "$netsettings{'GREEN_DEV'}";
+       }
+       if($net eq "$netsettings{'ORANGE_NETADDRESS'}/$netsettings{'ORANGE_NETMASK'}"){
+               return "$netsettings{'ORANGE_DEV'}";
+       }
+       if($net eq "$netsettings{'BLUE_NETADDRESS'}/$netsettings{'BLUE_NETMASK'}"){
+               return "$netsettings{'BLUE_DEV'}";
+       }
+       if($net eq "0.0.0.0/0"){
+               return "$netsettings{'RED_DEV'}";
+       }
+       return "";
+}
 sub get_net_ip
 {
        my $val=shift;
@@ -305,9 +322,9 @@ sub get_address
        # address. Otherwise, we assume that it is an IP address.
        if ($key ~~ ["src_addr", "tgt_addr"]) {
                if (&General::validmac($value)) {
-                       push(@ret, "-m mac --mac-source $value");
+                       push(@ret, ["-m mac --mac-source $value", ""]);
                } else {
-                       push(@ret, $value);
+                       push(@ret, [$value, ""]);
                }
 
        # If a default network interface (GREEN, BLUE, etc.) is selected, we
@@ -316,88 +333,90 @@ sub get_address
                my $external_interface = &get_external_interface();
 
                my $network_address = &get_std_net_ip($value, $external_interface);
+
                if ($network_address) {
-                       push(@ret, $network_address);
+                       my $interface = &get_interface($network_address);
+                       push(@ret, [$network_address, $interface]);
                }
 
        # Custom networks.
        } elsif ($key ~~ ["cust_net_src", "cust_net_tgt", "Custom Network"]) {
                my $network_address = &get_net_ip($value);
                if ($network_address) {
-                       push(@ret, $network_address);
+                       push(@ret, [$network_address, ""]);
                }
 
        # Custom hosts.
        } elsif ($key ~~ ["cust_host_src", "cust_host_tgt", "Custom Host"]) {
                my $host_address = &get_host_ip($value, $type);
                if ($host_address) {
-                       push(@ret, $host_address);
+                       push(@ret, [$host_address, ""]);
                }
 
        # OpenVPN networks.
        } elsif ($key ~~ ["ovpn_net_src", "ovpn_net_tgt", "OpenVPN static network"]) {
                my $network_address = &get_ovpn_net_ip($value, 1);
                if ($network_address) {
-                       push(@ret, $network_address);
+                       push(@ret, [$network_address, ""]);
                }
 
        # OpenVPN hosts.
        } elsif ($key ~~ ["ovpn_host_src", "ovpn_host_tgt", "OpenVPN static host"]) {
                my $host_address = &get_ovpn_host_ip($value, 33);
                if ($host_address) {
-                       push(@ret, $host_address);
+                       push(@ret, [$host_address, ""]);
                }
 
        # OpenVPN N2N.
        } elsif ($key ~~ ["ovpn_n2n_src", "ovpn_n2n_tgt", "OpenVPN N-2-N"]) {
                my $network_address = &get_ovpn_n2n_ip($value, 11);
                if ($network_address) {
-                       push(@ret, $network_address);
+                       push(@ret, [$network_address, ""]);
                }
 
        # IPsec networks.
        } elsif ($key ~~ ["ipsec_net_src", "ipsec_net_tgt", "IpSec Network"]) {
                my $network_address = &get_ipsec_net_ip($value, 11);
                if ($network_address) {
-                       push(@ret, $network_address);
+                       push(@ret, [$network_address, ""]);
                }
 
        # The firewall's own IP addresses.
        } elsif ($key ~~ ["ipfire", "ipfire_src"]) {
                # ALL
                if ($value eq "ALL") {
-                       push(@ret, "0/0");
+                       push(@ret, ["0/0", ""]);
 
                # GREEN
                } elsif ($value eq "GREEN") {
-                       push(@ret, $netsettings{"GREEN_ADDRESS"});
+                       push(@ret, [$netsettings{"GREEN_ADDRESS"}, ""]);
 
                # BLUE
                } elsif ($value eq "BLUE") {
-                       push(@ret, $netsettings{"BLUE_ADDRESS"});
+                       push(@ret, [$netsettings{"BLUE_ADDRESS"}, ""]);
 
                # ORANGE
                } elsif ($value eq "ORANGE") {
-                       push(@ret, $netsettings{"ORANGE_ADDRESS"});
+                       push(@ret, [$netsettings{"ORANGE_ADDRESS"}, ""]);
 
                # RED
                } elsif ($value ~~ ["RED", "RED1"]) {
                        my $address = &get_external_address();
                        if ($address) {
-                               push(@ret, $address);
+                               push(@ret, [$address, ""]);
                        }
 
                # Aliases
                } else {
                        my $alias = &get_alias($value);
                        if ($alias) {
-                               push(@ret, $alias);
+                               push(@ret, [$alias, ""]);
                        }
                }
 
        # If nothing was selected, we assume "any".
        } else {
-               push(@ret, "0/0");
+               push(@ret, ["0/0", ""]);
        }
 
        return @ret;
index aa8870cdc488a47b123d0d794689573ec2f5b2d4..75a9357f64bc6047a47f81ad56f9c9e46301489f 100755 (executable)
@@ -131,6 +131,12 @@ sub print_rule {
        print "\n";
 }
 
+sub count_elements {
+       my $hash = shift;
+
+       return scalar @$hash;
+}
+
 sub flush {
        run("$IPTABLES -F $CHAIN_INPUT");
        run("$IPTABLES -F $CHAIN_FORWARD");
@@ -186,6 +192,9 @@ sub buildrules {
                # Skip disabled rules.
                next unless ($$hash{$key}[2] eq 'ON');
 
+               # Count number of elements in this line
+               my $elements = &count_elements($$hash{$key});
+
                if ($DEBUG) {
                        print_rule($$hash{$key});
                }
@@ -268,6 +277,34 @@ sub buildrules {
                        }
                }
 
+               # Concurrent connection limit
+               my @ratelimit_options = ();
+
+               if (($elements gt 34) && ($$hash{$key}[32] eq 'ON')) {
+                       my $conn_limit = $$hash{$key}[33];
+
+                       if ($conn_limit ge 1) {
+                               push(@ratelimit_options, ("-m", "connlimit"));
+
+                               # Use the the entire source IP address
+                               push(@ratelimit_options, "--connlimit-saddr");
+                               push(@ratelimit_options, ("--connlimit-mask", "32"));
+
+                               # Apply the limit
+                               push(@ratelimit_options, ("--connlimit-upto", $conn_limit));
+                       }
+               }
+
+               # Ratelimit
+               if (($elements gt 37) && ($$hash{$key}[34] eq 'ON')) {
+                       my $rate_limit = "$$hash{$key}[35]/$$hash{$key}[36]";
+
+                               if ($rate_limit) {
+                                       push(@ratelimit_options, ("-m", "limit"));
+                                       push(@ratelimit_options, ("--limit", $rate_limit));
+                               }
+               }
+
                # Check which protocols are used in this rule and so that we can
                # later group rules by protocols.
                my @protocols = &get_protocols($hash, $key);
@@ -295,22 +332,26 @@ sub buildrules {
                                next unless ($src);
 
                                # Sanitize source.
-                               my $source = $src;
+                               my $source = @$src[0];
                                if ($source ~~ @ANY_ADDRESSES) {
                                        $source = "";
                                }
 
+                               my $source_intf = @$src[1];
+
                                foreach my $dst (@destinations) {
                                        # Skip invalid rules.
                                        next unless (defined $dst);
                                        next if (!$dst || ($dst eq "none"));
 
                                        # Sanitize destination.
-                                       my $destination = $dst;
+                                       my $destination = @$dst[0];
                                        if ($destination ~~ @ANY_ADDRESSES) {
                                                $destination = "";
                                        }
 
+                                       my $destination_intf = @$dst[1];
+
                                        # Array with iptables arguments.
                                        my @options = ();
 
@@ -327,15 +368,26 @@ sub buildrules {
                                                push(@source_options, ("-s", $source));
                                        }
 
+                                       if ($source_intf) {
+                                               push(@source_options, ("-i", $source_intf));
+                                       }
+
                                        # Prepare destination options.
                                        my @destination_options = ();
                                        if ($destination) {
                                                push(@destination_options, ("-d", $destination));
                                        }
 
+                                       if ($destination_intf) {
+                                               push(@destination_options, ("-o", $destination_intf));
+                                       }
+
                                        # Add time constraint options.
                                        push(@options, @time_options);
 
+                                       # Add ratelimiting option
+                                       push(@options, @ratelimit_options);
+
                                        my $firewall_is_in_source_subnet = 1;
                                        if ($source) {
                                                $firewall_is_in_source_subnet = &firewall_is_in_subnet($source);
@@ -366,7 +418,7 @@ sub buildrules {
                                                        # Make port-forwardings useable from the internal networks.
                                                        my @internal_addresses = &fwlib::get_internal_firewall_ip_addresses(1);
                                                        unless ($nat_address ~~ @internal_addresses) {
-                                                               &add_dnat_mangle_rules($nat_address, @nat_options);
+                                                               &add_dnat_mangle_rules($nat_address, $source_intf, @nat_options);
                                                        }
 
                                                        push(@nat_options, @source_options);
@@ -457,6 +509,10 @@ sub buildrules {
                        }
                }
        }
+       #Reload firewall.local if present
+       if ( -f '/etc/sysconfig/firewall.local'){
+               run("/etc/sysconfig/firewall.local reload");
+       }
 }
 
 # Formats the given timestamp into the iptables format which is "hh:mm" UTC.
@@ -498,29 +554,19 @@ sub time_convert_to_minutes {
 }
 
 sub p2pblock {
-       my $search_action;
-       my $target;
-
-       if ($fwdfwsettings{"POLICY"} eq "MODE1") {
-               $search_action = "on";
-               $target = "ACCEPT";
-       } else {
-               $search_action = "off";
-               $target = "DROP";
-       }
-
        open(FILE, "<$p2pfile") or die "Unable to read $p2pfile";
        my @protocols = ();
        foreach my $p2pentry (<FILE>) {
                my @p2pline = split(/\;/, $p2pentry);
-               next unless ($p2pline[2] eq $search_action);
+               next unless ($p2pline[2] eq "off");
 
                push(@protocols, "--$p2pline[1]");
        }
        close(FILE);
 
+       run("$IPTABLES -F P2PBLOCK");
        if (@protocols) {
-               run("$IPTABLES -A FORWARDFW -m ipp2p @protocols -j $target");
+               run("$IPTABLES -A P2PBLOCK -m ipp2p @protocols -j DROP");
        }
 }
 
@@ -683,6 +729,7 @@ sub get_dnat_target_port {
 
 sub add_dnat_mangle_rules {
        my $nat_address = shift;
+       my $interface = shift;
        my @options = @_;
 
        my $mark = 0;
@@ -693,6 +740,8 @@ sub add_dnat_mangle_rules {
                next unless (exists $defaultNetworks{$zone . "_NETADDRESS"});
                next unless (exists $defaultNetworks{$zone . "_NETMASK"});
 
+               next if ($interface && $interface ne $defaultNetworks{$zone . "_DEV"});
+
                my @mangle_options = @options;
 
                my $netaddress = $defaultNetworks{$zone . "_NETADDRESS"};
diff --git a/config/rootfiles/core/84/filelists/bash b/config/rootfiles/core/84/filelists/bash
new file mode 120000 (symlink)
index 0000000..de970cb
--- /dev/null
@@ -0,0 +1 @@
+../../../common/bash
\ No newline at end of file
diff --git a/config/rootfiles/core/84/filelists/dnsmasq b/config/rootfiles/core/84/filelists/dnsmasq
new file mode 120000 (symlink)
index 0000000..d469c74
--- /dev/null
@@ -0,0 +1 @@
+../../../common/dnsmasq
\ No newline at end of file
diff --git a/config/rootfiles/core/84/filelists/files b/config/rootfiles/core/84/filelists/files
new file mode 100644 (file)
index 0000000..c26e2ea
--- /dev/null
@@ -0,0 +1,10 @@
+etc/system-release
+etc/issue
+etc/rc.d/init.d/firewall
+etc/rc.d/init.d/network
+srv/web/ipfire/cgi-bin/firewall.cgi
+srv/web/ipfire/cgi-bin/fwhosts.cgi
+srv/web/ipfire/cgi-bin/urlfilter.cgi
+usr/lib/firewall/firewall-lib.pl
+usr/lib/firewall/rules.pl
+var/ipfire/langs
diff --git a/config/rootfiles/core/84/filelists/readline b/config/rootfiles/core/84/filelists/readline
new file mode 120000 (symlink)
index 0000000..84209f1
--- /dev/null
@@ -0,0 +1 @@
+../../../common/readline
\ No newline at end of file
diff --git a/config/rootfiles/core/84/filelists/squid b/config/rootfiles/core/84/filelists/squid
new file mode 120000 (symlink)
index 0000000..2dc8372
--- /dev/null
@@ -0,0 +1 @@
+../../../common/squid
\ No newline at end of file
diff --git a/config/rootfiles/core/84/update.sh b/config/rootfiles/core/84/update.sh
new file mode 100644 (file)
index 0000000..93a9e20
--- /dev/null
@@ -0,0 +1,60 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 3 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2014 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+/usr/local/bin/backupctrl exclude >/dev/null 2>&1
+
+# Remove old core updates from pakfire cache to save space...
+core=84
+for (( i=1; i<=$core; i++ ))
+do
+       rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire
+done
+
+# Stop services
+/etc/init.d/squid stop
+/etc/init.d/dnsmasq stop
+
+# Remove old files
+
+# Extract files
+extract_files
+
+# Start services
+/etc/init.d/dnsmasq start
+/etc/init.d/squid start
+
+# Update Language cache
+perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
+
+sync
+
+# This update need a reboot...
+touch /var/run/need_reboot
+
+# Finish
+/etc/init.d/fireinfo start
+sendprofile
+
+# Don't report the exitcode last command
+exit 0
diff --git a/config/rootfiles/oldcore/82/exclude b/config/rootfiles/oldcore/82/exclude
new file mode 100644 (file)
index 0000000..18e9b4d
--- /dev/null
@@ -0,0 +1,20 @@
+boot/config.txt
+etc/collectd.custom
+etc/ipsec.conf
+etc/ipsec.secrets
+etc/ipsec.user.conf
+etc/ipsec.user.secrets
+etc/localtime
+etc/shadow
+etc/ssh/ssh_config
+etc/ssh/sshd_config
+etc/ssl/openssl.cnf
+etc/sudoers
+etc/sysconfig/firewall.local
+etc/sysconfig/rc.local
+etc/udev/rules.d/30-persistent-network.rules
+srv/web/ipfire/html/proxy.pac
+var/ipfire/ovpn
+var/log/cache
+var/state/dhcp/dhcpd.leases
+var/updatecache
diff --git a/config/rootfiles/oldcore/82/meta b/config/rootfiles/oldcore/82/meta
new file mode 100644 (file)
index 0000000..d547fa8
--- /dev/null
@@ -0,0 +1 @@
+DEPS=""
diff --git a/config/rootfiles/oldcore/83/exclude b/config/rootfiles/oldcore/83/exclude
new file mode 100644 (file)
index 0000000..18e9b4d
--- /dev/null
@@ -0,0 +1,20 @@
+boot/config.txt
+etc/collectd.custom
+etc/ipsec.conf
+etc/ipsec.secrets
+etc/ipsec.user.conf
+etc/ipsec.user.secrets
+etc/localtime
+etc/shadow
+etc/ssh/ssh_config
+etc/ssh/sshd_config
+etc/ssl/openssl.cnf
+etc/sudoers
+etc/sysconfig/firewall.local
+etc/sysconfig/rc.local
+etc/udev/rules.d/30-persistent-network.rules
+srv/web/ipfire/html/proxy.pac
+var/ipfire/ovpn
+var/log/cache
+var/state/dhcp/dhcpd.leases
+var/updatecache
diff --git a/config/rootfiles/oldcore/83/filelists/bash b/config/rootfiles/oldcore/83/filelists/bash
new file mode 120000 (symlink)
index 0000000..de970cb
--- /dev/null
@@ -0,0 +1 @@
+../../../common/bash
\ No newline at end of file
diff --git a/config/rootfiles/oldcore/83/filelists/files b/config/rootfiles/oldcore/83/filelists/files
new file mode 100644 (file)
index 0000000..5c0b6fe
--- /dev/null
@@ -0,0 +1,6 @@
+etc/system-release
+etc/issue
+srv/web/ipfire/cgi-bin/logs.cgi/ids.dat
+srv/web/ipfire/cgi-bin/proxy.cgi
+srv/web/ipfire/cgi-bin/urlfilter.cgi
+var/ipfire/general-functions.pl
diff --git a/config/rootfiles/oldcore/83/filelists/findutils b/config/rootfiles/oldcore/83/filelists/findutils
new file mode 120000 (symlink)
index 0000000..545280a
--- /dev/null
@@ -0,0 +1 @@
+../../../common/findutils
\ No newline at end of file
diff --git a/config/rootfiles/oldcore/83/filelists/squid b/config/rootfiles/oldcore/83/filelists/squid
new file mode 120000 (symlink)
index 0000000..2dc8372
--- /dev/null
@@ -0,0 +1 @@
+../../../common/squid
\ No newline at end of file
diff --git a/config/rootfiles/oldcore/83/meta b/config/rootfiles/oldcore/83/meta
new file mode 100644 (file)
index 0000000..d547fa8
--- /dev/null
@@ -0,0 +1 @@
+DEPS=""
diff --git a/config/rootfiles/oldcore/83/update.sh b/config/rootfiles/oldcore/83/update.sh
new file mode 100644 (file)
index 0000000..c766b42
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/bash
+############################################################################
+#                                                                          #
+# This file is part of the IPFire Firewall.                                #
+#                                                                          #
+# IPFire is free software; you can redistribute it and/or modify           #
+# it under the terms of the GNU General Public License as published by     #
+# the Free Software Foundation; either version 3 of the License, or        #
+# (at your option) any later version.                                      #
+#                                                                          #
+# IPFire is distributed in the hope that it will be useful,                #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of           #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
+# GNU General Public License for more details.                             #
+#                                                                          #
+# You should have received a copy of the GNU General Public License        #
+# along with IPFire; if not, write to the Free Software                    #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
+#                                                                          #
+# Copyright (C) 2014 IPFire-Team <info@ipfire.org>.                        #
+#                                                                          #
+############################################################################
+#
+. /opt/pakfire/lib/functions.sh
+/usr/local/bin/backupctrl exclude >/dev/null 2>&1
+
+# Remove old core updates from pakfire cache to save space...
+core=83
+for (( i=1; i<=$core; i++ ))
+do
+       rm -f /var/cache/pakfire/core-upgrade-*-$i.ipfire
+done
+
+# Stop services
+
+# Remove old files
+
+# Extract files
+extract_files
+
+# reload init because glibc/linker changed
+telinit -u
+
+# Start services
+
+# Update Language cache
+perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
+
+sync
+
+# This update need a reboot...
+touch /var/run/need_reboot
+
+# Finish
+/etc/init.d/fireinfo start
+sendprofile
+
+# Don't report the exitcode last command
+exit 0
index e6ae5272a2c2f5f7bc382196c3c91bcaf631510e..badee6b3c02ac115f4d9eda0abc02ae928ebd896 100644 (file)
@@ -161,6 +161,22 @@ print<<END;
                        \$("#TIME_CONSTRAINTS").toggle();
                });
 
+               // Limit concurrent connections per ip
+               if(!\$("#USE_LIMIT_CONCURRENT_CONNECTIONS_PER_IP").attr("checked")) {
+                       \$("#LIMIT_CON").hide();
+               }
+               \$("#USE_LIMIT_CONCURRENT_CONNECTIONS_PER_IP").change(function() {
+                       \$("#LIMIT_CON").toggle();
+               });
+
+               // Rate-limit new connections
+               if(!\$("#USE_RATELIMIT").attr("checked")) {
+                       \$("#RATELIMIT").hide();
+               }
+               \$("#USE_RATELIMIT").change(function() {
+                       \$("#RATELIMIT").toggle();
+               });
+
                // Automatically select radio buttons when corresponding
                // dropdown menu changes.
                \$("select").change(function() {
@@ -222,8 +238,8 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule')
                #check if we have an identical rule already
                if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
                        foreach my $key (sort keys %configinputfw){
-                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
-                                       eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31]"){
+                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
+                                       eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31],$configinputfw{$key}[32],$configinputfw{$key}[33],$configinputfw{$key}[34],$configinputfw{$key}[35],$configinputfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                                if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
                                                        $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
@@ -241,14 +257,14 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule')
                if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
                        $fwdfwsettings{'oldrulenumber'}=$maxkey;
                        foreach my $key (sort keys %configinputfw){
-                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
-                                       eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31]"){
+                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
+                                       eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31],$configinputfw{$key}[32],$configinputfw{$key}[33],$configinputfw{$key}[34],$configinputfw{$key}[35],$configinputfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                }
                        }
                }
                #check if we just close a rule
-               if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}) {
+               if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'} ) {
                        if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
                                $errormessage='';
                                $fwdfwsettings{'nosave2'} = 'on';
@@ -266,8 +282,8 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule')
                my $maxkey=&General::findhasharraykey(\%configoutgoingfw);
                if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
                        foreach my $key (sort keys %configoutgoingfw){
-                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
-                                       eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31]"){
+                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
+                                       eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31],$configoutgoingfw{$key}[32],$configoutgoingfw{$key}[33],$configoutgoingfw{$key}[34],$configoutgoingfw{$key}[35],$configoutgoingfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                                if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
                                                        $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
@@ -285,14 +301,14 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule')
                if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
                        $fwdfwsettings{'oldrulenumber'}=$maxkey;
                        foreach my $key (sort keys %configoutgoingfw){
-                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
-                                       eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31]"){
+                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
+                                       eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31],$configoutgoingfw{$key}[32],$configoutgoingfw{$key}[33],$configoutgoingfw{$key}[34],$configoutgoingfw{$key}[35],$configoutgoingfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                }
                        }
                }
                #check if we just close a rule
-               if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}) {
+               if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'} ) {
                        if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
                                $fwdfwsettings{'nosave2'} = 'on';
                                $errormessage='';
@@ -312,8 +328,8 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule')
                if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
                        #check if we have an identical rule already
                        foreach my $key (sort keys %configfwdfw){
-                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
-                                       eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31]"){
+                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
+                                       eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31],$configfwdfw{$key}[32],$configfwdfw{$key}[33],$configfwdfw{$key}[34],$configfwdfw{$key}[35],$configfwdfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                                if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
                                                        $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
@@ -331,19 +347,35 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule')
                if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
                        $fwdfwsettings{'oldrulenumber'}=$maxkey;
                        foreach my $key (sort keys %configfwdfw){
-                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
-                                       eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31]"){
+                               if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
+                                       eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31],$configfwdfw{$key}[32],$configfwdfw{$key}[33],$configfwdfw{$key}[34],$configfwdfw{$key}[35],$configfwdfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                }
                        }
                }
                #check if we just close a rule
-               if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}) {
+               if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}){
                        if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
                                $fwdfwsettings{'nosave2'} = 'on';
                                $errormessage='';
                        }
                }
+               #check max concurrent connections per ip address
+               if ($fwdfwsettings{'LIMIT_CON_CON'} eq 'ON'){
+                       if (!($fwdfwsettings{'concon'} =~ /^(\d+)$/)) {
+                               $errormessage.=$Lang::tr{'fwdfw err concon'};
+                       }
+               }else{
+                       $fwdfwsettings{'concon'}='';
+               }
+               #check ratelimit value
+               if ($fwdfwsettings{'RATE_LIMIT'} eq 'ON'){
+                       if (!($fwdfwsettings{'ratecon'} =~ /^(\d+)$/)) {
+                               $errormessage.=$Lang::tr{'fwdfw err ratecon'};
+                       }
+               }else{
+                       $fwdfwsettings{'ratecon'}='';
+               }
                #increase counters
                if (!$errormessage){
                        if ($fwdfwsettings{'nosave2'} ne 'on'){
@@ -1064,7 +1096,6 @@ print<<END;
 END
        foreach my $network (sort keys %defaultNetworks)
                {
-                       next if($defaultNetworks{$network}{'NAME'} eq "RED" && $srctgt eq 'src');
                        next if($defaultNetworks{$network}{'NAME'} eq "IPFire");
                        print "<option value='$defaultNetworks{$network}{'NAME'}'";
                        print " selected='selected'" if ($fwdfwsettings{$fwdfwsettings{$grp}} eq $defaultNetworks{$network}{'NAME'});
@@ -1517,6 +1548,11 @@ sub newrule
                                $fwdfwsettings{'nat'}                                   = $hash{$key}[31]; #changed order
                                $fwdfwsettings{$fwdfwsettings{'nat'}}   = $hash{$key}[29];
                                $fwdfwsettings{'dnatport'}                              = $hash{$key}[30];
+                               $fwdfwsettings{'LIMIT_CON_CON'}                 = $hash{$key}[32];
+                               $fwdfwsettings{'concon'}                                = $hash{$key}[33];
+                               $fwdfwsettings{'RATE_LIMIT'}                    = $hash{$key}[34];
+                               $fwdfwsettings{'ratecon'}                               = $hash{$key}[35];
+                               $fwdfwsettings{'RATETIME'}                              = $hash{$key}[36];
                                $checked{'grp1'}{$fwdfwsettings{'grp1'}}                                = 'CHECKED';
                                $checked{'grp2'}{$fwdfwsettings{'grp2'}}                                = 'CHECKED';
                                $checked{'grp3'}{$fwdfwsettings{'grp3'}}                                = 'CHECKED';
@@ -1534,12 +1570,15 @@ sub newrule
                                $checked{'TIME_SUN'}{$fwdfwsettings{'TIME_SUN'}}                = 'CHECKED';
                                $checked{'USE_NAT'}{$fwdfwsettings{'USE_NAT'}}                  = 'CHECKED';
                                $checked{'nat'}{$fwdfwsettings{'nat'}}                                  = 'CHECKED';
+                               $checked{'LIMIT_CON_CON'}{$fwdfwsettings{'LIMIT_CON_CON'}}      = 'CHECKED';
+                               $checked{'RATE_LIMIT'}{$fwdfwsettings{'RATE_LIMIT'}}    = 'CHECKED';
                                $selected{'TIME_FROM'}{$fwdfwsettings{'TIME_FROM'}}             = 'selected';
                                $selected{'TIME_TO'}{$fwdfwsettings{'TIME_TO'}}                 = 'selected';
                                $selected{'ipfire'}{$fwdfwsettings{$fwdfwsettings{'grp2'}}} ='selected';
                                $selected{'ipfire_src'}{$fwdfwsettings{$fwdfwsettings{'grp1'}}} ='selected';
                                $selected{'dnat'}{$fwdfwsettings{'dnat'}}                               ='selected';
                                $selected{'snat'}{$fwdfwsettings{'snat'}}                               ='selected';
+                               $selected{'RATETIME'}{$fwdfwsettings{'RATETIME'}}               ='selected';
                        }
                }
                $fwdfwsettings{'oldgrp1a'}=$fwdfwsettings{'grp1'};
@@ -1552,6 +1591,11 @@ sub newrule
                $fwdfwsettings{'oldruleremark'}=$fwdfwsettings{'ruleremark'};
                $fwdfwsettings{'oldnat'}=$fwdfwsettings{'USE_NAT'};
                $fwdfwsettings{'oldruletype'}=$fwdfwsettings{'chain'};
+               $fwdfwsettings{'oldconcon'}=$fwdfwsettings{'LIMIT_CON_CON'};
+               $fwdfwsettings{'olduseratelimit'}=$fwdfwsettings{'RATE_LIMIT'};
+               $fwdfwsettings{'olduseratelimitamount'}=$fwdfwsettings{'ratecon'};
+               $fwdfwsettings{'oldratelimittime'}=$fwdfwsettings{'RATETIME'};
+
                #check if manual ip (source) is orange network
                if ($fwdfwsettings{'grp1'} eq 'src_addr'){
                        my ($sip,$scidr) = split("/",$fwdfwsettings{$fwdfwsettings{'grp1'}});
@@ -1573,6 +1617,7 @@ sub newrule
                $fwdfwsettings{'oldusesrv'}=$fwdfwsettings{'USESRV'};
                $fwdfwsettings{'oldruleremark'}=$fwdfwsettings{'ruleremark'};
                $fwdfwsettings{'oldnat'}=$fwdfwsettings{'USE_NAT'};
+               $fwdfwsettings{'oldconcon'}=$fwdfwsettings{'LIMIT_CON_CON'};
                #check if manual ip (source) is orange network
                if ($fwdfwsettings{'grp1'} eq 'src_addr'){
                        my ($sip,$scidr) = split("/",$fwdfwsettings{$fwdfwsettings{'grp1'}});
@@ -2012,6 +2057,44 @@ END
                                        </table>
                                </td>
                        </tr>
+                       <tr>
+                               <td width='1%'>
+                                       <input type='checkbox' name='LIMIT_CON_CON' id="USE_LIMIT_CONCURRENT_CONNECTIONS_PER_IP" value='ON' $checked{'LIMIT_CON_CON'}{'ON'}>
+                               </td>
+                               <td>$Lang::tr{'fwdfw limitconcon'}</td>
+                       </tr>
+                       <tr id="LIMIT_CON">
+                               <td colspan='2'>
+                                       <table width='66%' border='0'>
+                                               <tr>
+                                                       <td width="20em">&nbsp;</td>
+                                                       <td>$Lang::tr{'fwdfw maxconcon'}: <input type='text' name='concon' size='2' value="$fwdfwsettings{'concon'}"></td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
+                       <tr>
+                               <td width='1%'>
+                                       <input type='checkbox' name='RATE_LIMIT' id="USE_RATELIMIT" value='ON' $checked{'RATE_LIMIT'}{'ON'}>
+                               </td>
+                               <td>$Lang::tr{'fwdfw ratelimit'}</td>
+                       </tr>
+                       <tr id="RATELIMIT">
+                               <td colspan='2'>
+                                       <table width='66%' border='0'>
+                                               <tr>
+                                                       <td width="20em">&nbsp;</td>
+                                                       <td>$Lang::tr{'fwdfw numcon'}: <input type='text' name='ratecon' size='2' value="$fwdfwsettings{'ratecon'}"> /
+                                                               <select name='RATETIME' style='width:100px;'>
+                                                                       <option value='second' $selected{'RATETIME'}{'second'}>$Lang::tr{'age second'}</option>
+                                                                       <option value='minute' $selected{'RATETIME'}{'minute'}>$Lang::tr{'minute'}</option>
+                                                                       <option value='hour' $selected{'RATETIME'}{'hour'}>$Lang::tr{'hour'}</option>
+                                                               </select>
+                                                       </td>
+                                               </tr>
+                                       </table>
+                               </td>
+                       </tr>
                </table>
                <br>
 END
@@ -2044,6 +2127,7 @@ END
                        <input type='hidden' name='oldorange' value='$fwdfwsettings{'oldorange'}' />
                        <input type='hidden' name='oldnat' value='$fwdfwsettings{'oldnat'}' />
                        <input type='hidden' name='oldruletype' value='$fwdfwsettings{'oldruletype'}' />
+                       <input type='hidden' name='oldconcon' value='$fwdfwsettings{'oldconcon'}' />
                        <input type='hidden' name='ACTION' value='saverule' ></form><form method='post' style='display:inline'><input type='submit' value='$Lang::tr{'fwhost back'}' style='min-width:100px;'><input type='hidden' name='ACTION' value'reset'></td></td>
                        </table></form>
 END
@@ -2180,6 +2264,11 @@ sub saverule
                        $$hash{$key}[29] = $fwdfwsettings{$fwdfwsettings{'nat'}};
                        $$hash{$key}[30] = $fwdfwsettings{'dnatport'};
                        $$hash{$key}[31] = $fwdfwsettings{'nat'};
+                       $$hash{$key}[32] = $fwdfwsettings{'LIMIT_CON_CON'};
+                       $$hash{$key}[33] = $fwdfwsettings{'concon'};
+                       $$hash{$key}[34] = $fwdfwsettings{'RATE_LIMIT'};
+                       $$hash{$key}[35] = $fwdfwsettings{'ratecon'};
+                       $$hash{$key}[36] = $fwdfwsettings{'RATETIME'};
                        &General::writehasharray("$config", $hash);
                }else{
                        foreach my $key (sort {$a <=> $b} keys %$hash){
@@ -2216,6 +2305,11 @@ sub saverule
                                        $$hash{$key}[29] = $fwdfwsettings{$fwdfwsettings{'nat'}};
                                        $$hash{$key}[30] = $fwdfwsettings{'dnatport'};
                                        $$hash{$key}[31] = $fwdfwsettings{'nat'};
+                                       $$hash{$key}[32] = $fwdfwsettings{'LIMIT_CON_CON'};
+                                       $$hash{$key}[33] = $fwdfwsettings{'concon'};
+                                       $$hash{$key}[34] = $fwdfwsettings{'RATE_LIMIT'};
+                                       $$hash{$key}[35] = $fwdfwsettings{'ratecon'};
+                                       $$hash{$key}[36] = $fwdfwsettings{'RATETIME'};
                                        last;
                                }
                        }
index 1f96336a6b4d9b964b80572504aeacf5089c5cf3..c3642f0f0e9ca7838d9b8b766df55e3c3197b1c1 100644 (file)
@@ -291,42 +291,13 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
                        $errormessage=$errormessage.$Lang::tr{'fwhost err sub32'};
                }
                if($fwhostsettings{'error'} ne 'on'){
-                       #check if we use one of ipfire's networks (green,orange,blue)
-                       if (($ownnet{'GREEN_NETADDRESS'}        ne '' && $ownnet{'GREEN_NETADDRESS'}    ne '0.0.0.0') && ($fwhostsettings{'IP'} eq $ownnet{'GREEN_NETADDRESS'} && $fwhostsettings{'SUBNET'} eq $ownnet{'GREEN_NETMASK'}))
-                       { 
-                               $errormessage=$errormessage.$Lang::tr{'ccd err green'}."<br>";
-                               $fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
-                               if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}='editnet';}
-                       }
-                       if (($ownnet{'ORANGE_NETADDRESS'}       ne '' && $ownnet{'ORANGE_NETADDRESS'}   ne '0.0.0.0') && ($fwhostsettings{'IP'} eq $ownnet{'ORANGE_NETADDRESS'} && $fwhostsettings{'SUBNET'} eq $ownnet{'ORANGE_NETMASK'}))
-                       { 
-                               $errormessage=$errormessage.$Lang::tr{'ccd err orange'}."<br>";
-                               $fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
-                               if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}='editnet';}
-                       }
-                       if (($ownnet{'BLUE_NETADDRESS'}         ne '' && $ownnet{'BLUE_NETADDRESS'}     ne '0.0.0.0') && ($fwhostsettings{'IP'} eq $ownnet{'BLUE_NETADDRESS'} && $fwhostsettings{'SUBNET'} eq $ownnet{'BLUE_NETMASK'}))
-                       { 
-                               $errormessage=$errormessage.$Lang::tr{'ccd err blue'}."<br>";
-                               $fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
-                               if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}='editnet';}
-                       }
-                       if (($ownnet{'RED_NETADDRESS'}  ne '' && $ownnet{'RED_NETADDRESS'}              ne '0.0.0.0') && ($fwhostsettings{'IP'} eq $ownnet{'RED_NETADDRESS'} && $fwhostsettings{'SUBNET'} eq $ownnet{'RED_NETMASK'}))
-                       { 
-                               $errormessage=$errormessage.$Lang::tr{'ccd err red'}."<br>";
-                               $fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
-                               if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}='editnet';}
-                       }
+                               my $fullip="$fwhostsettings{'IP'}/".&General::iporsubtocidr($fwhostsettings{'SUBNET'});
+                               $errormessage=$errormessage.&General::checksubnets($fwhostsettings{'HOSTNAME'},$fullip,"");
                }
                #only check plausi when no error till now
                if (!$errormessage){
                        &plausicheck("editnet");
                }
-               #check if network ip is part of an already used one 
-               if(&checksubnet(\%customnetwork))
-               {
-                       $errormessage=$errormessage.$Lang::tr{'fwhost err partofnet'};
-                       $fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
-               }                               
                if($fwhostsettings{'actualize'} eq 'on' && $fwhostsettings{'newnet'} ne 'on' && $errormessage)
                {
                        $fwhostsettings{'actualize'} = '';
@@ -338,9 +309,8 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
                        $customnetwork{$key}[3] = $fwhostsettings{'orgnetremark'};
                        &General::writehasharray("$confignet", \%customnetwork);
                        undef %customnetwork;
-               }                       
+               }
                if (!$errormessage){
-                       
                        &General::readhasharray("$confignet", \%customnetwork);
                        if ($fwhostsettings{'ACTION'} eq 'updatenet'){
                                if ($fwhostsettings{'update'} == '0'){
@@ -392,7 +362,7 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
                                                &General::writehasharray("$fwconfiginp", \%fwinp);
                                        }
                                }
-                       }                                       
+                       }
                        my $key = &General::findhasharraykey (\%customnetwork);
                        foreach my $i (0 .. 3) { $customnetwork{$key}[$i] = "";}
                        $fwhostsettings{'SUBNET'}       = &General::iporsubtocidr($fwhostsettings{'SUBNET'});
@@ -416,7 +386,8 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' )
                        }
                        &addnet;
                        &viewtablenet;
-               }else           {
+               }else{
+                       $fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'};
                        &addnet;
                        &viewtablenet;
                }
@@ -1644,7 +1615,10 @@ sub getcolor
                        $tdcolor="<font style='color: $Header::colourblue;'>$c</font>";
                        return $tdcolor;
                }
-
+               if ("$sip/$scidr" eq "0.0.0.0/0"){
+                       $tdcolor="<font style='color: $Header::colourred;'>$c</font>";
+                       return $tdcolor;
+               }
                #Check if IP is part of OpenVPN N2N subnet
                foreach my $key (sort keys %ccdhost){
                        if ($ccdhost{$key}[3] eq 'net'){
@@ -2501,6 +2475,9 @@ sub getipforgroup
                        &General::readhash("${General::swroot}/vpn/settings",\%hash);
                        return $hash{'RW_NET'};
                }
+               if ($name eq 'RED'){
+                       return "0.0.0.0/0";
+               }
        }
 }
 sub decrease
index 86207c2aa248dc355d6ce1378de7310ee7fa7d77..44b3abdac8c77bb64bed7051c56a95c1ed73cc63 100644 (file)
@@ -336,7 +336,7 @@ print <<END
 END
        ;
        if ($sid ne "n/a") {
-               print "<a href='http://www.snort.org/search/sid/$sid' ";
+               print "<a href='https://www.snort.org/rule_docs/$sid' ";
                print "target='_blank'>$sid</a></td>\n";
        } else {
                print $sid;
index 772852bb8f1f11f9d3eeb3922e19d2ac8a38aedf..ba2455a96ca17dcf966ffc5cb2ecb81049552887 100644 (file)
@@ -3221,6 +3221,48 @@ END
                print FILE "\n";
        }
 
+       open (PORTS,"$acl_ports_ssl");
+       my @ssl_ports = <PORTS>;
+       close PORTS;
+
+       if (@ssl_ports) {
+               foreach (@ssl_ports) {
+                       print FILE "acl SSL_ports port $_";
+               }
+       }
+
+       open (PORTS,"$acl_ports_safe");
+       my @safe_ports = <PORTS>;
+       close PORTS;
+
+       if (@safe_ports) {
+               foreach (@safe_ports) {
+                       print FILE "acl Safe_ports port $_";
+               }
+       }
+
+       print FILE <<END
+
+acl IPFire_http  port $http_port
+acl IPFire_https port $https_port
+acl IPFire_ips              dst $netsettings{'GREEN_ADDRESS'}
+acl IPFire_networks         src "$acl_src_subnets"
+acl IPFire_servers          dst "$acl_src_subnets"
+acl IPFire_green_network    src $green_cidr
+acl IPFire_green_servers    dst $green_cidr
+END
+       ;
+       if ($netsettings{'BLUE_DEV'}) { print FILE "acl IPFire_blue_network     src $blue_cidr\n"; }
+       if ($netsettings{'BLUE_DEV'}) { print FILE "acl IPFire_blue_servers     dst $blue_cidr\n"; }
+       if (!-z $acl_src_banned_ip) { print FILE "acl IPFire_banned_ips       src \"$acl_src_banned_ip\"\n"; }
+       if (!-z $acl_src_banned_mac) { print FILE "acl IPFire_banned_mac       arp \"$acl_src_banned_mac\"\n"; }
+       if (!-z $acl_src_unrestricted_ip) { print FILE "acl IPFire_unrestricted_ips src \"$acl_src_unrestricted_ip\"\n"; }
+       if (!-z $acl_src_unrestricted_mac) { print FILE "acl IPFire_unrestricted_mac arp \"$acl_src_unrestricted_mac\"\n"; }
+       print FILE <<END
+acl CONNECT method CONNECT
+END
+       ;
+
        if ($proxysettings{'CACHE_SIZE'} > 0) {
                print FILE <<END
 maximum_object_size $proxysettings{'MAX_SIZE'} KB
@@ -3502,48 +3544,6 @@ END
                print FILE "acl blocked_mimetypes rep_mime_type \"$mimetypes\"\n\n";
        }
 
-open (PORTS,"$acl_ports_ssl");
-my @ssl_ports = <PORTS>;
-close PORTS;
-
-if (@ssl_ports) {
-       foreach (@ssl_ports) {
-               print FILE "acl SSL_ports port $_";
-       }
-}
-
-open (PORTS,"$acl_ports_safe");
-my @safe_ports = <PORTS>;
-close PORTS;
-
-if (@safe_ports) {
-       foreach (@safe_ports) {
-               print FILE "acl Safe_ports port $_";
-       }
-}
-
-       print FILE <<END
-
-acl IPFire_http  port $http_port
-acl IPFire_https port $https_port
-acl IPFire_ips              dst $netsettings{'GREEN_ADDRESS'}
-acl IPFire_networks         src "$acl_src_subnets"
-acl IPFire_servers          dst "$acl_src_subnets"
-acl IPFire_green_network    src $green_cidr
-acl IPFire_green_servers    dst $green_cidr
-END
-       ;
-       if ($netsettings{'BLUE_DEV'}) { print FILE "acl IPFire_blue_network     src $blue_cidr\n"; }
-       if ($netsettings{'BLUE_DEV'}) { print FILE "acl IPFire_blue_servers     dst $blue_cidr\n"; }
-       if (!-z $acl_src_banned_ip) { print FILE "acl IPFire_banned_ips       src \"$acl_src_banned_ip\"\n"; }
-       if (!-z $acl_src_banned_mac) { print FILE "acl IPFire_banned_mac       arp \"$acl_src_banned_mac\"\n"; }
-       if (!-z $acl_src_unrestricted_ip) { print FILE "acl IPFire_unrestricted_ips src \"$acl_src_unrestricted_ip\"\n"; }
-       if (!-z $acl_src_unrestricted_mac) { print FILE "acl IPFire_unrestricted_mac arp \"$acl_src_unrestricted_mac\"\n"; }
-       print FILE <<END
-acl CONNECT method CONNECT
-END
-       ;
-
        if ($proxysettings{'CLASSROOM_EXT'} eq 'on') {
                print FILE <<END
 
index 9f7e6ff8240356aba1322650c6f8b6076234d7db..1e50de92879f99d52c9be94bbefa6cad60520f59 100644 (file)
@@ -935,7 +935,7 @@ if (($besettings{'ACTION'} eq $Lang::tr{'urlfilter install blacklist'}) && ($bes
                close FILE;
 
                system("rm -f $dbdir/$besettings{'BE_NAME'}/*.db");
-               system("/usr/sbin/squidGuard -c $editdir/install.conf -C all");
+               system("/usr/bin/squidGuard -c $editdir/install.conf -C all");
                system("chmod a+w $dbdir/$besettings{'BE_NAME'}/*.db");
 
                &readblockcategories;
@@ -2722,9 +2722,9 @@ sub setpermissions
 
 sub writeconfigfile
 {
-       my $executables = "\\.\(ade|adp|asx|bas|bat|chm|com|cmd|cpl|crt|dll|eml|exe|hiv|hlp|hta|inc|inf|ins|isp|jse|jtd|lnk|msc|msh|msi|msp|mst|nws|ocx|oft|ops|pcd|pif|plx|reg|scr|sct|sha|shb|shm|shs|sys|tlb|tsp|url|vbe|vbs|vxd|wsc|wsf|wsh\)\$";
-       my $audiovideo = "\\.\(aiff|asf|avi|dif|divx|mov|movie|mp3|mpe?g?|mpv2|ogg|ra?m|snd|qt|wav|wma|wmf|wmv\)\$";
-       my $archives = "\\.\(bin|bz2|cab|cdr|dmg|gz|hqx|rar|smi|sit|sea|tar|tgz|zip\)\$";
+       my $executables = "/[^/]*\\.\(ade|adp|asx|bas|bat|chm|com|cmd|cpl|crt|dll|eml|exe|hiv|hlp|hta|inc|inf|ins|isp|jse|jtd|lnk|msc|msh|msi|msp|mst|nws|ocx|oft|ops|pcd|pif|plx|reg|scr|sct|sha|shb|shm|shs|sys|tlb|tsp|url|vbe|vbs|vxd|wsc|wsf|wsh\)\$";
+       my $audiovideo = "/[^/]*\\.\(aiff|asf|avi|dif|divx|flv|mkv|mov|movie|mp3|mp4|mpe?g?|mpv2|ogg|ra?m|snd|qt|wav|wma|wmf|wmv\)\$";
+       my $archives = "/[^/]*\\.\(7z|bin|bz2|cab|cdr|dmg|gz|hqx|rar|smi|sit|sea|tar|tgz|zip\)\$";
 
        my $ident = " anonymous";
 
@@ -2854,11 +2854,13 @@ sub writeconfigfile
                if ($filtersettings{'ENABLE_SAFESEARCH'} eq 'on')
                {
                        print FILE "    # rewrite safesearch\n";
-                       print FILE "    s@(.*\\Wgoogle\\.\\w+/(webhp|search|imghp|images|grphp|groups|frghp|froogle)\\?)(.*)(\\bsafe=\\w+)(.*)\@\\1\\3safe=strict\\5\@i\n";
-                       print FILE "    s@(.*\\Wgoogle\\.\\w+/(webhp|search|imghp|images|grphp|groups|frghp|froogle)\\?)(.*)\@\\1safe=strict\\\&\\3\@i\n";
+                       print FILE "    s@(.*\\Wgoogle\\.\\w+/(webhp|search|imghp|images|grphp|groups|nwshp|frghp|froogle)\\?)(.*)(\\bsafe=\\w+)(.*)\@\\1\\3safe=strict\\5\@i\n";
+                       print FILE "    s@(.*\\Wgoogle\\.\\w+/(webhp|search|imghp|images|grphp|groups|nwshp|frghp|froogle)\\?)(.*)\@\\1safe=strict\\\&\\3\@i\n";
                        print FILE "    s@(.*\\Wsearch\\.yahoo\\.\\w+/search\\W)(.*)(\\bvm=\\w+)(.*)\@\\1\\2vm=r\\4\@i\n";
                        print FILE "    s@(.*\\Wsearch\\.yahoo\\.\\w+/search\\W.*)\@\\1\\\&vm=r\@i\n";
                        print FILE "    s@(.*\\Walltheweb\\.com/customize\\?)(.*)(\\bcopt_offensive=\\w+)(.*)\@\\1\\2copt_offensive=on\\4\@i\n";
+                       print FILE "    s@(.*\\Wbing\\.\\w+/)(.*)(\\badlt=\\w+)(.*)\@\\1\\2adlt=strict\\4\@i\n";
+                       print FILE "    s@(.*\\Wbing\\.\\w+/.*)\@\\1\\\&adlt=strict\@i\n";
                }
 
                print FILE "}\n\n";
index 6c46f70bfabdd99611b666a873431a9ba502a4f4..b7692ee7b7e659c8a5383eb221f20f6a46916635 100644 (file)
 'fwdfw dnat porterr' => 'Für NAT-Regeln muss ein einzelner Port oder Portbereich angegeben werden.',
 'fwdfw dnat porterr2' => 'Externer Port (NAT) darf nur angegeben werden, wenn ein Ziel-Port definiert ist.',
 'fwdfw edit' => 'Bearbeiten',
+'fwdfw err concon' => 'Ungültige Zahl für gleichzeitige Verbindungen',
 'fwdfw err nosrc' => 'Keine Quelle ausgewählt',
 'fwdfw err nosrcip' => 'Bitte Quell-IP-Adresse angeben',
 'fwdfw err notgt' => 'Kein Ziel ausgewählt',
 'fwdfw err notgtip' => 'Bitte Ziel-IP-Adresse angeben',
 'fwdfw err prot_port' => 'Bei dem gewählten Protokoll sind Quell- und Zielport nicht erlaubt',
 'fwdfw err prot_port1' => 'Bei Nutzung von Quell- oder Zielport muss als Protokoll TCP oder UDP gewählt werden.',
+'fwdfw err ratecon' => 'Ungültiger Wert bei Anzahl der Verbindungen für Ratenlimitierung',
 'fwdfw err remark' => 'Die Bemerkung enthält ungültige Zeichen',
 'fwdfw err ruleexists' => 'Eine identische Regel existiert bereits',
 'fwdfw err same' => 'Quelle und Ziel sind identisch',
 'fwdfw hint mac' => 'Sie nutzen MAC-Adressen in der Zielgruppe. Diese werden bei der Regelerstellung Ã¼bersprungen.',
 'fwdfw iface' => 'Interface',
 'fwdfw ipsec network' => 'IPsec-Netzwerke:',
+'fwdfw limitconcon' => 'Beschränke gleichzeitige Verbindungen je IP-Adresse',
 'fwdfw log' => 'Log',
 'fwdfw log rule' => 'Logging aktivieren',
 'fwdfw man port' => 'Port(s):',
 'fwdfw many' => 'Diverse',
+'fwdfw maxconcon' => 'Max. gleichzeitige Verbindungen',
 'fwdfw menu' => 'Firewall',
 'fwdfw movedown' => 'Herunter',
 'fwdfw moveup' => 'Herauf',
 'fwdfw natport used' => 'Der eingegebene Port wird bereits von einer anderen DNAT-Regel benutzt.',
 'fwdfw newrule' => 'Neue Regel erstellen',
+'fwdfw numcon' => 'Anzahl der Verbindungen',
 'fwdfw p2p txt' => 'P2P-Netzwerke erlauben/verbieten.',
 'fwdfw pol allow' => 'Zugelassen',
 'fwdfw pol block' => 'Blockiert',
 'fwdfw pol title' => 'Standardverhalten der Firewall',
 'fwdfw prot41' => 'IPv6 Encapsulation (Protokoll 41)',
 'fwdfw prot41 short' => 'IPv6 Encap',
+'fwdfw ratelimit' => 'Ratenlimitierung für neue Verbindungen',
 'fwdfw red' => 'ROT',
 'fwdfw reread' => 'Änderungen Ã¼bernehmen',
 'fwdfw rule action' => 'Regelaktion:',
 'fwhost err remark' => 'Ungültige Bemerkung. Erlaubte Zeichen: Klein- und Großbuchstaben, Bindestrich, Unterstrich, Runde Klammern, Semikolon, Punkt.',
 'fwhost err srv exists' => 'Ein Service mit diesem Namen existiert bereits',
 'fwhost err srvexist' => 'Dieser Dienst ist bereits in der Gruppe',
-'fwhost err sub32' => 'Bitte einen einzelnen Host hinzufügen, keine Netzwerke',
+'fwhost err sub32' => 'Bitte Netzwerke hinzufügen, keinen einzelnen Host',
 'fwhost green' => 'Grün',
 'fwhost hint' => 'Hinweis',
 'fwhost hosts' => 'Firewall-Hosts',
index b537868d2c6bf1f9d249f5693774529f0c4331b5..19864093499c5797630ea79631a0d27a0760165c 100644 (file)
 'fwdfw dnat porterr' => 'You have to select a single port or portrange (tcp/udp) for NAT',
 'fwdfw dnat porterr2' => 'Cannot use external port (NAT) when no destination port is defined.',
 'fwdfw edit' => 'Edit',
+'fwdfw err concon' => 'Invalid number for concurrent connections',
 'fwdfw err nosrc' => 'No source selected.',
 'fwdfw err nosrcip' => 'Please provide a source IP address.',
 'fwdfw err notgt' => 'No destination selected.',
 'fwdfw err notgtip' => 'Please provide a destination IP address.',
 'fwdfw err prot_port' => 'Source- or targetport are not allowed with selected protocol',
 'fwdfw err prot_port1' => 'When using Source- or targetport you have to select TCP or UDP for protocol',
+'fwdfw err ratecon' => 'Invalid value for connections in Rate-limit',
 'fwdfw err remark' => 'Invalid characters in remark.',
 'fwdfw err ruleexists' => 'This rule already exists.',
 'fwdfw err same' => 'Source and destination are identical.',
 'fwdfw hint mac' => 'The destination group contains MAC addresses, which will be skipped during rule creation.',
 'fwdfw iface' => 'Interface',
 'fwdfw ipsec network' => 'IPsec networks:',
+'fwdfw limitconcon' => 'Limit concurrent connections per IP address',
 'fwdfw log' => 'Log',
 'fwdfw log rule' => 'Log rule',
 'fwdfw man port' => 'Port(s):',
 'fwdfw many' => 'Many',
+'fwdfw maxconcon' => 'Max. concurrent connections',
 'fwdfw menu' => 'Firewall',
 'fwdfw movedown' => 'Move down',
 'fwdfw moveup' => 'Move up',
 'fwdfw natport used' => 'The given port for NAPT is already in use by an other DNAT rule.',
 'fwdfw newrule' => 'New rule',
+'fwdfw numcon' => 'Number of connections',
 'fwdfw p2p txt' => 'Grant/deny access to P2P networks.',
 'fwdfw pol allow' => 'Allowed',
 'fwdfw pol block' => 'Blocked',
 'fwdfw pol title' => 'Default firewall behaviour',
 'fwdfw prot41' => 'IPv6 Encapsulation (Protocol 41)',
 'fwdfw prot41 short' => 'IPv6 Encap',
+'fwdfw ratelimit' => 'Rate-limit new connections',
 'fwdfw red' => 'RED',
 'fwdfw reread' => 'Apply changes',
 'fwdfw rule action' => 'Rule action:',
 'fwhost err remark' => 'Invalid remark. Allowed characters: Upper- and lowercase letters, digits, space, dash, braces, semicolon, pipe and dot.',
 'fwhost err srv exists' => 'A service with the same name already exists',
 'fwhost err srvexist' => 'This service already exists in the group',
-'fwhost err sub32' => 'Please add a single host, not a network.',
+'fwhost err sub32' => 'Please add a network, not a single host',
 'fwhost green' => 'Green',
 'fwhost hint' => 'Note',
 'fwhost hosts' => 'Firewall Hosts',
 'swap usage per' => 'Swap usage per',
 'system' => 'System',
 'system graphs' => 'System Graphs',
-'system has hwrng' => 'This system has got a hardware random number generator.',
-'system has rdrand' => 'This system has got support for Intel(R) RDRAND.',
+'system has hwrng' => 'This system has a hardware random number generator.',
+'system has rdrand' => 'This system has support for Intel(R) RDRAND.',
 'system information' => 'System Information',
 'system log viewer' => 'System Log Viewer',
 'system logs' => 'System Logs',
index ae5a2837ace18fbd0ba1c0414984ad67ff3cfcbb..c75895124590524f412a2072cb08393487c93d2b 100644 (file)
--- a/lfs/bash
+++ b/lfs/bash
@@ -87,7 +87,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
                -i $(DIR_APP)/builtins/enable.def
 
-       for i in $$(seq 1 26); do \
+       for i in $$(seq 1 30); do \
                cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/bash/bash43-$$(printf "%03d" "$${i}") || exit 1; \
        done
 
index 58b001755dbbc8d6175537ed94d9f8c4a266d8f7..60dabf4a53ce7ed16df026302dae3fd0b783afd8 100644 (file)
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 2.71
+VER        = 2.72
 
 THISAPP    = dnsmasq-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -42,7 +42,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = 9e2e4d59c75e71ee3ca817ff0f9be69e
+$(DL_FILE)_MD5 = 0256e0a71e27c8d8a5c89a0d18f3cfe2
 
 install : $(TARGET)
 
@@ -72,9 +72,7 @@ $(subst %,%_MD5,$(objects)) :
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-2.71-use-nettle-with-minigmp.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-2.71-support-nettle-3.0.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-2.70-Add-support-to-read-ISC-DHCP-lease-file.patch
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-2.72rc2-Add-support-to-read-ISC-DHCP-lease-file.patch
        cd $(DIR_APP) && sed -i src/config.h \
                -e 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' \
                -e 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' \
index f0d8aba647caeda0d2d636c4ab7f7e84bb51954a..32c494f24388a06cbb18d45530f3372d148ca564 100644 (file)
--- a/lfs/glibc
+++ b/lfs/glibc
@@ -268,6 +268,12 @@ endif
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh966775.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh966778.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh970090.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1008310.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1022022.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1091162.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1098050.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1133809-1.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc/glibc-rh1133809-2.patch
 
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-resolv-stack_chk_fail.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/glibc-remove-ctors-dtors-output-sections.patch
index 6a3718a395ca5a776f88725954a1dae6381c84f1..5dee653a420f2e0998d1862527a9712acfea9e31 100644 (file)
@@ -1,7 +1,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2011  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2014  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -33,7 +33,7 @@ DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 
 PROG       = parted
-PAK_VER    = 1
+PAK_VER    = 2
 
 DEPS       = ""
 
index e050b17c5c4edaa8f5d8c725479ecf95e0792a87..548abd937a2373d3dafd41abd92beb205949a550 100644 (file)
--- a/lfs/squid
+++ b/lfs/squid
@@ -24,7 +24,7 @@
 
 include Config
 
-VER        = 3.4.5
+VER        = 3.4.8
 
 THISAPP    = squid-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5 = a831efb36cfbaa419f8dc7a43cba72c9
+$(DL_FILE)_MD5 = b0c4335447248810169f58ea4d8b204a
 
 install : $(TARGET)
 
index 6f0fdc3b2dbb59e9800169ed60bf5e14418e5c4b..0dca63f751f4c43aa036d8fa53954c740fe7e194 100644 (file)
@@ -15,7 +15,7 @@ THISAPP    = squid-accounting-$(VER)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = squid-accounting
-PAK_VER    = 2
+PAK_VER    = 3
 
 DEPS       = "perl-DBI perl-DBD-SQLite perl-File-ReadBackwards perl-PDF-API2 sendEmail"
 
diff --git a/make.sh b/make.sh
index 8a2ecc6e1b5ab59d1e8a7f2b3f5504b8f0d79231..ac8d50583c3b75d963f341067a7f02c3d1e2c80b 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -25,8 +25,8 @@
 NAME="IPFire"                                                  # Software name
 SNAME="ipfire"                                                 # Short name
 VERSION="2.15"                                                 # Version number
-CORE="82"                                                      # Core Level (Filename)
-PAKFIRE_CORE="82"                                              # Core Level (PAKFIRE)
+CORE="84"                                                      # Core Level (Filename)
+PAKFIRE_CORE="84"                                              # Core Level (PAKFIRE)
 GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`                   # Git Branch
 SLOGAN="www.ipfire.org"                                                # Software slogan
 CONFIG_ROOT=/var/ipfire                                                # Configuration rootdir
old mode 100755 (executable)
new mode 100644 (file)
index c7f8b679d617b875a49f724f304b7dbe30336360..c383652e0b5e89b086caac5a1d745181fb113b6b 100644 (file)
@@ -104,6 +104,12 @@ iptables_init() {
        iptables -t nat -N CUSTOMPOSTROUTING
        iptables -t nat -A POSTROUTING -j CUSTOMPOSTROUTING
 
+       # P2PBLOCK
+       iptables -N P2PBLOCK
+       iptables -A INPUT -j P2PBLOCK
+       iptables -A FORWARD -j P2PBLOCK
+       iptables -A OUTPUT -j P2PBLOCK
+       
        # Guardian (IPS) chains
        iptables -N GUARDIAN
        iptables -A INPUT -j GUARDIAN
@@ -402,21 +408,11 @@ case "$1" in
        boot_mesg "Setting up firewall"
        iptables_init
        evaluate_retval
-
-       # run local firewall configuration, if present
-       if [ -x /etc/sysconfig/firewall.local ]; then
-               /etc/sysconfig/firewall.local start
-       fi
        ;;
   reload|up)
        boot_mesg "Reloading firewall"
        iptables_red_up
        evaluate_retval
-
-       # run local firewall configuration, if present
-       if [ -x /etc/sysconfig/firewall.local ]; then
-               /etc/sysconfig/firewall.local reload
-       fi
        ;;
   down)
        boot_mesg "Disabling firewall access to RED"
@@ -424,10 +420,6 @@ case "$1" in
        evaluate_retval
        ;;
   restart)
-       # run local firewall configuration, if present
-       if [ -x /etc/sysconfig/firewall.local ]; then
-               /etc/sysconfig/firewall.local stop
-       fi
        $0 start
        ;;
   *)
index 5aecd1557d0742097fdf263a175ecc8b04da229d..9182e9801fec62c139755fd6c8ef55c93c6966f9 100644 (file)
@@ -18,7 +18,6 @@ eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
 
 init_networking() {
        /etc/rc.d/init.d/dnsmasq start
-       /etc/rc.d/init.d/static-routes start
 }
 
 DO="${1}"
@@ -26,7 +25,7 @@ shift
 
 if [ -n "${1}" ]; then
        ALL=0
-       for i in green red blue orange; do      
+       for i in green red blue orange; do
                eval "${i}=0"
        done
 else
@@ -68,7 +67,9 @@ case "${DO}" in
                                rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
                                [ "$AUTOCONNECT" == "off" ] || /etc/rc.d/init.d/networking/red start
                        fi
-               fi                           
+               fi
+
+               /etc/rc.d/init.d/static-routes start
                ;;
 
        stop)
index f20b85f4640db379b1f4dbac08508513e6c2f906..835055ad5cf7608ae461b38a9c47f2b280221230 100644 (file)
@@ -31,5 +31,8 @@ if [ ! -f /var/ipfire/accounting/acct.db ]; then
        chmod 644 /var/ipfire/accounting/acct.db
        chown nobody.nobody /var/ipfire/accounting/acct.db
 fi
+#Set right permissions of directory /srv/web/ipfire/html/accounting
+chown -R nobody.nobody /srv/web/ipfire/html/accounting
+chmod 755 -R /srv/web/ipfire/html/accounting
 rm -f /var/ipfire/accounting/dbinstall.pl
 /usr/local/bin/update-lang-cache
diff --git a/src/patches/bash/bash32-052 b/src/patches/bash/bash32-052
new file mode 100644 (file)
index 0000000..78e7d92
--- /dev/null
@@ -0,0 +1,104 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release: 3.2
+Patch-ID: bash32-052
+
+Bug-Reported-by:       Stephane Chazelas <stephane.chazelas@gmail.com>
+Bug-Reference-ID:
+Bug-Reference-URL:
+
+Bug-Description:
+
+Under certain circumstances, bash will execute user code while processing the
+environment for exported function definitions.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-3.2.51/builtins/common.h   2006-03-06 09:38:44.000000000 -0500
+--- builtins/common.h  2014-09-16 19:08:02.000000000 -0400
+***************
+*** 34,37 ****
+--- 34,39 ----
+  
+  /* Flags for describe_command, shared between type.def and command.def */
++ #define SEVAL_FUNCDEF        0x080           /* only allow function definitions */
++ #define SEVAL_ONECMD 0x100           /* only allow a single command */
+  #define CDESC_ALL            0x001   /* type -a */
+  #define CDESC_SHORTDESC              0x002   /* command -V */
+*** ../bash-3.2.51/builtins/evalstring.c       2008-11-15 17:47:04.000000000 -0500
+--- builtins/evalstring.c      2014-09-16 19:08:02.000000000 -0400
+***************
+*** 235,238 ****
+--- 235,246 ----
+             struct fd_bitmap *bitmap;
+  
++            if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
++              {
++                internal_warning ("%s: ignoring function definition attempt", from_file);
++                should_jump_to_top_level = 0;
++                last_result = last_command_exit_value = EX_BADUSAGE;
++                break;
++              }
++ 
+             bitmap = new_fd_bitmap (FD_BITMAP_SIZE);
+             begin_unwind_frame ("pe_dispose");
+***************
+*** 292,295 ****
+--- 300,306 ----
+             dispose_fd_bitmap (bitmap);
+             discard_unwind_frame ("pe_dispose");
++ 
++            if (flags & SEVAL_ONECMD)
++              break;
+           }
+       }
+*** ../bash-3.2.51/variables.c 2008-11-15 17:15:06.000000000 -0500
+--- variables.c        2014-09-16 19:10:39.000000000 -0400
+***************
+*** 319,328 ****
+         strcpy (temp_string + char_index + 1, string);
+  
+!        parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST);
+! 
+!        /* Ancient backwards compatibility.  Old versions of bash exported
+!           functions like name()=() {...} */
+!        if (name[char_index - 1] == ')' && name[char_index - 2] == '(')
+!          name[char_index - 2] = '\0';
+  
+         if (temp_var = find_function (name))
+--- 319,326 ----
+         strcpy (temp_string + char_index + 1, string);
+  
+!        /* Don't import function names that are invalid identifiers from the
+!           environment. */
+!        if (legal_identifier (name))
+!          parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
+  
+         if (temp_var = find_function (name))
+***************
+*** 333,340 ****
+         else
+           report_error (_("error importing function definition for `%s'"), name);
+- 
+-        /* ( */
+-        if (name[char_index - 1] == ')' && name[char_index - 2] == '\0')
+-          name[char_index - 2] = '(';         /* ) */
+       }
+  #if defined (ARRAY_VARS)
+--- 331,334 ----
+*** ../bash-3.2/patchlevel.h   Thu Apr 13 08:31:04 2006
+--- patchlevel.h       Mon Oct 16 14:22:54 2006
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 51
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 52
+  
+  #endif /* _PATCHLEVEL_H_ */
diff --git a/src/patches/bash/bash32-053 b/src/patches/bash/bash32-053
new file mode 100644 (file)
index 0000000..e7efce7
--- /dev/null
@@ -0,0 +1,54 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release: 3.2
+Patch-ID: bash32-053
+
+Bug-Reported-by:       Tavis Ormandy <taviso () cmpxchg8b com>
+Bug-Reference-ID:
+Bug-Reference-URL:     http://twitter.com/taviso/statuses/514887394294652929
+
+Bug-Description:
+
+Under certain circumstances, bash can incorrectly save a lookahead character and
+return it on a subsequent call, even when reading a new line.
+
+Patch:
+
+*** ../bash-3.2.52/parse.y     2008-04-29 21:24:55.000000000 -0400
+--- parse.y    2014-09-25 16:18:41.000000000 -0400
+***************
+*** 2504,2507 ****
+--- 2504,2509 ----
+    word_desc_to_read = (WORD_DESC *)NULL;
+  
++   eol_ungetc_lookahead = 0;
++ 
+    last_read_token = '\n';
+    token_to_read = '\n';
+*** ../bash-3.2.52/y.tab.c     2006-09-25 08:15:16.000000000 -0400
+--- y.tab.c    2014-09-25 20:28:17.000000000 -0400
+***************
+*** 3833,3836 ****
+--- 3833,3838 ----
+    word_desc_to_read = (WORD_DESC *)NULL;
+  
++   eol_ungetc_lookahead = 0;
++ 
+    last_read_token = '\n';
+    token_to_read = '\n';
+*** ../bash-3.2/patchlevel.h   Thu Apr 13 08:31:04 2006
+--- patchlevel.h       Mon Oct 16 14:22:54 2006
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 52
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 53
+  
+  #endif /* _PATCHLEVEL_H_ */
diff --git a/src/patches/bash/bash43-027 b/src/patches/bash/bash43-027
new file mode 100644 (file)
index 0000000..ef48bd8
--- /dev/null
@@ -0,0 +1,221 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-027
+
+Bug-Reported-by:       Florian Weimer <fweimer@redhat.com>
+Bug-Reference-ID:
+Bug-Reference-URL:
+
+Bug-Description:
+
+This patch changes the encoding bash uses for exported functions to avoid
+clashes with shell variables and to avoid depending only on an environment
+variable's contents to determine whether or not to interpret it as a shell
+function.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.3.26/variables.c 2014-09-25 23:02:18.000000000 -0400
+--- variables.c        2014-09-27 20:52:04.000000000 -0400
+***************
+*** 84,87 ****
+--- 84,92 ----
+  #define ifsname(s)   ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0')
+  
++ #define BASHFUNC_PREFIX              "BASH_FUNC_"
++ #define BASHFUNC_PREFLEN     10      /* == strlen(BASHFUNC_PREFIX */
++ #define BASHFUNC_SUFFIX              "%%"
++ #define BASHFUNC_SUFFLEN     2       /* == strlen(BASHFUNC_SUFFIX) */
++ 
+  extern char **environ;
+  
+***************
+*** 280,284 ****
+  static void dispose_temporary_env __P((sh_free_func_t *));     
+  
+! static inline char *mk_env_string __P((const char *, const char *));
+  static char **make_env_array_from_var_list __P((SHELL_VAR **));
+  static char **make_var_export_array __P((VAR_CONTEXT *));
+--- 285,289 ----
+  static void dispose_temporary_env __P((sh_free_func_t *));     
+  
+! static inline char *mk_env_string __P((const char *, const char *, int));
+  static char **make_env_array_from_var_list __P((SHELL_VAR **));
+  static char **make_var_export_array __P((VAR_CONTEXT *));
+***************
+*** 350,369 ****
+        /* If exported function, define it now.  Don't import functions from
+        the environment in privileged mode. */
+!       if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4))
+       {
+         string_length = strlen (string);
+!        temp_string = (char *)xmalloc (3 + string_length + char_index);
+  
+!        strcpy (temp_string, name);
+!        temp_string[char_index] = ' ';
+!        strcpy (temp_string + char_index + 1, string);
+  
+         /* Don't import function names that are invalid identifiers from the
+            environment, though we still allow them to be defined as shell
+            variables. */
+!        if (legal_identifier (name))
+!          parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
+  
+!        if (temp_var = find_function (name))
+           {
+             VSETATTR (temp_var, (att_exported|att_imported));
+--- 355,385 ----
+        /* If exported function, define it now.  Don't import functions from
+        the environment in privileged mode. */
+!       if (privmode == 0 && read_but_dont_execute == 0 && 
+!           STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) &&
+!           STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) &&
+!        STREQN ("() {", string, 4))
+       {
++        size_t namelen;
++        char *tname;          /* desired imported function name */
++ 
++        namelen = char_index - BASHFUNC_PREFLEN - BASHFUNC_SUFFLEN;
++ 
++        tname = name + BASHFUNC_PREFLEN;      /* start of func name */
++        tname[namelen] = '\0';                /* now tname == func name */
++ 
+         string_length = strlen (string);
+!        temp_string = (char *)xmalloc (namelen + string_length + 2);
+  
+!        memcpy (temp_string, tname, namelen);
+!        temp_string[namelen] = ' ';
+!        memcpy (temp_string + namelen + 1, string, string_length + 1);
+  
+         /* Don't import function names that are invalid identifiers from the
+            environment, though we still allow them to be defined as shell
+            variables. */
+!        if (absolute_program (tname) == 0 && (posixly_correct == 0 || legal_identifier (tname)))
+!          parse_and_execute (temp_string, tname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
+  
+!        if (temp_var = find_function (tname))
+           {
+             VSETATTR (temp_var, (att_exported|att_imported));
+***************
+*** 378,383 ****
+               }
+             last_command_exit_value = 1;
+!            report_error (_("error importing function definition for `%s'"), name);
+           }
+       }
+  #if defined (ARRAY_VARS)
+--- 394,402 ----
+               }
+             last_command_exit_value = 1;
+!            report_error (_("error importing function definition for `%s'"), tname);
+           }
++ 
++        /* Restore original suffix */
++        tname[namelen] = BASHFUNC_SUFFIX[0];
+       }
+  #if defined (ARRAY_VARS)
+***************
+*** 2955,2959 ****
+  
+    INVALIDATE_EXPORTSTR (var);
+!   var->exportstr = mk_env_string (name, value);
+  
+    array_needs_making = 1;
+--- 2974,2978 ----
+  
+    INVALIDATE_EXPORTSTR (var);
+!   var->exportstr = mk_env_string (name, value, 0);
+  
+    array_needs_making = 1;
+***************
+*** 3853,3871 ****
+  
+  static inline char *
+! mk_env_string (name, value)
+       const char *name, *value;
+  {
+!   int name_len, value_len;
+!   char       *p;
+  
+    name_len = strlen (name);
+    value_len = STRLEN (value);
+!   p = (char *)xmalloc (2 + name_len + value_len);
+!   strcpy (p, name);
+!   p[name_len] = '=';
+    if (value && *value)
+!     strcpy (p + name_len + 1, value);
+    else
+!     p[name_len + 1] = '\0';
+    return (p);
+  }
+--- 3872,3911 ----
+  
+  static inline char *
+! mk_env_string (name, value, isfunc)
+       const char *name, *value;
++      int isfunc;
+  {
+!   size_t name_len, value_len;
+!   char       *p, *q;
+  
+    name_len = strlen (name);
+    value_len = STRLEN (value);
+! 
+!   /* If we are exporting a shell function, construct the encoded function
+!      name. */
+!   if (isfunc && value)
+!     {
+!       p = (char *)xmalloc (BASHFUNC_PREFLEN + name_len + BASHFUNC_SUFFLEN + value_len + 2);
+!       q = p;
+!       memcpy (q, BASHFUNC_PREFIX, BASHFUNC_PREFLEN);
+!       q += BASHFUNC_PREFLEN;
+!       memcpy (q, name, name_len);
+!       q += name_len;
+!       memcpy (q, BASHFUNC_SUFFIX, BASHFUNC_SUFFLEN);
+!       q += BASHFUNC_SUFFLEN;
+!     }
+!   else
+!     {
+!       p = (char *)xmalloc (2 + name_len + value_len);
+!       memcpy (p, name, name_len);
+!       q = p + name_len;
+!     }
+! 
+!   q[0] = '=';
+    if (value && *value)
+!     memcpy (q + 1, value, value_len + 1);
+    else
+!     q[1] = '\0';
+! 
+    return (p);
+  }
+***************
+*** 3953,3957 ****
+            using the cached exportstr... */
+         list[list_index] = USE_EXPORTSTR ? savestring (value)
+!                                         : mk_env_string (var->name, value);
+  
+         if (USE_EXPORTSTR == 0)
+--- 3993,3997 ----
+            using the cached exportstr... */
+         list[list_index] = USE_EXPORTSTR ? savestring (value)
+!                                         : mk_env_string (var->name, value, function_p (var));
+  
+         if (USE_EXPORTSTR == 0)
+*** ../bash-4.3/patchlevel.h   2012-12-29 10:47:57.000000000 -0500
+--- patchlevel.h       2014-03-20 20:01:28.000000000 -0400
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 26
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 27
+  
+  #endif /* _PATCHLEVEL_H_ */
diff --git a/src/patches/bash/bash43-028 b/src/patches/bash/bash43-028
new file mode 100644 (file)
index 0000000..7448cf8
--- /dev/null
@@ -0,0 +1,2265 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-028
+
+Bug-Reported-by:       Florian Weimer <fweimer@redhat.com>
+Bug-Reference-ID:
+Bug-Reference-URL:
+
+Bug-Description:
+
+There are two local buffer overflows in parse.y that can cause the shell
+to dump core when given many here-documents attached to a single command
+or many nested loops.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.3-patched/parse.y        2014-09-25 23:02:35.000000000 -0400
+--- parse.y    2014-09-29 16:47:03.000000000 -0400
+***************
+*** 169,172 ****
+--- 169,175 ----
+  static int reserved_word_acceptable __P((int));
+  static int yylex __P((void));
++ 
++ static void push_heredoc __P((REDIRECT *));
++ static char *mk_alexpansion __P((char *));
+  static int alias_expand_token __P((char *));
+  static int time_command_acceptable __P((void));
+***************
+*** 266,270 ****
+  /* Variables to manage the task of reading here documents, because we need to
+     defer the reading until after a complete command has been collected. */
+! static REDIRECT *redir_stack[10];
+  int need_here_doc;
+  
+--- 269,275 ----
+  /* Variables to manage the task of reading here documents, because we need to
+     defer the reading until after a complete command has been collected. */
+! #define HEREDOC_MAX 16
+! 
+! static REDIRECT *redir_stack[HEREDOC_MAX];
+  int need_here_doc;
+  
+***************
+*** 308,312 ****
+     index is decremented after a case, select, or for command is parsed. */
+  #define MAX_CASE_NEST        128
+! static int word_lineno[MAX_CASE_NEST];
+  static int word_top = -1;
+  
+--- 313,317 ----
+     index is decremented after a case, select, or for command is parsed. */
+  #define MAX_CASE_NEST        128
+! static int word_lineno[MAX_CASE_NEST+1];
+  static int word_top = -1;
+  
+***************
+*** 521,525 ****
+                         redir.filename = $2;
+                         $$ = make_redirection (source, r_reading_until, redir, 0);
+!                        redir_stack[need_here_doc++] = $$;
+                       }
+       |       NUMBER LESS_LESS WORD
+--- 526,530 ----
+                         redir.filename = $2;
+                         $$ = make_redirection (source, r_reading_until, redir, 0);
+!                        push_heredoc ($$);
+                       }
+       |       NUMBER LESS_LESS WORD
+***************
+*** 528,532 ****
+                         redir.filename = $3;
+                         $$ = make_redirection (source, r_reading_until, redir, 0);
+!                        redir_stack[need_here_doc++] = $$;
+                       }
+       |       REDIR_WORD LESS_LESS WORD
+--- 533,537 ----
+                         redir.filename = $3;
+                         $$ = make_redirection (source, r_reading_until, redir, 0);
+!                        push_heredoc ($$);
+                       }
+       |       REDIR_WORD LESS_LESS WORD
+***************
+*** 535,539 ****
+                         redir.filename = $3;
+                         $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
+!                        redir_stack[need_here_doc++] = $$;
+                       }
+       |       LESS_LESS_MINUS WORD
+--- 540,544 ----
+                         redir.filename = $3;
+                         $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
+!                        push_heredoc ($$);
+                       }
+       |       LESS_LESS_MINUS WORD
+***************
+*** 542,546 ****
+                         redir.filename = $2;
+                         $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
+!                        redir_stack[need_here_doc++] = $$;
+                       }
+       |       NUMBER LESS_LESS_MINUS WORD
+--- 547,551 ----
+                         redir.filename = $2;
+                         $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
+!                        push_heredoc ($$);
+                       }
+       |       NUMBER LESS_LESS_MINUS WORD
+***************
+*** 549,553 ****
+                         redir.filename = $3;
+                         $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
+!                        redir_stack[need_here_doc++] = $$;
+                       }
+       |       REDIR_WORD  LESS_LESS_MINUS WORD
+--- 554,558 ----
+                         redir.filename = $3;
+                         $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
+!                        push_heredoc ($$);
+                       }
+       |       REDIR_WORD  LESS_LESS_MINUS WORD
+***************
+*** 556,560 ****
+                         redir.filename = $3;
+                         $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
+!                        redir_stack[need_here_doc++] = $$;
+                       }
+       |       LESS_LESS_LESS WORD
+--- 561,565 ----
+                         redir.filename = $3;
+                         $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
+!                        push_heredoc ($$);
+                       }
+       |       LESS_LESS_LESS WORD
+***************
+*** 2637,2640 ****
+--- 2642,2660 ----
+  static int esacs_needed_count;
+  
++ static void
++ push_heredoc (r)
++      REDIRECT *r;
++ {
++   if (need_here_doc >= HEREDOC_MAX)
++     {
++       last_command_exit_value = EX_BADUSAGE;
++       need_here_doc = 0;
++       report_syntax_error (_("maximum here-document count exceeded"));
++       reset_parser ();
++       exit_shell (last_command_exit_value);
++     }
++   redir_stack[need_here_doc++] = r;
++ }
++ 
+  void
+  gather_here_documents ()
+*** ../bash-4.3.27/y.tab.c     2014-10-01 11:38:24.000000000 -0400
+--- y.tab.c    2014-10-01 12:46:11.000000000 -0400
+***************
+*** 169,173 ****
+  
+  /* Copy the first part of user declarations.  */
+! #line 21 "/usr/homes/chet/src/bash/src/parse.y"
+  
+  #include "config.h"
+--- 169,173 ----
+  
+  /* Copy the first part of user declarations.  */
+! #line 21 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+  
+  #include "config.h"
+***************
+*** 320,323 ****
+--- 320,326 ----
+  static int reserved_word_acceptable __P((int));
+  static int yylex __P((void));
++ 
++ static void push_heredoc __P((REDIRECT *));
++ static char *mk_alexpansion __P((char *));
+  static int alias_expand_token __P((char *));
+  static int time_command_acceptable __P((void));
+***************
+*** 417,421 ****
+  /* Variables to manage the task of reading here documents, because we need to
+     defer the reading until after a complete command has been collected. */
+! static REDIRECT *redir_stack[10];
+  int need_here_doc;
+  
+--- 420,426 ----
+  /* Variables to manage the task of reading here documents, because we need to
+     defer the reading until after a complete command has been collected. */
+! #define HEREDOC_MAX 16
+! 
+! static REDIRECT *redir_stack[HEREDOC_MAX];
+  int need_here_doc;
+  
+***************
+*** 459,463 ****
+     index is decremented after a case, select, or for command is parsed. */
+  #define MAX_CASE_NEST        128
+! static int word_lineno[MAX_CASE_NEST];
+  static int word_top = -1;
+  
+--- 464,468 ----
+     index is decremented after a case, select, or for command is parsed. */
+  #define MAX_CASE_NEST        128
+! static int word_lineno[MAX_CASE_NEST+1];
+  static int word_top = -1;
+  
+***************
+*** 493,497 ****
+  #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+  typedef union YYSTYPE
+! #line 324 "/usr/homes/chet/src/bash/src/parse.y"
+  {
+    WORD_DESC *word;           /* the word that we read. */
+--- 498,502 ----
+  #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+  typedef union YYSTYPE
+! #line 329 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+  {
+    WORD_DESC *word;           /* the word that we read. */
+***************
+*** 504,508 ****
+  }
+  /* Line 193 of yacc.c.  */
+! #line 507 "y.tab.c"
+       YYSTYPE;
+  # define yystype YYSTYPE /* obsolescent; will be withdrawn */
+--- 509,513 ----
+  }
+  /* Line 193 of yacc.c.  */
+! #line 512 "y.tab.c"
+       YYSTYPE;
+  # define yystype YYSTYPE /* obsolescent; will be withdrawn */
+***************
+*** 517,521 ****
+  
+  /* Line 216 of yacc.c.  */
+! #line 520 "y.tab.c"
+  
+  #ifdef short
+--- 522,526 ----
+  
+  /* Line 216 of yacc.c.  */
+! #line 525 "y.tab.c"
+  
+  #ifdef short
+***************
+*** 887,907 ****
+  static const yytype_uint16 yyrline[] =
+  {
+!        0,   377,   377,   388,   397,   412,   422,   424,   428,   434,
+!      440,   446,   452,   458,   464,   470,   476,   482,   488,   494,
+!      500,   506,   512,   518,   525,   532,   539,   546,   553,   560,
+!      566,   572,   578,   584,   590,   596,   602,   608,   614,   620,
+!      626,   632,   638,   644,   650,   656,   662,   668,   674,   680,
+!      686,   692,   700,   702,   704,   708,   712,   723,   725,   729,
+!      731,   733,   749,   751,   755,   757,   759,   761,   763,   765,
+!      767,   769,   771,   773,   775,   779,   784,   789,   794,   799,
+!      804,   809,   814,   821,   826,   831,   836,   843,   848,   853,
+!      858,   863,   868,   875,   880,   885,   892,   895,   898,   902,
+!      904,   935,   942,   947,   964,   969,   986,   993,   995,   997,
+!     1002,  1006,  1010,  1014,  1016,  1018,  1022,  1023,  1027,  1029,
+!     1031,  1033,  1037,  1039,  1041,  1043,  1045,  1047,  1051,  1053,
+!     1062,  1070,  1071,  1077,  1078,  1085,  1089,  1091,  1093,  1100,
+!     1102,  1104,  1108,  1109,  1112,  1114,  1116,  1120,  1121,  1130,
+!     1143,  1159,  1174,  1176,  1178,  1185,  1188,  1192,  1194,  1200,
+!     1206,  1223,  1243,  1245,  1268,  1272,  1274,  1276
+  };
+  #endif
+--- 892,912 ----
+  static const yytype_uint16 yyrline[] =
+  {
+!        0,   382,   382,   393,   402,   417,   427,   429,   433,   439,
+!      445,   451,   457,   463,   469,   475,   481,   487,   493,   499,
+!      505,   511,   517,   523,   530,   537,   544,   551,   558,   565,
+!      571,   577,   583,   589,   595,   601,   607,   613,   619,   625,
+!      631,   637,   643,   649,   655,   661,   667,   673,   679,   685,
+!      691,   697,   705,   707,   709,   713,   717,   728,   730,   734,
+!      736,   738,   754,   756,   760,   762,   764,   766,   768,   770,
+!      772,   774,   776,   778,   780,   784,   789,   794,   799,   804,
+!      809,   814,   819,   826,   831,   836,   841,   848,   853,   858,
+!      863,   868,   873,   880,   885,   890,   897,   900,   903,   907,
+!      909,   940,   947,   952,   969,   974,   991,   998,  1000,  1002,
+!     1007,  1011,  1015,  1019,  1021,  1023,  1027,  1028,  1032,  1034,
+!     1036,  1038,  1042,  1044,  1046,  1048,  1050,  1052,  1056,  1058,
+!     1067,  1075,  1076,  1082,  1083,  1090,  1094,  1096,  1098,  1105,
+!     1107,  1109,  1113,  1114,  1117,  1119,  1121,  1125,  1126,  1135,
+!     1148,  1164,  1179,  1181,  1183,  1190,  1193,  1197,  1199,  1205,
+!     1211,  1228,  1248,  1250,  1273,  1277,  1279,  1281
+  };
+  #endif
+***************
+*** 2094,2098 ****
+      {
+          case 2:
+! #line 378 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         /* Case of regular command.  Discard the error
+--- 2099,2103 ----
+      {
+          case 2:
+! #line 383 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Case of regular command.  Discard the error
+***************
+*** 2108,2112 ****
+  
+    case 3:
+! #line 389 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         /* Case of regular command, but not a very
+--- 2113,2117 ----
+  
+    case 3:
+! #line 394 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Case of regular command, but not a very
+***************
+*** 2120,2124 ****
+  
+    case 4:
+! #line 398 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         /* Error during parsing.  Return NULL command. */
+--- 2125,2129 ----
+  
+    case 4:
+! #line 403 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Error during parsing.  Return NULL command. */
+***************
+*** 2138,2142 ****
+  
+    case 5:
+! #line 413 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         /* Case of EOF seen by itself.  Do ignoreeof or
+--- 2143,2147 ----
+  
+    case 5:
+! #line 418 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Case of EOF seen by itself.  Do ignoreeof or
+***************
+*** 2149,2163 ****
+  
+    case 6:
+! #line 423 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
+      break;
+  
+    case 7:
+! #line 425 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); }
+      break;
+  
+    case 8:
+! #line 429 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 1;
+--- 2154,2168 ----
+  
+    case 6:
+! #line 428 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
+      break;
+  
+    case 7:
+! #line 430 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); }
+      break;
+  
+    case 8:
+! #line 434 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2168,2172 ****
+  
+    case 9:
+! #line 435 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 0;
+--- 2173,2177 ----
+  
+    case 9:
+! #line 440 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2177,2181 ****
+  
+    case 10:
+! #line 441 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2182,2186 ----
+  
+    case 10:
+! #line 446 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2186,2190 ****
+  
+    case 11:
+! #line 447 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2191,2195 ----
+  
+    case 11:
+! #line 452 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2195,2199 ****
+  
+    case 12:
+! #line 453 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2200,2204 ----
+  
+    case 12:
+! #line 458 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2204,2208 ****
+  
+    case 13:
+! #line 459 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2209,2213 ----
+  
+    case 13:
+! #line 464 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2213,2217 ****
+  
+    case 14:
+! #line 465 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 1;
+--- 2218,2222 ----
+  
+    case 14:
+! #line 470 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2222,2226 ****
+  
+    case 15:
+! #line 471 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2227,2231 ----
+  
+    case 15:
+! #line 476 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2231,2235 ****
+  
+    case 16:
+! #line 477 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2236,2240 ----
+  
+    case 16:
+! #line 482 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2240,2244 ****
+  
+    case 17:
+! #line 483 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 1;
+--- 2245,2249 ----
+  
+    case 17:
+! #line 488 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2249,2253 ****
+  
+    case 18:
+! #line 489 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2254,2258 ----
+  
+    case 18:
+! #line 494 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2258,2262 ****
+  
+    case 19:
+! #line 495 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2263,2267 ----
+  
+    case 19:
+! #line 500 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2267,2271 ****
+  
+    case 20:
+! #line 501 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 0;
+--- 2272,2276 ----
+  
+    case 20:
+! #line 506 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2276,2280 ****
+  
+    case 21:
+! #line 507 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2281,2285 ----
+  
+    case 21:
+! #line 512 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2285,2289 ****
+  
+    case 22:
+! #line 513 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2290,2294 ----
+  
+    case 22:
+! #line 518 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2294,2358 ****
+  
+    case 23:
+! #line 519 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 0;
+                         redir.filename = (yyvsp[(2) - (2)].word);
+                         (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0);
+!                        redir_stack[need_here_doc++] = (yyval.redirect);
+                       }
+      break;
+  
+    case 24:
+! #line 526 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+                         redir.filename = (yyvsp[(3) - (3)].word);
+                         (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0);
+!                        redir_stack[need_here_doc++] = (yyval.redirect);
+                       }
+      break;
+  
+    case 25:
+! #line 533 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+                         redir.filename = (yyvsp[(3) - (3)].word);
+                         (yyval.redirect) = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
+!                        redir_stack[need_here_doc++] = (yyval.redirect);
+                       }
+      break;
+  
+    case 26:
+! #line 540 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 0;
+                         redir.filename = (yyvsp[(2) - (2)].word);
+                         (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0);
+!                        redir_stack[need_here_doc++] = (yyval.redirect);
+                       }
+      break;
+  
+    case 27:
+! #line 547 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+                         redir.filename = (yyvsp[(3) - (3)].word);
+                         (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0);
+!                        redir_stack[need_here_doc++] = (yyval.redirect);
+                       }
+      break;
+  
+    case 28:
+! #line 554 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+                         redir.filename = (yyvsp[(3) - (3)].word);
+                         (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
+!                        redir_stack[need_here_doc++] = (yyval.redirect);
+                       }
+      break;
+  
+    case 29:
+! #line 561 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 0;
+--- 2299,2363 ----
+  
+    case 23:
+! #line 524 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+                         redir.filename = (yyvsp[(2) - (2)].word);
+                         (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0);
+!                        push_heredoc ((yyval.redirect));
+                       }
+      break;
+  
+    case 24:
+! #line 531 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+                         redir.filename = (yyvsp[(3) - (3)].word);
+                         (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0);
+!                        push_heredoc ((yyval.redirect));
+                       }
+      break;
+  
+    case 25:
+! #line 538 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+                         redir.filename = (yyvsp[(3) - (3)].word);
+                         (yyval.redirect) = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
+!                        push_heredoc ((yyval.redirect));
+                       }
+      break;
+  
+    case 26:
+! #line 545 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+                         redir.filename = (yyvsp[(2) - (2)].word);
+                         (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0);
+!                        push_heredoc ((yyval.redirect));
+                       }
+      break;
+  
+    case 27:
+! #line 552 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+                         redir.filename = (yyvsp[(3) - (3)].word);
+                         (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0);
+!                        push_heredoc ((yyval.redirect));
+                       }
+      break;
+  
+    case 28:
+! #line 559 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+                         redir.filename = (yyvsp[(3) - (3)].word);
+                         (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
+!                        push_heredoc ((yyval.redirect));
+                       }
+      break;
+  
+    case 29:
+! #line 566 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2363,2367 ****
+  
+    case 30:
+! #line 567 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2368,2372 ----
+  
+    case 30:
+! #line 572 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2372,2376 ****
+  
+    case 31:
+! #line 573 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2377,2381 ----
+  
+    case 31:
+! #line 578 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2381,2385 ****
+  
+    case 32:
+! #line 579 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 0;
+--- 2386,2390 ----
+  
+    case 32:
+! #line 584 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2390,2394 ****
+  
+    case 33:
+! #line 585 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2395,2399 ----
+  
+    case 33:
+! #line 590 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2399,2403 ****
+  
+    case 34:
+! #line 591 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2404,2408 ----
+  
+    case 34:
+! #line 596 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2408,2412 ****
+  
+    case 35:
+! #line 597 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 1;
+--- 2413,2417 ----
+  
+    case 35:
+! #line 602 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2417,2421 ****
+  
+    case 36:
+! #line 603 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2422,2426 ----
+  
+    case 36:
+! #line 608 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2426,2430 ****
+  
+    case 37:
+! #line 609 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2431,2435 ----
+  
+    case 37:
+! #line 614 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2435,2439 ****
+  
+    case 38:
+! #line 615 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 0;
+--- 2440,2444 ----
+  
+    case 38:
+! #line 620 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2444,2448 ****
+  
+    case 39:
+! #line 621 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2449,2453 ----
+  
+    case 39:
+! #line 626 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2453,2457 ****
+  
+    case 40:
+! #line 627 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2458,2462 ----
+  
+    case 40:
+! #line 632 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2462,2466 ****
+  
+    case 41:
+! #line 633 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 1;
+--- 2467,2471 ----
+  
+    case 41:
+! #line 638 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2471,2475 ****
+  
+    case 42:
+! #line 639 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2476,2480 ----
+  
+    case 42:
+! #line 644 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2480,2484 ****
+  
+    case 43:
+! #line 645 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2485,2489 ----
+  
+    case 43:
+! #line 650 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2489,2493 ****
+  
+    case 44:
+! #line 651 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 1;
+--- 2494,2498 ----
+  
+    case 44:
+! #line 656 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2498,2502 ****
+  
+    case 45:
+! #line 657 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2503,2507 ----
+  
+    case 45:
+! #line 662 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2507,2511 ****
+  
+    case 46:
+! #line 663 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2512,2516 ----
+  
+    case 46:
+! #line 668 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2516,2520 ****
+  
+    case 47:
+! #line 669 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 0;
+--- 2521,2525 ----
+  
+    case 47:
+! #line 674 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2525,2529 ****
+  
+    case 48:
+! #line 675 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2530,2534 ----
+  
+    case 48:
+! #line 680 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2534,2538 ****
+  
+    case 49:
+! #line 681 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2539,2543 ----
+  
+    case 49:
+! #line 686 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2543,2547 ****
+  
+    case 50:
+! #line 687 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 1;
+--- 2548,2552 ----
+  
+    case 50:
+! #line 692 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2552,2556 ****
+  
+    case 51:
+! #line 693 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         source.dest = 1;
+--- 2557,2561 ----
+  
+    case 51:
+! #line 698 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2561,2580 ****
+  
+    case 52:
+! #line 701 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
+      break;
+  
+    case 53:
+! #line 703 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
+      break;
+  
+    case 54:
+! #line 705 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; }
+      break;
+  
+    case 55:
+! #line 709 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.redirect) = (yyvsp[(1) - (1)].redirect);
+--- 2566,2585 ----
+  
+    case 52:
+! #line 706 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
+      break;
+  
+    case 53:
+! #line 708 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
+      break;
+  
+    case 54:
+! #line 710 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; }
+      break;
+  
+    case 55:
+! #line 714 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.redirect) = (yyvsp[(1) - (1)].redirect);
+***************
+*** 2583,2587 ****
+  
+    case 56:
+! #line 713 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         register REDIRECT *t;
+--- 2588,2592 ----
+  
+    case 56:
+! #line 718 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         register REDIRECT *t;
+***************
+*** 2595,2619 ****
+  
+    case 57:
+! #line 724 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); }
+      break;
+  
+    case 58:
+! #line 726 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); }
+      break;
+  
+    case 59:
+! #line 730 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); }
+      break;
+  
+    case 60:
+! #line 732 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 61:
+! #line 734 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         COMMAND *tc;
+--- 2600,2624 ----
+  
+    case 57:
+! #line 729 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); }
+      break;
+  
+    case 58:
+! #line 731 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); }
+      break;
+  
+    case 59:
+! #line 735 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); }
+      break;
+  
+    case 60:
+! #line 737 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 61:
+! #line 739 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         COMMAND *tc;
+***************
+*** 2634,2703 ****
+  
+    case 62:
+! #line 750 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 63:
+! #line 752 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 64:
+! #line 756 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 65:
+! #line 758 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 66:
+! #line 760 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
+      break;
+  
+    case 67:
+! #line 762 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
+      break;
+  
+    case 68:
+! #line 764 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 69:
+! #line 766 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 70:
+! #line 768 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 71:
+! #line 770 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 72:
+! #line 772 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 73:
+! #line 774 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 74:
+! #line 776 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 75:
+! #line 780 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+--- 2639,2708 ----
+  
+    case 62:
+! #line 755 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 63:
+! #line 757 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 64:
+! #line 761 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 65:
+! #line 763 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 66:
+! #line 765 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
+      break;
+  
+    case 67:
+! #line 767 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
+      break;
+  
+    case 68:
+! #line 769 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 69:
+! #line 771 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 70:
+! #line 773 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 71:
+! #line 775 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 72:
+! #line 777 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 73:
+! #line 779 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 74:
+! #line 781 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 75:
+! #line 785 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+***************
+*** 2707,2711 ****
+  
+    case 76:
+! #line 785 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+--- 2712,2716 ----
+  
+    case 76:
+! #line 790 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+***************
+*** 2715,2719 ****
+  
+    case 77:
+! #line 790 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+--- 2720,2724 ----
+  
+    case 77:
+! #line 795 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+***************
+*** 2723,2727 ****
+  
+    case 78:
+! #line 795 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+--- 2728,2732 ----
+  
+    case 78:
+! #line 800 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+***************
+*** 2731,2735 ****
+  
+    case 79:
+! #line 800 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+--- 2736,2740 ----
+  
+    case 79:
+! #line 805 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+***************
+*** 2739,2743 ****
+  
+    case 80:
+! #line 805 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+--- 2744,2748 ----
+  
+    case 80:
+! #line 810 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+***************
+*** 2747,2751 ****
+  
+    case 81:
+! #line 810 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
+--- 2752,2756 ----
+  
+    case 81:
+! #line 815 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
+***************
+*** 2755,2759 ****
+  
+    case 82:
+! #line 815 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
+--- 2760,2764 ----
+  
+    case 82:
+! #line 820 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
+***************
+*** 2763,2767 ****
+  
+    case 83:
+! #line 822 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
+--- 2768,2772 ----
+  
+    case 83:
+! #line 827 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
+***************
+*** 2771,2775 ****
+  
+    case 84:
+! #line 827 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
+--- 2776,2780 ----
+  
+    case 84:
+! #line 832 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
+***************
+*** 2779,2783 ****
+  
+    case 85:
+! #line 832 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
+--- 2784,2788 ----
+  
+    case 85:
+! #line 837 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
+***************
+*** 2787,2791 ****
+  
+    case 86:
+! #line 837 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
+--- 2792,2796 ----
+  
+    case 86:
+! #line 842 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
+***************
+*** 2795,2799 ****
+  
+    case 87:
+! #line 844 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+--- 2800,2804 ----
+  
+    case 87:
+! #line 849 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+***************
+*** 2803,2807 ****
+  
+    case 88:
+! #line 849 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+--- 2808,2812 ----
+  
+    case 88:
+! #line 854 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+***************
+*** 2811,2815 ****
+  
+    case 89:
+! #line 854 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+--- 2816,2820 ----
+  
+    case 89:
+! #line 859 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+***************
+*** 2819,2823 ****
+  
+    case 90:
+! #line 859 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+--- 2824,2828 ----
+  
+    case 90:
+! #line 864 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+***************
+*** 2827,2831 ****
+  
+    case 91:
+! #line 864 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+--- 2832,2836 ----
+  
+    case 91:
+! #line 869 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+***************
+*** 2835,2839 ****
+  
+    case 92:
+! #line 869 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+--- 2840,2844 ----
+  
+    case 92:
+! #line 874 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+***************
+*** 2843,2847 ****
+  
+    case 93:
+! #line 876 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]);
+--- 2848,2852 ----
+  
+    case 93:
+! #line 881 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]);
+***************
+*** 2851,2855 ****
+  
+    case 94:
+! #line 881 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]);
+--- 2856,2860 ----
+  
+    case 94:
+! #line 886 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]);
+***************
+*** 2859,2863 ****
+  
+    case 95:
+! #line 886 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]);
+--- 2864,2868 ----
+  
+    case 95:
+! #line 891 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]);
+***************
+*** 2867,2891 ****
+  
+    case 96:
+! #line 893 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 97:
+! #line 896 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 98:
+! #line 899 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 99:
+! #line 903 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 100:
+! #line 905 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         COMMAND *tc;
+--- 2872,2896 ----
+  
+    case 96:
+! #line 898 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 97:
+! #line 901 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 98:
+! #line 904 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 99:
+! #line 908 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 100:
+! #line 910 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         COMMAND *tc;
+***************
+*** 2919,2923 ****
+  
+    case 101:
+! #line 936 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command));
+--- 2924,2928 ----
+  
+    case 101:
+! #line 941 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command));
+***************
+*** 2927,2931 ****
+  
+    case 102:
+! #line 943 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command));
+--- 2932,2936 ----
+  
+    case 102:
+! #line 948 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command));
+***************
+*** 2935,2939 ****
+  
+    case 103:
+! #line 948 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         COMMAND *tc;
+--- 2940,2944 ----
+  
+    case 103:
+! #line 953 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         COMMAND *tc;
+***************
+*** 2955,2959 ****
+  
+    case 104:
+! #line 965 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command));
+--- 2960,2964 ----
+  
+    case 104:
+! #line 970 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command));
+***************
+*** 2963,2967 ****
+  
+    case 105:
+! #line 970 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         COMMAND *tc;
+--- 2968,2972 ----
+  
+    case 105:
+! #line 975 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         COMMAND *tc;
+***************
+*** 2983,2987 ****
+  
+    case 106:
+! #line 987 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command)));
+--- 2988,2992 ----
+  
+    case 106:
+! #line 992 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command)));
+***************
+*** 2991,3105 ****
+  
+    case 107:
+! #line 994 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); }
+      break;
+  
+    case 108:
+! #line 996 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); }
+      break;
+  
+    case 109:
+! #line 998 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); }
+      break;
+  
+    case 110:
+! #line 1003 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); }
+      break;
+  
+    case 111:
+! #line 1007 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); }
+      break;
+  
+    case 112:
+! #line 1011 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(2) - (3)].command); }
+      break;
+  
+    case 113:
+! #line 1015 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); }
+      break;
+  
+    case 114:
+! #line 1017 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); }
+      break;
+  
+    case 115:
+! #line 1019 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); }
+      break;
+  
+    case 117:
+! #line 1024 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); }
+      break;
+  
+    case 118:
+! #line 1028 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); }
+      break;
+  
+    case 119:
+! #line 1030 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); }
+      break;
+  
+    case 120:
+! #line 1032 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); }
+      break;
+  
+    case 121:
+! #line 1034 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); }
+      break;
+  
+    case 122:
+! #line 1038 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 123:
+! #line 1040 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 124:
+! #line 1042 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 125:
+! #line 1044 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 126:
+! #line 1046 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 127:
+! #line 1048 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 128:
+! #line 1052 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
+      break;
+  
+    case 129:
+! #line 1054 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); }
+      break;
+  
+    case 130:
+! #line 1063 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(2) - (2)].command);
+--- 2996,3110 ----
+  
+    case 107:
+! #line 999 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); }
+      break;
+  
+    case 108:
+! #line 1001 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); }
+      break;
+  
+    case 109:
+! #line 1003 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); }
+      break;
+  
+    case 110:
+! #line 1008 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); }
+      break;
+  
+    case 111:
+! #line 1012 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); }
+      break;
+  
+    case 112:
+! #line 1016 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(2) - (3)].command); }
+      break;
+  
+    case 113:
+! #line 1020 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); }
+      break;
+  
+    case 114:
+! #line 1022 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); }
+      break;
+  
+    case 115:
+! #line 1024 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); }
+      break;
+  
+    case 117:
+! #line 1029 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); }
+      break;
+  
+    case 118:
+! #line 1033 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); }
+      break;
+  
+    case 119:
+! #line 1035 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); }
+      break;
+  
+    case 120:
+! #line 1037 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); }
+      break;
+  
+    case 121:
+! #line 1039 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); }
+      break;
+  
+    case 122:
+! #line 1043 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 123:
+! #line 1045 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 124:
+! #line 1047 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 125:
+! #line 1049 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 126:
+! #line 1051 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 127:
+! #line 1053 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 128:
+! #line 1057 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
+      break;
+  
+    case 129:
+! #line 1059 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); }
+      break;
+  
+    case 130:
+! #line 1068 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(2) - (2)].command);
+***************
+*** 3110,3114 ****
+  
+    case 132:
+! #line 1072 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(2) - (2)].command);
+--- 3115,3119 ----
+  
+    case 132:
+! #line 1077 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(2) - (2)].command);
+***************
+*** 3117,3121 ****
+  
+    case 134:
+! #line 1079 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
+--- 3122,3126 ----
+  
+    case 134:
+! #line 1084 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
+***************
+*** 3127,3141 ****
+  
+    case 136:
+! #line 1090 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
+      break;
+  
+    case 137:
+! #line 1092 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
+      break;
+  
+    case 138:
+! #line 1094 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         if ((yyvsp[(1) - (4)].command)->type == cm_connection)
+--- 3132,3146 ----
+  
+    case 136:
+! #line 1095 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
+      break;
+  
+    case 137:
+! #line 1097 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
+      break;
+  
+    case 138:
+! #line 1099 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(1) - (4)].command)->type == cm_connection)
+***************
+*** 3147,3181 ****
+  
+    case 139:
+! #line 1101 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
+      break;
+  
+    case 140:
+! #line 1103 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
+      break;
+  
+    case 141:
+! #line 1105 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 144:
+! #line 1113 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.number) = '\n'; }
+      break;
+  
+    case 145:
+! #line 1115 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.number) = ';'; }
+      break;
+  
+    case 146:
+! #line 1117 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.number) = yacc_EOF; }
+      break;
+  
+    case 149:
+! #line 1131 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(1) - (1)].command);
+--- 3152,3186 ----
+  
+    case 139:
+! #line 1106 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
+      break;
+  
+    case 140:
+! #line 1108 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
+      break;
+  
+    case 141:
+! #line 1110 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 144:
+! #line 1118 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = '\n'; }
+      break;
+  
+    case 145:
+! #line 1120 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = ';'; }
+      break;
+  
+    case 146:
+! #line 1122 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = yacc_EOF; }
+      break;
+  
+    case 149:
+! #line 1136 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(1) - (1)].command);
+***************
+*** 3193,3197 ****
+  
+    case 150:
+! #line 1144 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         if ((yyvsp[(1) - (2)].command)->type == cm_connection)
+--- 3198,3202 ----
+  
+    case 150:
+! #line 1149 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(1) - (2)].command)->type == cm_connection)
+***************
+*** 3212,3216 ****
+  
+    case 151:
+! #line 1160 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(1) - (2)].command);
+--- 3217,3221 ----
+  
+    case 151:
+! #line 1165 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(1) - (2)].command);
+***************
+*** 3228,3242 ****
+  
+    case 152:
+! #line 1175 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
+      break;
+  
+    case 153:
+! #line 1177 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
+      break;
+  
+    case 154:
+! #line 1179 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
+--- 3233,3247 ----
+  
+    case 152:
+! #line 1180 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
+      break;
+  
+    case 153:
+! #line 1182 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
+      break;
+  
+    case 154:
+! #line 1184 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
+***************
+*** 3248,3267 ****
+  
+    case 155:
+! #line 1186 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); }
+      break;
+  
+    case 156:
+! #line 1189 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 157:
+! #line 1193 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 158:
+! #line 1195 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         if ((yyvsp[(2) - (2)].command))
+--- 3253,3272 ----
+  
+    case 155:
+! #line 1191 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); }
+      break;
+  
+    case 156:
+! #line 1194 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 157:
+! #line 1198 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 158:
+! #line 1200 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(2) - (2)].command))
+***************
+*** 3272,3276 ****
+  
+    case 159:
+! #line 1201 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         if ((yyvsp[(2) - (2)].command))
+--- 3277,3281 ----
+  
+    case 159:
+! #line 1206 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(2) - (2)].command))
+***************
+*** 3281,3285 ****
+  
+    case 160:
+! #line 1207 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         ELEMENT x;
+--- 3286,3290 ----
+  
+    case 160:
+! #line 1212 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         ELEMENT x;
+***************
+*** 3301,3305 ****
+  
+    case 161:
+! #line 1224 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         ELEMENT x;
+--- 3306,3310 ----
+  
+    case 161:
+! #line 1229 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         ELEMENT x;
+***************
+*** 3322,3331 ****
+  
+    case 162:
+! #line 1244 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); }
+      break;
+  
+    case 163:
+! #line 1246 "/usr/homes/chet/src/bash/src/parse.y"
+      {
+                         /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */
+--- 3327,3336 ----
+  
+    case 162:
+! #line 1249 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); }
+      break;
+  
+    case 163:
+! #line 1251 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */
+***************
+*** 3353,3372 ****
+  
+    case 164:
+! #line 1269 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 165:
+! #line 1273 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE; }
+      break;
+  
+    case 166:
+! #line 1275 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
+      break;
+  
+    case 167:
+! #line 1277 "/usr/homes/chet/src/bash/src/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
+      break;
+--- 3358,3377 ----
+  
+    case 164:
+! #line 1274 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 165:
+! #line 1278 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE; }
+      break;
+  
+    case 166:
+! #line 1280 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
+      break;
+  
+    case 167:
+! #line 1282 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
+      break;
+***************
+*** 3374,3378 ****
+  
+  /* Line 1267 of yacc.c.  */
+! #line 3377 "y.tab.c"
+        default: break;
+      }
+--- 3379,3383 ----
+  
+  /* Line 1267 of yacc.c.  */
+! #line 3382 "y.tab.c"
+        default: break;
+      }
+***************
+*** 3588,3592 ****
+  
+  
+! #line 1279 "/usr/homes/chet/src/bash/src/parse.y"
+  
+  
+--- 3593,3597 ----
+  
+  
+! #line 1284 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+  
+  
+***************
+*** 4949,4952 ****
+--- 4954,4972 ----
+  static int esacs_needed_count;
+  
++ static void
++ push_heredoc (r)
++      REDIRECT *r;
++ {
++   if (need_here_doc >= HEREDOC_MAX)
++     {
++       last_command_exit_value = EX_BADUSAGE;
++       need_here_doc = 0;
++       report_syntax_error (_("maximum here-document count exceeded"));
++       reset_parser ();
++       exit_shell (last_command_exit_value);
++     }
++   redir_stack[need_here_doc++] = r;
++ }
++ 
+  void
+  gather_here_documents ()
+***************
+*** 8542,8543 ****
+--- 8562,8564 ----
+  }
+  #endif /* HANDLE_MULTIBYTE */
++ 
+*** ../bash-4.3/patchlevel.h   2012-12-29 10:47:57.000000000 -0500
+--- patchlevel.h       2014-03-20 20:01:28.000000000 -0400
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 27
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 28
+  
+  #endif /* _PATCHLEVEL_H_ */
diff --git a/src/patches/bash/bash43-029 b/src/patches/bash/bash43-029
new file mode 100644 (file)
index 0000000..93bd390
--- /dev/null
@@ -0,0 +1,59 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-029
+
+Bug-Reported-by:       Michal Zalewski <lcamtuf@coredump.cx>
+Bug-Reference-ID:
+Bug-Reference-URL:
+
+Bug-Description:
+
+When bash is parsing a function definition that contains a here-document
+delimited by end-of-file (or end-of-string), it leaves the closing delimiter
+uninitialized.  This can result in an invalid memory access when the parsed
+function is later copied.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.3.28/make_cmd.c  2011-12-16 08:08:01.000000000 -0500
+--- make_cmd.c 2014-10-02 11:24:23.000000000 -0400
+***************
+*** 693,696 ****
+--- 693,697 ----
+    temp->redirector = source;
+    temp->redirectee = dest_and_filename;
++   temp->here_doc_eof = 0;
+    temp->instruction = instruction;
+    temp->flags = 0;
+*** ../bash-4.3.28/copy_cmd.c  2009-09-11 16:28:02.000000000 -0400
+--- copy_cmd.c 2014-10-02 11:24:23.000000000 -0400
+***************
+*** 127,131 ****
+      case r_reading_until:
+      case r_deblank_reading_until:
+!       new_redirect->here_doc_eof = savestring (redirect->here_doc_eof);
+        /*FALLTHROUGH*/
+      case r_reading_string:
+--- 127,131 ----
+      case r_reading_until:
+      case r_deblank_reading_until:
+!       new_redirect->here_doc_eof = redirect->here_doc_eof ? savestring (redirect->here_doc_eof) : 0;
+        /*FALLTHROUGH*/
+      case r_reading_string:
+*** ../bash-4.3/patchlevel.h   2012-12-29 10:47:57.000000000 -0500
+--- patchlevel.h       2014-03-20 20:01:28.000000000 -0400
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 28
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 29
+  
+  #endif /* _PATCHLEVEL_H_ */
diff --git a/src/patches/bash/bash43-030 b/src/patches/bash/bash43-030
new file mode 100644 (file)
index 0000000..78984da
--- /dev/null
@@ -0,0 +1,2064 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-030
+
+Bug-Reported-by:       Michal Zalewski <lcamtuf@coredump.cx>
+Bug-Reference-ID:
+Bug-Reference-URL:
+
+Bug-Description:
+
+A combination of nested command substitutions and function importing from
+the environment can cause bash to execute code appearing in the environment
+variable value following the function definition.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.3.29/builtins/evalstring.c       2014-10-01 12:57:47.000000000 -0400
+--- builtins/evalstring.c      2014-10-03 11:57:04.000000000 -0400
+***************
+*** 309,318 ****
+             struct fd_bitmap *bitmap;
+  
+!            if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
+               {
+!                internal_warning ("%s: ignoring function definition attempt", from_file);
+!                should_jump_to_top_level = 0;
+!                last_result = last_command_exit_value = EX_BADUSAGE;
+!                break;
+               }
+  
+--- 313,335 ----
+             struct fd_bitmap *bitmap;
+  
+!            if (flags & SEVAL_FUNCDEF)
+               {
+!                char *x;
+! 
+!                /* If the command parses to something other than a straight
+!                   function definition, or if we have not consumed the entire
+!                   string, or if the parser has transformed the function
+!                   name (as parsing will if it begins or ends with shell
+!                   whitespace, for example), reject the attempt */
+!                if (command->type != cm_function_def ||
+!                    ((x = parser_remaining_input ()) && *x) ||
+!                    (STREQ (from_file, command->value.Function_def->name->word) == 0))
+!                  {
+!                    internal_warning (_("%s: ignoring function definition attempt"), from_file);
+!                    should_jump_to_top_level = 0;
+!                    last_result = last_command_exit_value = EX_BADUSAGE;
+!                    reset_parser ();
+!                    break;
+!                  }
+               }
+  
+***************
+*** 379,383 ****
+  
+             if (flags & SEVAL_ONECMD)
+!              break;
+           }
+       }
+--- 396,403 ----
+  
+             if (flags & SEVAL_ONECMD)
+!              {
+!                reset_parser ();
+!                break;
+!              }
+           }
+       }
+*** ../bash-4.3.29/parse.y     2014-10-01 12:58:43.000000000 -0400
+--- parse.y    2014-10-03 14:48:59.000000000 -0400
+***************
+*** 2539,2542 ****
+--- 2539,2552 ----
+  }
+  
++ char *
++ parser_remaining_input ()
++ {
++   if (shell_input_line == 0)
++     return 0;
++   if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)
++     return '\0';     /* XXX */
++   return (shell_input_line + shell_input_line_index);
++ }
++ 
+  #ifdef INCLUDE_UNUSED
+  /* Back the input pointer up by one, effectively `ungetting' a character. */
+***************
+*** 4028,4033 ****
+    /* reset_parser clears shell_input_line and associated variables */
+    restore_input_line_state (&ls);
+!   if (interactive)
+!     token_to_read = 0;
+  
+    /* Need to find how many characters parse_and_execute consumed, update
+--- 4053,4058 ----
+    /* reset_parser clears shell_input_line and associated variables */
+    restore_input_line_state (&ls);
+! 
+!   token_to_read = 0;
+  
+    /* Need to find how many characters parse_and_execute consumed, update
+*** ../bash-4.3.29/shell.h     2014-10-01 12:57:39.000000000 -0400
+--- shell.h    2014-10-03 14:49:12.000000000 -0400
+***************
+*** 181,184 ****
+--- 181,186 ----
+  
+  /* Let's try declaring these here. */
++ extern char *parser_remaining_input __P((void));
++ 
+  extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *));
+  extern void restore_parser_state __P((sh_parser_state_t *));
+*** ../bash-4.3.28/y.tab.c     2014-10-01 13:09:46.000000000 -0400
+--- y.tab.c    2014-10-04 19:26:22.000000000 -0400
+***************
+*** 169,173 ****
+  
+  /* Copy the first part of user declarations.  */
+! #line 21 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+  
+  #include "config.h"
+--- 169,173 ----
+  
+  /* Copy the first part of user declarations.  */
+! #line 21 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+  
+  #include "config.h"
+***************
+*** 498,502 ****
+  #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+  typedef union YYSTYPE
+! #line 329 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+  {
+    WORD_DESC *word;           /* the word that we read. */
+--- 498,502 ----
+  #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+  typedef union YYSTYPE
+! #line 329 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+  {
+    WORD_DESC *word;           /* the word that we read. */
+***************
+*** 2099,2103 ****
+      {
+          case 2:
+! #line 383 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Case of regular command.  Discard the error
+--- 2099,2103 ----
+      {
+          case 2:
+! #line 383 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         /* Case of regular command.  Discard the error
+***************
+*** 2113,2117 ****
+  
+    case 3:
+! #line 394 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Case of regular command, but not a very
+--- 2113,2117 ----
+  
+    case 3:
+! #line 394 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         /* Case of regular command, but not a very
+***************
+*** 2125,2129 ****
+  
+    case 4:
+! #line 403 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Error during parsing.  Return NULL command. */
+--- 2125,2129 ----
+  
+    case 4:
+! #line 403 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         /* Error during parsing.  Return NULL command. */
+***************
+*** 2143,2147 ****
+  
+    case 5:
+! #line 418 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Case of EOF seen by itself.  Do ignoreeof or
+--- 2143,2147 ----
+  
+    case 5:
+! #line 418 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         /* Case of EOF seen by itself.  Do ignoreeof or
+***************
+*** 2154,2168 ****
+  
+    case 6:
+! #line 428 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
+      break;
+  
+    case 7:
+! #line 430 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); }
+      break;
+  
+    case 8:
+! #line 434 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+--- 2154,2168 ----
+  
+    case 6:
+! #line 428 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
+      break;
+  
+    case 7:
+! #line 430 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); }
+      break;
+  
+    case 8:
+! #line 434 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2173,2177 ****
+  
+    case 9:
+! #line 440 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+--- 2173,2177 ----
+  
+    case 9:
+! #line 440 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2182,2186 ****
+  
+    case 10:
+! #line 446 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2182,2186 ----
+  
+    case 10:
+! #line 446 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2191,2195 ****
+  
+    case 11:
+! #line 452 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2191,2195 ----
+  
+    case 11:
+! #line 452 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2200,2204 ****
+  
+    case 12:
+! #line 458 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2200,2204 ----
+  
+    case 12:
+! #line 458 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2209,2213 ****
+  
+    case 13:
+! #line 464 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2209,2213 ----
+  
+    case 13:
+! #line 464 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2218,2222 ****
+  
+    case 14:
+! #line 470 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+--- 2218,2222 ----
+  
+    case 14:
+! #line 470 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2227,2231 ****
+  
+    case 15:
+! #line 476 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2227,2231 ----
+  
+    case 15:
+! #line 476 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2236,2240 ****
+  
+    case 16:
+! #line 482 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2236,2240 ----
+  
+    case 16:
+! #line 482 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2245,2249 ****
+  
+    case 17:
+! #line 488 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+--- 2245,2249 ----
+  
+    case 17:
+! #line 488 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2254,2258 ****
+  
+    case 18:
+! #line 494 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2254,2258 ----
+  
+    case 18:
+! #line 494 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2263,2267 ****
+  
+    case 19:
+! #line 500 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2263,2267 ----
+  
+    case 19:
+! #line 500 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2272,2276 ****
+  
+    case 20:
+! #line 506 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+--- 2272,2276 ----
+  
+    case 20:
+! #line 506 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2281,2285 ****
+  
+    case 21:
+! #line 512 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2281,2285 ----
+  
+    case 21:
+! #line 512 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2290,2294 ****
+  
+    case 22:
+! #line 518 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2290,2294 ----
+  
+    case 22:
+! #line 518 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2299,2303 ****
+  
+    case 23:
+! #line 524 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+--- 2299,2303 ----
+  
+    case 23:
+! #line 524 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2309,2313 ****
+  
+    case 24:
+! #line 531 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2309,2313 ----
+  
+    case 24:
+! #line 531 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2319,2323 ****
+  
+    case 25:
+! #line 538 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2319,2323 ----
+  
+    case 25:
+! #line 538 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2329,2333 ****
+  
+    case 26:
+! #line 545 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+--- 2329,2333 ----
+  
+    case 26:
+! #line 545 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2339,2343 ****
+  
+    case 27:
+! #line 552 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2339,2343 ----
+  
+    case 27:
+! #line 552 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2349,2353 ****
+  
+    case 28:
+! #line 559 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2349,2353 ----
+  
+    case 28:
+! #line 559 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2359,2363 ****
+  
+    case 29:
+! #line 566 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+--- 2359,2363 ----
+  
+    case 29:
+! #line 566 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2368,2372 ****
+  
+    case 30:
+! #line 572 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2368,2372 ----
+  
+    case 30:
+! #line 572 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2377,2381 ****
+  
+    case 31:
+! #line 578 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2377,2381 ----
+  
+    case 31:
+! #line 578 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2386,2390 ****
+  
+    case 32:
+! #line 584 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+--- 2386,2390 ----
+  
+    case 32:
+! #line 584 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2395,2399 ****
+  
+    case 33:
+! #line 590 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2395,2399 ----
+  
+    case 33:
+! #line 590 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2404,2408 ****
+  
+    case 34:
+! #line 596 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2404,2408 ----
+  
+    case 34:
+! #line 596 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2413,2417 ****
+  
+    case 35:
+! #line 602 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+--- 2413,2417 ----
+  
+    case 35:
+! #line 602 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2422,2426 ****
+  
+    case 36:
+! #line 608 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2422,2426 ----
+  
+    case 36:
+! #line 608 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2431,2435 ****
+  
+    case 37:
+! #line 614 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2431,2435 ----
+  
+    case 37:
+! #line 614 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2440,2444 ****
+  
+    case 38:
+! #line 620 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+--- 2440,2444 ----
+  
+    case 38:
+! #line 620 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2449,2453 ****
+  
+    case 39:
+! #line 626 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2449,2453 ----
+  
+    case 39:
+! #line 626 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2458,2462 ****
+  
+    case 40:
+! #line 632 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2458,2462 ----
+  
+    case 40:
+! #line 632 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2467,2471 ****
+  
+    case 41:
+! #line 638 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+--- 2467,2471 ----
+  
+    case 41:
+! #line 638 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2476,2480 ****
+  
+    case 42:
+! #line 644 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2476,2480 ----
+  
+    case 42:
+! #line 644 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2485,2489 ****
+  
+    case 43:
+! #line 650 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2485,2489 ----
+  
+    case 43:
+! #line 650 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2494,2498 ****
+  
+    case 44:
+! #line 656 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+--- 2494,2498 ----
+  
+    case 44:
+! #line 656 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2503,2507 ****
+  
+    case 45:
+! #line 662 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2503,2507 ----
+  
+    case 45:
+! #line 662 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2512,2516 ****
+  
+    case 46:
+! #line 668 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2512,2516 ----
+  
+    case 46:
+! #line 668 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2521,2525 ****
+  
+    case 47:
+! #line 674 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 0;
+--- 2521,2525 ----
+  
+    case 47:
+! #line 674 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 0;
+***************
+*** 2530,2534 ****
+  
+    case 48:
+! #line 680 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+--- 2530,2534 ----
+  
+    case 48:
+! #line 680 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = (yyvsp[(1) - (3)].number);
+***************
+*** 2539,2543 ****
+  
+    case 49:
+! #line 686 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+--- 2539,2543 ----
+  
+    case 49:
+! #line 686 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.filename = (yyvsp[(1) - (3)].word);
+***************
+*** 2548,2552 ****
+  
+    case 50:
+! #line 692 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+--- 2548,2552 ----
+  
+    case 50:
+! #line 692 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2557,2561 ****
+  
+    case 51:
+! #line 698 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         source.dest = 1;
+--- 2557,2561 ----
+  
+    case 51:
+! #line 698 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         source.dest = 1;
+***************
+*** 2566,2585 ****
+  
+    case 52:
+! #line 706 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
+      break;
+  
+    case 53:
+! #line 708 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
+      break;
+  
+    case 54:
+! #line 710 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; }
+      break;
+  
+    case 55:
+! #line 714 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.redirect) = (yyvsp[(1) - (1)].redirect);
+--- 2566,2585 ----
+  
+    case 52:
+! #line 706 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
+      break;
+  
+    case 53:
+! #line 708 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
+      break;
+  
+    case 54:
+! #line 710 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; }
+      break;
+  
+    case 55:
+! #line 714 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.redirect) = (yyvsp[(1) - (1)].redirect);
+***************
+*** 2588,2592 ****
+  
+    case 56:
+! #line 718 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         register REDIRECT *t;
+--- 2588,2592 ----
+  
+    case 56:
+! #line 718 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         register REDIRECT *t;
+***************
+*** 2600,2624 ****
+  
+    case 57:
+! #line 729 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); }
+      break;
+  
+    case 58:
+! #line 731 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); }
+      break;
+  
+    case 59:
+! #line 735 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); }
+      break;
+  
+    case 60:
+! #line 737 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 61:
+! #line 739 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         COMMAND *tc;
+--- 2600,2624 ----
+  
+    case 57:
+! #line 729 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); }
+      break;
+  
+    case 58:
+! #line 731 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); }
+      break;
+  
+    case 59:
+! #line 735 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); }
+      break;
+  
+    case 60:
+! #line 737 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 61:
+! #line 739 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         COMMAND *tc;
+***************
+*** 2639,2708 ****
+  
+    case 62:
+! #line 755 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 63:
+! #line 757 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 64:
+! #line 761 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 65:
+! #line 763 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 66:
+! #line 765 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
+      break;
+  
+    case 67:
+! #line 767 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
+      break;
+  
+    case 68:
+! #line 769 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 69:
+! #line 771 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 70:
+! #line 773 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 71:
+! #line 775 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 72:
+! #line 777 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 73:
+! #line 779 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 74:
+! #line 781 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 75:
+! #line 785 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+--- 2639,2708 ----
+  
+    case 62:
+! #line 755 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 63:
+! #line 757 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 64:
+! #line 761 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 65:
+! #line 763 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 66:
+! #line 765 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
+      break;
+  
+    case 67:
+! #line 767 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
+      break;
+  
+    case 68:
+! #line 769 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 69:
+! #line 771 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 70:
+! #line 773 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 71:
+! #line 775 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 72:
+! #line 777 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 73:
+! #line 779 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 74:
+! #line 781 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 75:
+! #line 785 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+***************
+*** 2712,2716 ****
+  
+    case 76:
+! #line 790 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+--- 2712,2716 ----
+  
+    case 76:
+! #line 790 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+***************
+*** 2720,2724 ****
+  
+    case 77:
+! #line 795 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+--- 2720,2724 ----
+  
+    case 77:
+! #line 795 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+***************
+*** 2728,2732 ****
+  
+    case 78:
+! #line 800 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+--- 2728,2732 ----
+  
+    case 78:
+! #line 800 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+***************
+*** 2736,2740 ****
+  
+    case 79:
+! #line 805 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+--- 2736,2740 ----
+  
+    case 79:
+! #line 805 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+***************
+*** 2744,2748 ****
+  
+    case 80:
+! #line 810 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+--- 2744,2748 ----
+  
+    case 80:
+! #line 810 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+***************
+*** 2752,2756 ****
+  
+    case 81:
+! #line 815 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
+--- 2752,2756 ----
+  
+    case 81:
+! #line 815 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
+***************
+*** 2760,2764 ****
+  
+    case 82:
+! #line 820 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
+--- 2760,2764 ----
+  
+    case 82:
+! #line 820 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
+***************
+*** 2768,2772 ****
+  
+    case 83:
+! #line 827 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
+--- 2768,2772 ----
+  
+    case 83:
+! #line 827 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
+***************
+*** 2776,2780 ****
+  
+    case 84:
+! #line 832 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
+--- 2776,2780 ----
+  
+    case 84:
+! #line 832 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
+***************
+*** 2784,2788 ****
+  
+    case 85:
+! #line 837 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
+--- 2784,2788 ----
+  
+    case 85:
+! #line 837 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
+***************
+*** 2792,2796 ****
+  
+    case 86:
+! #line 842 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
+--- 2792,2796 ----
+  
+    case 86:
+! #line 842 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                                 (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
+***************
+*** 2800,2804 ****
+  
+    case 87:
+! #line 849 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+--- 2800,2804 ----
+  
+    case 87:
+! #line 849 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+***************
+*** 2808,2812 ****
+  
+    case 88:
+! #line 854 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+--- 2808,2812 ----
+  
+    case 88:
+! #line 854 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
+***************
+*** 2816,2820 ****
+  
+    case 89:
+! #line 859 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+--- 2816,2820 ----
+  
+    case 89:
+! #line 859 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+***************
+*** 2824,2828 ****
+  
+    case 90:
+! #line 864 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+--- 2824,2828 ----
+  
+    case 90:
+! #line 864 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
+***************
+*** 2832,2836 ****
+  
+    case 91:
+! #line 869 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+--- 2832,2836 ----
+  
+    case 91:
+! #line 869 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+***************
+*** 2840,2844 ****
+  
+    case 92:
+! #line 874 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+--- 2840,2844 ----
+  
+    case 92:
+! #line 874 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
+***************
+*** 2848,2852 ****
+  
+    case 93:
+! #line 881 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]);
+--- 2848,2852 ----
+  
+    case 93:
+! #line 881 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]);
+***************
+*** 2856,2860 ****
+  
+    case 94:
+! #line 886 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]);
+--- 2856,2860 ----
+  
+    case 94:
+! #line 886 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]);
+***************
+*** 2864,2868 ****
+  
+    case 95:
+! #line 891 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]);
+--- 2864,2868 ----
+  
+    case 95:
+! #line 891 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]);
+***************
+*** 2872,2896 ****
+  
+    case 96:
+! #line 898 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 97:
+! #line 901 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 98:
+! #line 904 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 99:
+! #line 908 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 100:
+! #line 910 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         COMMAND *tc;
+--- 2872,2896 ----
+  
+    case 96:
+! #line 898 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 97:
+! #line 901 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 98:
+! #line 904 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); }
+      break;
+  
+    case 99:
+! #line 908 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 100:
+! #line 910 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         COMMAND *tc;
+***************
+*** 2924,2928 ****
+  
+    case 101:
+! #line 941 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command));
+--- 2924,2928 ----
+  
+    case 101:
+! #line 941 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command));
+***************
+*** 2932,2936 ****
+  
+    case 102:
+! #line 948 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command));
+--- 2932,2936 ----
+  
+    case 102:
+! #line 948 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command));
+***************
+*** 2940,2944 ****
+  
+    case 103:
+! #line 953 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         COMMAND *tc;
+--- 2940,2944 ----
+  
+    case 103:
+! #line 953 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         COMMAND *tc;
+***************
+*** 2960,2964 ****
+  
+    case 104:
+! #line 970 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command));
+--- 2960,2964 ----
+  
+    case 104:
+! #line 970 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command));
+***************
+*** 2968,2972 ****
+  
+    case 105:
+! #line 975 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         COMMAND *tc;
+--- 2968,2972 ----
+  
+    case 105:
+! #line 975 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         COMMAND *tc;
+***************
+*** 2988,2992 ****
+  
+    case 106:
+! #line 992 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command)));
+--- 2988,2992 ----
+  
+    case 106:
+! #line 992 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command)));
+***************
+*** 2996,3110 ****
+  
+    case 107:
+! #line 999 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); }
+      break;
+  
+    case 108:
+! #line 1001 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); }
+      break;
+  
+    case 109:
+! #line 1003 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); }
+      break;
+  
+    case 110:
+! #line 1008 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); }
+      break;
+  
+    case 111:
+! #line 1012 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); }
+      break;
+  
+    case 112:
+! #line 1016 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(2) - (3)].command); }
+      break;
+  
+    case 113:
+! #line 1020 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); }
+      break;
+  
+    case 114:
+! #line 1022 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); }
+      break;
+  
+    case 115:
+! #line 1024 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); }
+      break;
+  
+    case 117:
+! #line 1029 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); }
+      break;
+  
+    case 118:
+! #line 1033 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); }
+      break;
+  
+    case 119:
+! #line 1035 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); }
+      break;
+  
+    case 120:
+! #line 1037 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); }
+      break;
+  
+    case 121:
+! #line 1039 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); }
+      break;
+  
+    case 122:
+! #line 1043 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 123:
+! #line 1045 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 124:
+! #line 1047 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 125:
+! #line 1049 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 126:
+! #line 1051 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 127:
+! #line 1053 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 128:
+! #line 1057 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
+      break;
+  
+    case 129:
+! #line 1059 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); }
+      break;
+  
+    case 130:
+! #line 1068 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(2) - (2)].command);
+--- 2996,3110 ----
+  
+    case 107:
+! #line 999 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); }
+      break;
+  
+    case 108:
+! #line 1001 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); }
+      break;
+  
+    case 109:
+! #line 1003 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); }
+      break;
+  
+    case 110:
+! #line 1008 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); }
+      break;
+  
+    case 111:
+! #line 1012 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); }
+      break;
+  
+    case 112:
+! #line 1016 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(2) - (3)].command); }
+      break;
+  
+    case 113:
+! #line 1020 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); }
+      break;
+  
+    case 114:
+! #line 1022 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); }
+      break;
+  
+    case 115:
+! #line 1024 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); }
+      break;
+  
+    case 117:
+! #line 1029 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); }
+      break;
+  
+    case 118:
+! #line 1033 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); }
+      break;
+  
+    case 119:
+! #line 1035 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); }
+      break;
+  
+    case 120:
+! #line 1037 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); }
+      break;
+  
+    case 121:
+! #line 1039 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); }
+      break;
+  
+    case 122:
+! #line 1043 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 123:
+! #line 1045 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 124:
+! #line 1047 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 125:
+! #line 1049 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 126:
+! #line 1051 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
+      break;
+  
+    case 127:
+! #line 1053 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
+      break;
+  
+    case 128:
+! #line 1057 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
+      break;
+  
+    case 129:
+! #line 1059 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); }
+      break;
+  
+    case 130:
+! #line 1068 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(2) - (2)].command);
+***************
+*** 3115,3119 ****
+  
+    case 132:
+! #line 1077 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(2) - (2)].command);
+--- 3115,3119 ----
+  
+    case 132:
+! #line 1077 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(2) - (2)].command);
+***************
+*** 3122,3126 ****
+  
+    case 134:
+! #line 1084 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
+--- 3122,3126 ----
+  
+    case 134:
+! #line 1084 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
+***************
+*** 3132,3146 ****
+  
+    case 136:
+! #line 1095 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
+      break;
+  
+    case 137:
+! #line 1097 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
+      break;
+  
+    case 138:
+! #line 1099 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(1) - (4)].command)->type == cm_connection)
+--- 3132,3146 ----
+  
+    case 136:
+! #line 1095 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
+      break;
+  
+    case 137:
+! #line 1097 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
+      break;
+  
+    case 138:
+! #line 1099 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         if ((yyvsp[(1) - (4)].command)->type == cm_connection)
+***************
+*** 3152,3186 ****
+  
+    case 139:
+! #line 1106 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
+      break;
+  
+    case 140:
+! #line 1108 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
+      break;
+  
+    case 141:
+! #line 1110 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 144:
+! #line 1118 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = '\n'; }
+      break;
+  
+    case 145:
+! #line 1120 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = ';'; }
+      break;
+  
+    case 146:
+! #line 1122 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = yacc_EOF; }
+      break;
+  
+    case 149:
+! #line 1136 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(1) - (1)].command);
+--- 3152,3186 ----
+  
+    case 139:
+! #line 1106 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
+      break;
+  
+    case 140:
+! #line 1108 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
+      break;
+  
+    case 141:
+! #line 1110 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 144:
+! #line 1118 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.number) = '\n'; }
+      break;
+  
+    case 145:
+! #line 1120 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.number) = ';'; }
+      break;
+  
+    case 146:
+! #line 1122 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.number) = yacc_EOF; }
+      break;
+  
+    case 149:
+! #line 1136 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(1) - (1)].command);
+***************
+*** 3198,3202 ****
+  
+    case 150:
+! #line 1149 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(1) - (2)].command)->type == cm_connection)
+--- 3198,3202 ----
+  
+    case 150:
+! #line 1149 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         if ((yyvsp[(1) - (2)].command)->type == cm_connection)
+***************
+*** 3217,3221 ****
+  
+    case 151:
+! #line 1165 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(1) - (2)].command);
+--- 3217,3221 ----
+  
+    case 151:
+! #line 1165 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         (yyval.command) = (yyvsp[(1) - (2)].command);
+***************
+*** 3233,3247 ****
+  
+    case 152:
+! #line 1180 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
+      break;
+  
+    case 153:
+! #line 1182 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
+      break;
+  
+    case 154:
+! #line 1184 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
+--- 3233,3247 ----
+  
+    case 152:
+! #line 1180 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
+      break;
+  
+    case 153:
+! #line 1182 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
+      break;
+  
+    case 154:
+! #line 1184 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         if ((yyvsp[(1) - (3)].command)->type == cm_connection)
+***************
+*** 3253,3272 ****
+  
+    case 155:
+! #line 1191 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); }
+      break;
+  
+    case 156:
+! #line 1194 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 157:
+! #line 1198 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 158:
+! #line 1200 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(2) - (2)].command))
+--- 3253,3272 ----
+  
+    case 155:
+! #line 1191 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); }
+      break;
+  
+    case 156:
+! #line 1194 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 157:
+! #line 1198 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 158:
+! #line 1200 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         if ((yyvsp[(2) - (2)].command))
+***************
+*** 3277,3281 ****
+  
+    case 159:
+! #line 1206 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         if ((yyvsp[(2) - (2)].command))
+--- 3277,3281 ----
+  
+    case 159:
+! #line 1206 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         if ((yyvsp[(2) - (2)].command))
+***************
+*** 3286,3290 ****
+  
+    case 160:
+! #line 1212 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         ELEMENT x;
+--- 3286,3290 ----
+  
+    case 160:
+! #line 1212 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         ELEMENT x;
+***************
+*** 3306,3310 ****
+  
+    case 161:
+! #line 1229 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         ELEMENT x;
+--- 3306,3310 ----
+  
+    case 161:
+! #line 1229 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         ELEMENT x;
+***************
+*** 3327,3336 ****
+  
+    case 162:
+! #line 1249 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); }
+      break;
+  
+    case 163:
+! #line 1251 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      {
+                         /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */
+--- 3327,3336 ----
+  
+    case 162:
+! #line 1249 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); }
+      break;
+  
+    case 163:
+! #line 1251 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      {
+                         /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */
+***************
+*** 3358,3377 ****
+  
+    case 164:
+! #line 1274 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 165:
+! #line 1278 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE; }
+      break;
+  
+    case 166:
+! #line 1280 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
+      break;
+  
+    case 167:
+! #line 1282 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
+      break;
+--- 3358,3377 ----
+  
+    case 164:
+! #line 1274 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.command) = (yyvsp[(1) - (1)].command); }
+      break;
+  
+    case 165:
+! #line 1278 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE; }
+      break;
+  
+    case 166:
+! #line 1280 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
+      break;
+  
+    case 167:
+! #line 1282 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+      { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
+      break;
+***************
+*** 3593,3597 ****
+  
+  
+! #line 1284 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
+  
+  
+--- 3593,3597 ----
+  
+  
+! #line 1284 "/usr/src/local/bash/bash-4.3-patched/parse.y"
+  
+  
+***************
+*** 4851,4854 ****
+--- 4851,4864 ----
+  }
+  
++ char *
++ parser_remaining_input ()
++ {
++   if (shell_input_line == 0)
++     return 0;
++   if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)
++     return '\0';     /* XXX */
++   return (shell_input_line + shell_input_line_index);
++ }
++ 
+  #ifdef INCLUDE_UNUSED
+  /* Back the input pointer up by one, effectively `ungetting' a character. */
+***************
+*** 6340,6345 ****
+    /* reset_parser clears shell_input_line and associated variables */
+    restore_input_line_state (&ls);
+!   if (interactive)
+!     token_to_read = 0;
+  
+    /* Need to find how many characters parse_and_execute consumed, update
+--- 6350,6355 ----
+    /* reset_parser clears shell_input_line and associated variables */
+    restore_input_line_state (&ls);
+! 
+!   token_to_read = 0;
+  
+    /* Need to find how many characters parse_and_execute consumed, update
+*** ../bash-4.3/patchlevel.h   2012-12-29 10:47:57.000000000 -0500
+--- patchlevel.h       2014-03-20 20:01:28.000000000 -0400
+***************
+*** 26,30 ****
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 29
+  
+  #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+     looks for to find the patch level (for the sccs version string). */
+  
+! #define PATCHLEVEL 30
+  
+  #endif /* _PATCHLEVEL_H_ */
diff --git a/src/patches/dnsmasq-2.71-support-nettle-3.0.patch b/src/patches/dnsmasq-2.71-support-nettle-3.0.patch
deleted file mode 100644 (file)
index 593a7cd..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-From cdb755c5f16a6768c3e8b1f345fe15fc9244228d Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Wed, 18 Jun 2014 20:52:53 +0100
-Subject: [PATCH] Fix FTBFS with Nettle-3.0.
-
----
- CHANGELOG    |    3 +++
- src/dnssec.c |   18 ++++++++++++------
- 2 files changed, 15 insertions(+), 6 deletions(-)
-
-diff --git a/src/dnssec.c b/src/dnssec.c
-index 2ffb75d..69bfc29 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -28,6 +28,12 @@
- #include <nettle/nettle-meta.h>
- #include <nettle/bignum.h>
-+/* Nettle-3.0 moved to a new API for DSA. We use a name that's defined in the new API
-+   to detect Nettle-3, and invoke the backwards compatibility mode. */
-+#ifdef dsa_params_init
-+#include <nettle/dsa-compat.h>
-+#endif
-+
- #define SERIAL_UNDEF  -100
- #define SERIAL_EQ        0
-@@ -121,8 +127,8 @@ static int hash_init(const struct nettle_hash *hash, void **ctxp, unsigned char
-   return 1;
- }
-   
--static int rsa_verify(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
--                    unsigned char *digest, int algo)
-+static int dnsmasq_rsa_verify(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
-+                            unsigned char *digest, int algo)
- {
-   unsigned char *p;
-   size_t exp_len;
-@@ -173,8 +179,8 @@ static int rsa_verify(struct blockdata *key_data, unsigned int key_len, unsigned
-   return 0;
- }  
--static int dsa_verify(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
--                    unsigned char *digest, int algo)
-+static int dnsmasq_dsa_verify(struct blockdata *key_data, unsigned int key_len, unsigned char *sig, size_t sig_len,
-+                            unsigned char *digest, int algo)
- {
-   unsigned char *p;
-   unsigned int t;
-@@ -293,10 +299,10 @@ static int verify(struct blockdata *key_data, unsigned int key_len, unsigned cha
-   switch (algo)
-     {
-     case 1: case 5: case 7: case 8: case 10:
--      return rsa_verify(key_data, key_len, sig, sig_len, digest, algo);
-+      return dnsmasq_rsa_verify(key_data, key_len, sig, sig_len, digest, algo);
-       
-     case 3: case 6: 
--      return dsa_verify(key_data, key_len, sig, sig_len, digest, algo);
-+      return dnsmasq_dsa_verify(key_data, key_len, sig, sig_len, digest, algo);
-  
- #ifndef NO_NETTLE_ECC   
-     case 13: case 14:
--- 
-1.7.10.4
-
diff --git a/src/patches/dnsmasq-2.71-use-nettle-with-minigmp.patch b/src/patches/dnsmasq-2.71-use-nettle-with-minigmp.patch
deleted file mode 100644 (file)
index 374c9ec..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-From 063efb330a3f341c2548e2cf1f67f83e49cd6395 Mon Sep 17 00:00:00 2001
-From: Simon Kelley <simon@thekelleys.org.uk>
-Date: Tue, 17 Jun 2014 19:49:31 +0100
-Subject: [PATCH] Build config: add -DNO_GMP for use with nettle/mini-gmp
-
----
- Makefile        |    2 +-
- bld/pkg-wrapper |    9 +++++++--
- src/config.h    |    7 +++++++
- src/dnssec.c    |    3 ++-
- 4 files changed, 17 insertions(+), 4 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index c58b50b..17eeb27 100644
---- a/Makefile
-+++ b/Makefile
-@@ -61,7 +61,7 @@ lua_cflags =    `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CON
- lua_libs =      `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua5.1` 
- nettle_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --cflags nettle hogweed`
- nettle_libs =   `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --libs nettle hogweed`
--gmp_libs =      `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --copy -lgmp`
-+gmp_libs =      `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP --copy -lgmp`
- sunos_libs =    `if uname | grep SunOS >/dev/null 2>&1; then echo -lsocket -lnsl -lposix4; fi`
- version =     -DVERSION='\"`$(top)/bld/get-version $(top)`\"'
-diff --git a/bld/pkg-wrapper b/bld/pkg-wrapper
-index 9f9332d..0ddb678 100755
---- a/bld/pkg-wrapper
-+++ b/bld/pkg-wrapper
-@@ -11,9 +11,14 @@ in=`cat`
- if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \
-     echo $in | grep $search >/dev/null 2>&1; then
--
-+# Nasty, nasty, in --copy, arg 2 is another config to search for, use with NO_GMP
-     if [ $op = "--copy" ]; then
--      pkg="$*"
-+      if grep "^\#[[:space:]]*define[[:space:]]*$pkg" config.h >/dev/null 2>&1 || \
-+            echo $in | grep $pkg >/dev/null 2>&1; then
-+          pkg=""
-+      else 
-+          pkg="$*"
-+      fi
-     elif grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \
-             echo $in | grep ${search}_STATIC >/dev/null 2>&1; then
-       pkg=`$pkg  --static $op $*`
-diff --git a/src/config.h b/src/config.h
-index 2155544..ee6d218 100644
---- a/src/config.h
-+++ b/src/config.h
-@@ -105,6 +105,8 @@ HAVE_AUTH
-    define this to include the facility to act as an authoritative DNS
-    server for one or more zones.
-+HAVE_DNSSEC
-+   include DNSSEC validator.
- NO_IPV6
- NO_TFTP
-@@ -118,6 +120,11 @@ NO_AUTH
-    which are enabled  by default in the distributed source tree. Building dnsmasq
-    with something like "make COPTS=-DNO_SCRIPT" will do the trick.
-+NO_NETTLE_ECC
-+   Don't include the ECDSA cypher in DNSSEC validation. Needed for older Nettle versions.
-+NO_GMP
-+   Don't use and link against libgmp, Useful if nettle is built with --enable-mini-gmp.
-+
- LEASEFILE
- CONFFILE
- RESOLVFILE
-diff --git a/src/dnssec.c b/src/dnssec.c
-index 44d626b..2ffb75d 100644
---- a/src/dnssec.c
-+++ b/src/dnssec.c
-@@ -26,7 +26,8 @@
- #  include <nettle/ecc-curve.h>
- #endif
- #include <nettle/nettle-meta.h>
--#include <gmp.h>
-+#include <nettle/bignum.h>
-+
- #define SERIAL_UNDEF  -100
- #define SERIAL_EQ        0
--- 
-1.7.10.4
-
similarity index 94%
rename from src/patches/dnsmasq-2.70-Add-support-to-read-ISC-DHCP-lease-file.patch
rename to src/patches/dnsmasq-2.72rc2-Add-support-to-read-ISC-DHCP-lease-file.patch
index 3194e1f2298cc8d467c3c8d2c6592784cae8f111..9912c7ca93161bc83cfced0e435480adf48fc472 100644 (file)
@@ -1,18 +1,18 @@
 diff --git a/Makefile b/Makefile
-index 292c8bd..5e0cdbe 100644
+index 58a7975..616c6b7 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -69,7 +69,7 @@ objs = cache.o rfc1035.o util.o option.o forward.o network.o \
         dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
         helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
         dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \
--       domain.o dnssec.o blockdata.o
-+       domain.o dnssec.o blockdata.o isc.o
+-       domain.o dnssec.o blockdata.o tables.o loop.o
++       domain.o dnssec.o blockdata.o tables.o loop.o isc.o
  
  hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
         dns-protocol.h radv-protocol.h ip6addr.h
 diff --git a/src/cache.c b/src/cache.c
-index 5cec918..1f5657f 100644
+index 2c3a498..77a7046 100644
 --- a/src/cache.c
 +++ b/src/cache.c
 @@ -17,7 +17,7 @@
@@ -65,10 +65,10 @@ index 5cec918..1f5657f 100644
        cache_hash(crec);
  
 diff --git a/src/dnsmasq.c b/src/dnsmasq.c
-index 1c96a0e..156ac9a 100644
+index f4a89fc..a448ec4 100644
 --- a/src/dnsmasq.c
 +++ b/src/dnsmasq.c
-@@ -934,6 +934,11 @@ int main (int argc, char **argv)
+@@ -940,6 +940,11 @@ int main (int argc, char **argv)
  
          poll_resolv(0, daemon->last_resolv != 0, now);          
          daemon->last_resolv = now;
@@ -81,18 +81,24 @@ index 1c96a0e..156ac9a 100644
        
        if (FD_ISSET(piperead, &rset))
 diff --git a/src/dnsmasq.h b/src/dnsmasq.h
-index 3032546..a40b2a9 100644
+index e74b15a..4a35168 100644
 --- a/src/dnsmasq.h
 +++ b/src/dnsmasq.h
-@@ -1447,3 +1447,8 @@ void slaac_add_addrs(struct dhcp_lease *lease, time_t now, int force);
- time_t periodic_slaac(time_t now, struct dhcp_lease *leases);
+@@ -1463,9 +1463,13 @@ time_t periodic_slaac(time_t now, struct dhcp_lease *leases);
  void slaac_ping_reply(struct in6_addr *sender, unsigned char *packet, char *interface, struct dhcp_lease *leases);
  #endif
-+
 +/* isc.c */
 +#ifdef HAVE_ISC_READER
 +void load_dhcp(time_t now);
 +#endif
++
+ /* loop.c */
+ #ifdef HAVE_LOOP
+ void loop_send_probes();
+ int detect_loop(char *query, int type);
+ #endif
+-
 diff --git a/src/isc.c b/src/isc.c
 new file mode 100644
 index 0000000..5106442
@@ -351,10 +357,10 @@ index 0000000..5106442
 +
 +#endif
 diff --git a/src/option.c b/src/option.c
-index daa728f..d16c982 100644
+index 45d8875..29c9ee5 100644
 --- a/src/option.c
 +++ b/src/option.c
-@@ -1642,7 +1642,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+@@ -1669,7 +1669,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
        ret_err(_("bad MX target"));
        break;
  
diff --git a/src/patches/glibc/glibc-rh1008310.patch b/src/patches/glibc/glibc-rh1008310.patch
new file mode 100644 (file)
index 0000000..3658a9f
--- /dev/null
@@ -0,0 +1,45 @@
+diff -Nrup a/malloc/malloc.c b/malloc/malloc.c
+--- a/malloc/malloc.c  2013-09-23 17:08:33.698331221 -0400
++++ b/malloc/malloc.c  2013-09-23 21:04:25.901270645 -0400
+@@ -3879,6 +3879,13 @@ public_mEMALIGn(size_t alignment, size_t
+   /* Otherwise, ensure that it is at least a minimum chunk size */
+   if (alignment <  MINSIZE) alignment = MINSIZE;
++  /* Check for overflow.  */
++  if (bytes > SIZE_MAX - alignment - MINSIZE)
++    {
++      __set_errno (ENOMEM);
++      return 0;
++    }
++
+   arena_get(ar_ptr, bytes + alignment + MINSIZE);
+   if(!ar_ptr)
+     return 0;
+@@ -3924,6 +3931,13 @@ public_vALLOc(size_t bytes)
+   size_t pagesz = mp_.pagesize;
++  /* Check for overflow.  */
++  if (bytes > SIZE_MAX - pagesz - MINSIZE)
++    {
++      __set_errno (ENOMEM);
++      return 0;
++    }
++
+   __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t,
+                                       __const __malloc_ptr_t)) =
+     force_reg (__memalign_hook);
+@@ -3975,6 +3989,13 @@ public_pVALLOc(size_t bytes)
+   size_t page_mask = mp_.pagesize - 1;
+   size_t rounded_bytes = (bytes + page_mask) & ~(page_mask);
++  /* Check for overflow.  */
++  if (bytes > SIZE_MAX - 2*pagesz - MINSIZE)
++    {
++      __set_errno (ENOMEM);
++      return 0;
++    }
++
+   __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t,
+                                       __const __malloc_ptr_t)) =
+     force_reg (__memalign_hook);
diff --git a/src/patches/glibc/glibc-rh1022022.patch b/src/patches/glibc/glibc-rh1022022.patch
new file mode 100644 (file)
index 0000000..6d23bb1
--- /dev/null
@@ -0,0 +1,20 @@
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index 81e928a..05883bd 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -832,8 +832,13 @@ gaih_inet (const char *name, const struct gaih_service *service,
+         while (!no_more)
+           {
+             no_data = 0;
+-            nss_gethostbyname4_r fct4
+-              = __nss_lookup_function (nip, "gethostbyname4_r");
++            nss_gethostbyname4_r fct4 = NULL;
++
++            /* gethostbyname4_r sends out parallel A and AAAA queries and
++               is thus only suitable for PF_UNSPEC.  */
++            if (req->ai_family == PF_UNSPEC)
++              fct4 = __nss_lookup_function (nip, "gethostbyname4_r");
++
+             if (fct4 != NULL)
+               {
+                 int herrno;
diff --git a/src/patches/glibc/glibc-rh1091162.patch b/src/patches/glibc/glibc-rh1091162.patch
new file mode 100644 (file)
index 0000000..7825682
--- /dev/null
@@ -0,0 +1,58 @@
+commit 362b47fe09ca9a928d444c7e2f7992f7f61bfc3e
+Author: Maxim Kuvyrkov <maxim@kugelworks.com>
+Date:   Tue Dec 24 09:44:50 2013 +1300
+
+    Fix race in free() of fastbin chunk: BZ #15073
+    
+    Perform sanity check only if we have_lock.  Due to lockless nature of fastbins
+    we need to be careful derefencing pointers to fastbin entries (chunksize(old)
+    in this case) in multithreaded environments.
+    
+    The fix is to add have_lock to the if-condition checks.  The rest of the patch
+    only makes code more readable.
+    
+       * malloc/malloc.c (_int_free): Perform sanity check only if we
+       have_lock.
+
+diff --git a/malloc/malloc.c b/malloc/malloc.c
+index b1668b5..5e419ad 100644
+--- a/malloc/malloc.c
++++ b/malloc/malloc.c
+@@ -3783,25 +3783,29 @@ _int_free(mstate av, mchunkptr p, int have_lock)
+     fb = &fastbin (av, idx);
+ #ifdef ATOMIC_FASTBINS
+-    mchunkptr fd;
+-    mchunkptr old = *fb;
++    /* Atomically link P to its fastbin: P->FD = *FB; *FB = P;  */
++    mchunkptr old = *fb, old2;
+     unsigned int old_idx = ~0u;
+     do
+       {
+-      /* Another simple check: make sure the top of the bin is not the
+-         record we are going to add (i.e., double free).  */
++      /* Check that the top of the bin is not the record we are going to add
++         (i.e., double free).  */
+       if (__builtin_expect (old == p, 0))
+         {
+           errstr = "double free or corruption (fasttop)";
+           goto errout;
+         }
+-      if (old != NULL)
++      /* Check that size of fastbin chunk at the top is the same as
++         size of the chunk that we are adding.  We can dereference OLD
++         only if we have the lock, otherwise it might have already been
++         deallocated.  See use of OLD_IDX below for the actual check.  */
++      if (have_lock && old != NULL)
+         old_idx = fastbin_index(chunksize(old));
+-      p->fd = fd = old;
++      p->fd = old2 = old;
+       }
+-    while ((old = catomic_compare_and_exchange_val_rel (fb, p, fd)) != fd);
++    while ((old = catomic_compare_and_exchange_val_rel (fb, p, old2)) != old2);
+-    if (fd != NULL && __builtin_expect (old_idx != idx, 0))
++    if (have_lock && old != NULL && __builtin_expect (old_idx != idx, 0))
+       {
+       errstr = "invalid fastbin entry (free)";
+       goto errout;
diff --git a/src/patches/glibc/glibc-rh1098050.patch b/src/patches/glibc/glibc-rh1098050.patch
new file mode 100644 (file)
index 0000000..e5ff3ca
--- /dev/null
@@ -0,0 +1,28 @@
+commit cf26a0cb6a0bbaca46a01ddad6662e5e5159a32a
+Author: Siddhesh Poyarekar <siddhesh@redhat.com>
+Date:   Thu May 15 12:33:11 2014 +0530
+
+    Return EAI_AGAIN for AF_UNSPEC when herrno is TRY_AGAIN (BZ #16849)
+    
+    getaddrinfo correctly returns EAI_AGAIN for AF_INET and AF_INET6
+    queries.  For AF_UNSPEC however, an older change
+    (a682a1bf553b1efe4dbb03207fece5b719cec482) broke the check and due to
+    that the returned error was EAI_NONAME.
+    
+    This patch fixes the check so that a non-authoritative not-found is
+    returned as EAI_AGAIN to the user instead of EAI_NONAME.
+
+diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
+index 6258330..8f392b9 100644
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -867,8 +867,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
+                     if (status != NSS_STATUS_TRYAGAIN
+                         || rc != ERANGE || herrno != NETDB_INTERNAL)
+                       {
+-                        if (status == NSS_STATUS_TRYAGAIN
+-                            && herrno == TRY_AGAIN)
++                        if (herrno == TRY_AGAIN)
+                           no_data = EAI_AGAIN;
+                         else
+                           no_data = herrno == NO_DATA;
diff --git a/src/patches/glibc/glibc-rh1133809-1.patch b/src/patches/glibc/glibc-rh1133809-1.patch
new file mode 100644 (file)
index 0000000..12b9949
--- /dev/null
@@ -0,0 +1,199 @@
+2014-08-21  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #17187]
+       * iconv/gconv_trans.c (struct known_trans, search_tree, lock,
+       trans_compare, open_translit, __gconv_translit_find):
+       Remove module loading code.
+
+diff --git a/iconv/gconv_trans.c b/iconv/gconv_trans.c
+index 1e25854..d71c029 100644
+--- a/iconv/gconv_trans.c
++++ b/iconv/gconv_trans.c
+@@ -238,181 +238,11 @@ __gconv_transliterate (struct __gconv_step *step,
+   return __GCONV_ILLEGAL_INPUT;
+ }
+-
+-/* Structure to represent results of found (or not) transliteration
+-   modules.  */
+-struct known_trans
+-{
+-  /* This structure must remain the first member.  */
+-  struct trans_struct info;
+-
+-  char *fname;
+-  void *handle;
+-  int open_count;
+-};
+-
+-
+-/* Tree with results of previous calls to __gconv_translit_find.  */
+-static void *search_tree;
+-
+-/* We modify global data.   */
+-__libc_lock_define_initialized (static, lock);
+-
+-
+-/* Compare two transliteration entries.  */
+-static int
+-trans_compare (const void *p1, const void *p2)
+-{
+-  const struct known_trans *s1 = (const struct known_trans *) p1;
+-  const struct known_trans *s2 = (const struct known_trans *) p2;
+-
+-  return strcmp (s1->info.name, s2->info.name);
+-}
+-
+-
+-/* Open (maybe reopen) the module named in the struct.  Get the function
+-   and data structure pointers we need.  */
+-static int
+-open_translit (struct known_trans *trans)
+-{
+-  __gconv_trans_query_fct queryfct;
+-
+-  trans->handle = __libc_dlopen (trans->fname);
+-  if (trans->handle == NULL)
+-    /* Not available.  */
+-    return 1;
+-
+-  /* Find the required symbol.  */
+-  queryfct = __libc_dlsym (trans->handle, "gconv_trans_context");
+-  if (queryfct == NULL)
+-    {
+-      /* We cannot live with that.  */
+-    close_and_out:
+-      __libc_dlclose (trans->handle);
+-      trans->handle = NULL;
+-      return 1;
+-    }
+-
+-  /* Get the context.  */
+-  if (queryfct (trans->info.name, &trans->info.csnames, &trans->info.ncsnames)
+-      != 0)
+-    goto close_and_out;
+-
+-  /* Of course we also have to have the actual function.  */
+-  trans->info.trans_fct = __libc_dlsym (trans->handle, "gconv_trans");
+-  if (trans->info.trans_fct == NULL)
+-    goto close_and_out;
+-
+-  /* Now the optional functions.  */
+-  trans->info.trans_init_fct =
+-    __libc_dlsym (trans->handle, "gconv_trans_init");
+-  trans->info.trans_context_fct =
+-    __libc_dlsym (trans->handle, "gconv_trans_context");
+-  trans->info.trans_end_fct =
+-    __libc_dlsym (trans->handle, "gconv_trans_end");
+-
+-  trans->open_count = 1;
+-
+-  return 0;
+-}
+-
+-
+ int
+ internal_function
+ __gconv_translit_find (struct trans_struct *trans)
+ {
+-  struct known_trans **found;
+-  const struct path_elem *runp;
+-  int res = 1;
+-
+-  /* We have to have a name.  */
+-  assert (trans->name != NULL);
+-
+-  /* Acquire the lock.  */
+-  __libc_lock_lock (lock);
+-
+-  /* See whether we know this module already.  */
+-  found = __tfind (trans, &search_tree, trans_compare);
+-  if (found != NULL)
+-    {
+-      /* Is this module available?  */
+-      if ((*found)->handle != NULL)
+-      {
+-        /* Maybe we have to reopen the file.  */
+-        if ((*found)->handle != (void *) -1)
+-          /* The object is not unloaded.  */
+-          res = 0;
+-        else if (open_translit (*found) == 0)
+-          {
+-            /* Copy the data.  */
+-            *trans = (*found)->info;
+-            (*found)->open_count++;
+-            res = 0;
+-          }
+-      }
+-    }
+-  else
+-    {
+-      size_t name_len = strlen (trans->name) + 1;
+-      int need_so = 0;
+-      struct known_trans *newp;
+-
+-      /* We have to continue looking for the module.  */
+-      if (__gconv_path_elem == NULL)
+-      __gconv_get_path ();
+-
+-      /* See whether we have to append .so.  */
+-      if (name_len <= 4 || memcmp (&trans->name[name_len - 4], ".so", 3) != 0)
+-      need_so = 1;
+-
+-      /* Create a new entry.  */
+-      newp = (struct known_trans *) malloc (sizeof (struct known_trans)
+-                                          + (__gconv_max_path_elem_len
+-                                             + name_len + 3)
+-                                          + name_len);
+-      if (newp != NULL)
+-      {
+-        char *cp;
+-
+-        /* Clear the struct.  */
+-        memset (newp, '\0', sizeof (struct known_trans));
+-
+-        /* Store a copy of the module name.  */
+-        newp->info.name = cp = (char *) (newp + 1);
+-        cp = __mempcpy (cp, trans->name, name_len);
+-
+-        newp->fname = cp;
+-
+-        /* Search in all the directories.  */
+-        for (runp = __gconv_path_elem; runp->name != NULL; ++runp)
+-          {
+-            cp = __mempcpy (__stpcpy ((char *) newp->fname, runp->name),
+-                            trans->name, name_len);
+-            if (need_so)
+-              memcpy (cp, ".so", sizeof (".so"));
+-
+-            if (open_translit (newp) == 0)
+-              {
+-                /* We found a module.  */
+-                res = 0;
+-                break;
+-              }
+-          }
+-
+-        if (res)
+-          newp->fname = NULL;
+-
+-        /* In any case we'll add the entry to our search tree.  */
+-        if (__tsearch (newp, &search_tree, trans_compare) == NULL)
+-          {
+-            /* Yickes, this should not happen.  Unload the object.  */
+-            res = 1;
+-            /* XXX unload here.  */
+-          }
+-      }
+-    }
+-
+-  __libc_lock_unlock (lock);
+-
+-  return res;
++  /* This function always fails.  Transliteration module loading is
++     not implemented.  */
++  return 1;
+ }
+-- 
+1.9.3
+
diff --git a/src/patches/glibc/glibc-rh1133809-2.patch b/src/patches/glibc/glibc-rh1133809-2.patch
new file mode 100644 (file)
index 0000000..8148abb
--- /dev/null
@@ -0,0 +1,625 @@
+commit 585367266923156ac6fb789939a923641ba5aaf4
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Wed May 28 14:05:03 2014 +0200
+
+    manual: Update the locale documentation
+
+commit 4e8f95a0df7c2300b830ec12c0ae1e161bc8a8a3
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Mon May 12 15:24:12 2014 +0200
+
+    _nl_find_locale: Improve handling of crafted locale names [BZ #17137]
+    
+    Prevent directory traversal in locale-related environment variables
+    (CVE-2014-0475).
+
+commit d183645616b0533b3acee28f1a95570bffbdf50f
+Author: Florian Weimer <fweimer@redhat.com>
+Date:   Wed May 28 14:41:52 2014 +0200
+
+    setlocale: Use the heap for the copy of the locale argument
+    
+    This avoids alloca calls with potentially large arguments.
+
+diff -pruN glibc-2.18/locale/findlocale.c glibc-2.18.patched/locale/findlocale.c
+--- glibc-2.18/locale/findlocale.c     2013-08-11 04:22:55.000000000 +0530
++++ glibc-2.18.patched/locale/findlocale.c     2014-08-26 16:14:50.403253778 +0530
+@@ -17,6 +17,7 @@
+    02111-1307 USA.  */
+ #include <assert.h>
++#include <errno.h>
+ #include <locale.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -57,6 +58,45 @@ struct loaded_l10nfile *_nl_locale_file_
+ const char _nl_default_locale_path[] attribute_hidden = LOCALEDIR;
++/* Checks if the name is actually present, that is, not NULL and not
++   empty.  */
++static inline int
++name_present (const char *name)
++{
++  return name != NULL && name[0] != '\0';
++}
++
++/* Checks that the locale name neither extremely long, nor contains a
++   ".." path component (to prevent directory traversal).  */
++static inline int
++valid_locale_name (const char *name)
++{
++  /* Not set.  */
++  size_t namelen = strlen (name);
++  /* Name too long.  The limit is arbitrary and prevents stack overflow
++     issues later.  */
++  if (__builtin_expect (namelen > 255, 0))
++    return 0;
++  /* Directory traversal attempt.  */
++  static const char slashdot[4] = {'/', '.', '.', '/'};
++  if (__builtin_expect (memmem (name, namelen,
++                              slashdot, sizeof (slashdot)) != NULL, 0))
++    return 0;
++  if (namelen == 2 && __builtin_expect (name[0] == '.' && name [1] == '.', 0))
++    return 0;
++  if (namelen >= 3
++      && __builtin_expect (((name[0] == '.'
++                           && name[1] == '.'
++                           && name[2] == '/')
++                          || (name[namelen - 3] == '/'
++                              && name[namelen - 2] == '.'
++                              && name[namelen - 1] == '.')), 0))
++    return 0;
++  /* If there is a slash in the name, it must start with one.  */
++  if (__builtin_expect (memchr (name, '/', namelen) != NULL, 0) && name[0] != '/')
++    return 0;
++  return 1;
++}
+ struct __locale_data *
+ internal_function
+@@ -65,7 +105,7 @@ _nl_find_locale (const char *locale_path
+ {
+   int mask;
+   /* Name of the locale for this category.  */
+-  char *loc_name;
++  char *loc_name = (char *) *name;
+   const char *language;
+   const char *modifier;
+   const char *territory;
+@@ -73,31 +113,39 @@ _nl_find_locale (const char *locale_path
+   const char *normalized_codeset;
+   struct loaded_l10nfile *locale_file;
+-  if ((*name)[0] == '\0')
++  if (loc_name[0] == '\0')
+     {
+       /* The user decides which locale to use by setting environment
+        variables.  */
+-      *name = getenv ("LC_ALL");
+-      if (*name == NULL || (*name)[0] == '\0')
+-      *name = getenv (_nl_category_names.str
++      loc_name = getenv ("LC_ALL");
++      if (!name_present (loc_name))
++      loc_name = getenv (_nl_category_names.str
+                       + _nl_category_name_idxs[category]);
+-      if (*name == NULL || (*name)[0] == '\0')
+-      *name = getenv ("LANG");
++      if (!name_present (loc_name))
++      loc_name = getenv ("LANG");
++      if (!name_present (loc_name))
++      loc_name = (char *) _nl_C_name;
+     }
+-  if (*name == NULL || (*name)[0] == '\0'
+-      || (__builtin_expect (__libc_enable_secure, 0)
+-        && strchr (*name, '/') != NULL))
+-    *name = (char *) _nl_C_name;
++  /* We used to fall back to the C locale if the name contains a slash
++     character '/', but we now check for directory traversal in
++     valid_locale_name, so this is no longer necessary.  */
+-  if (__builtin_expect (strcmp (*name, _nl_C_name), 1) == 0
+-      || __builtin_expect (strcmp (*name, _nl_POSIX_name), 1) == 0)
++  if (__builtin_expect (strcmp (loc_name, _nl_C_name), 1) == 0
++      || __builtin_expect (strcmp (loc_name, _nl_POSIX_name), 1) == 0)
+     {
+       /* We need not load anything.  The needed data is contained in
+        the library itself.  */
+       *name = (char *) _nl_C_name;
+       return _nl_C[category];
+     }
++  else if (!valid_locale_name (loc_name))
++    {
++      __set_errno (EINVAL);
++      return NULL;
++    }
++
++  *name = loc_name;
+   /* We really have to load some data.  First we try the archive,
+      but only if there was no LOCPATH environment variable specified.  */
+diff -pruN glibc-2.18/locale/setlocale.c glibc-2.18.patched/locale/setlocale.c
+--- glibc-2.18/locale/setlocale.c      2013-08-11 04:22:55.000000000 +0530
++++ glibc-2.18.patched/locale/setlocale.c      2014-08-26 16:14:50.401253764 +0530
+@@ -272,6 +272,8 @@ setlocale (int category, const char *loc
+        of entries of the form `CATEGORY=VALUE'.  */
+       const char *newnames[__LC_LAST];
+       struct __locale_data *newdata[__LC_LAST];
++      /* Copy of the locale argument, for in-place splitting.  */
++      char *locale_copy = NULL;
+       /* Set all name pointers to the argument name.  */
+       for (category = 0; category < __LC_LAST; ++category)
+@@ -281,7 +283,13 @@ setlocale (int category, const char *loc
+       if (__builtin_expect (strchr (locale, ';') != NULL, 0))
+       {
+         /* This is a composite name.  Make a copy and split it up.  */
+-        char *np = strdupa (locale);
++        locale_copy = strdup (locale);
++        if (__builtin_expect (locale_copy == NULL, 0))
++          {
++            __libc_rwlock_unlock (__libc_setlocale_lock);
++            return NULL;
++          }
++        char *np = locale_copy;
+         char *cp;
+         int cnt;
+@@ -299,6 +307,7 @@ setlocale (int category, const char *loc
+               {
+               error_return:
+                 __libc_rwlock_unlock (__libc_setlocale_lock);
++                free (locale_copy);
+                 /* Bogus category name.  */
+                 ERROR_RETURN;
+@@ -391,8 +400,9 @@ setlocale (int category, const char *loc
+       /* Critical section left.  */
+       __libc_rwlock_unlock (__libc_setlocale_lock);
+-      /* Free the resources (the locale path variable).  */
++      /* Free the resources.  */
+       free (locale_path);
++      free (locale_copy);
+       return composite;
+     }
+diff -pruN glibc-2.18/localedata/Makefile glibc-2.18.patched/localedata/Makefile
+--- glibc-2.18/localedata/Makefile     2014-08-26 16:15:22.656474571 +0530
++++ glibc-2.18.patched/localedata/Makefile     2014-08-26 16:14:50.403253778 +0530
+@@ -77,7 +77,7 @@ locale_test_suite := tst_iswalnum tst_is
+ tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
+       tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
+-      tst-strfmon1 tst-sscanf tst-strptime
++      tst-strfmon1 tst-sscanf tst-strptime tst-setlocale3
+ ifeq (yes,$(build-shared))
+ ifneq (no,$(PERL))
+ tests: $(objpfx)mtrace-tst-leaks
+@@ -288,6 +288,7 @@ tst-strfmon1-ENV = $(TEST_MBWC_ENV)
+ tst-strptime-ENV = $(TEST_MBWC_ENV)
+ tst-setlocale-ENV = LOCPATH=$(common-objpfx)localedata LC_ALL=ja_JP.EUC-JP
++tst-setlocale3-ENV = LOCPATH=$(common-objpfx)localedata
+ bug-iconv-trans-ENV = LOCPATH=$(common-objpfx)localedata
+diff -pruN glibc-2.18/localedata/tst-setlocale3.c glibc-2.18.patched/localedata/tst-setlocale3.c
+--- glibc-2.18/localedata/tst-setlocale3.c     1970-01-01 05:30:00.000000000 +0530
++++ glibc-2.18.patched/localedata/tst-setlocale3.c     2014-08-26 16:14:50.403253778 +0530
+@@ -0,0 +1,203 @@
++/* Regression test for setlocale invalid environment variable handling.
++   Copyright (C) 2014 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
++
++#include <locale.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++/* The result of setlocale may be overwritten by subsequent calls, so
++   this wrapper makes a copy.  */
++static char *
++setlocale_copy (int category, const char *locale)
++{
++  const char *result = setlocale (category, locale);
++  if (result == NULL)
++    return NULL;
++  return strdup (result);
++}
++
++static char *de_locale;
++
++static void
++setlocale_fail (const char *envstring)
++{
++  setenv ("LC_CTYPE", envstring, 1);
++  if (setlocale (LC_CTYPE, "") != NULL)
++    {
++      printf ("unexpected setlocale success for \"%s\" locale\n", envstring);
++      exit (1);
++    }
++  const char *newloc = setlocale (LC_CTYPE, NULL);
++  if (strcmp (newloc, de_locale) != 0)
++    {
++      printf ("failed setlocale call \"%s\" changed locale to \"%s\"\n",
++            envstring, newloc);
++      exit (1);
++    }
++}
++
++static void
++setlocale_success (const char *envstring)
++{
++  setenv ("LC_CTYPE", envstring, 1);
++  char *newloc = setlocale_copy (LC_CTYPE, "");
++  if (newloc == NULL)
++    {
++      printf ("setlocale for \"%s\": %m\n", envstring);
++      exit (1);
++    }
++  if (strcmp (newloc, de_locale) == 0)
++    {
++      printf ("setlocale with LC_CTYPE=\"%s\" left locale at \"%s\"\n",
++            envstring, de_locale);
++      exit (1);
++    }
++  if (setlocale (LC_CTYPE, de_locale) == NULL)
++    {
++      printf ("restoring locale \"%s\" with LC_CTYPE=\"%s\": %m\n",
++            de_locale, envstring);
++      exit (1);
++    }
++  char *newloc2 = setlocale_copy (LC_CTYPE, newloc);
++  if (newloc2 == NULL)
++    {
++      printf ("restoring locale \"%s\" following \"%s\": %m\n",
++            newloc, envstring);
++      exit (1);
++    }
++  if (strcmp (newloc, newloc2) != 0)
++    {
++      printf ("representation of locale \"%s\" changed from \"%s\" to \"%s\"",
++            envstring, newloc, newloc2);
++      exit (1);
++    }
++  free (newloc);
++  free (newloc2);
++
++  if (setlocale (LC_CTYPE, de_locale) == NULL)
++    {
++      printf ("restoring locale \"%s\" with LC_CTYPE=\"%s\": %m\n",
++            de_locale, envstring);
++      exit (1);
++    }
++}
++
++/* Checks that a known-good locale still works if LC_ALL contains a
++   value which should be ignored.  */
++static void
++setlocale_ignore (const char *to_ignore)
++{
++  const char *fr_locale = "fr_FR.UTF-8";
++  setenv ("LC_CTYPE", fr_locale, 1);
++  char *expected_locale = setlocale_copy (LC_CTYPE, "");
++  if (expected_locale == NULL)
++    {
++      printf ("setlocale with LC_CTYPE=\"%s\" failed: %m\n", fr_locale);
++      exit (1);
++    }
++  if (setlocale (LC_CTYPE, de_locale) == NULL)
++    {
++      printf ("failed to restore locale: %m\n");
++      exit (1);
++    }
++  unsetenv ("LC_CTYPE");
++
++  setenv ("LC_ALL", to_ignore, 1);
++  setenv ("LC_CTYPE", fr_locale, 1);
++  const char *actual_locale = setlocale (LC_CTYPE, "");
++  if (actual_locale == NULL)
++    {
++      printf ("setlocale with LC_ALL, LC_CTYPE=\"%s\" failed: %m\n",
++            fr_locale);
++      exit (1);
++    }
++  if (strcmp (actual_locale, expected_locale) != 0)
++    {
++      printf ("setlocale under LC_ALL failed: got \"%s\", expected \"%s\"\n",
++            actual_locale, expected_locale);
++      exit (1);
++    }
++  unsetenv ("LC_CTYPE");
++  setlocale_success (fr_locale);
++  unsetenv ("LC_ALL");
++  free (expected_locale);
++}
++
++static int
++do_test (void)
++{
++  /* The glibc test harness sets this environment variable
++     uncondionally.  */
++  unsetenv ("LC_ALL");
++
++  de_locale = setlocale_copy (LC_CTYPE, "de_DE.UTF-8");
++  if (de_locale == NULL)
++    {
++      printf ("setlocale (LC_CTYPE, \"de_DE.UTF-8\"): %m\n");
++      return 1;
++    }
++  setlocale_success ("C");
++  setlocale_success ("en_US.UTF-8");
++  setlocale_success ("/en_US.UTF-8");
++  setlocale_success ("//en_US.UTF-8");
++  setlocale_ignore ("");
++
++  setlocale_fail ("does-not-exist");
++  setlocale_fail ("/");
++  setlocale_fail ("/../localedata/en_US.UTF-8");
++  setlocale_fail ("en_US.UTF-8/");
++  setlocale_fail ("en_US.UTF-8/..");
++  setlocale_fail ("en_US.UTF-8/../en_US.UTF-8");
++  setlocale_fail ("../localedata/en_US.UTF-8");
++  {
++    size_t large_length = 1024;
++    char *large_name = malloc (large_length + 1);
++    if (large_name == NULL)
++      {
++      puts ("malloc failure");
++      return 1;
++      }
++    memset (large_name, '/', large_length);
++    const char *suffix = "en_US.UTF-8";
++    strcpy (large_name + large_length - strlen (suffix), suffix);
++    setlocale_fail (large_name);
++    free (large_name);
++  }
++  {
++    size_t huge_length = 64 * 1024 * 1024;
++    char *huge_name = malloc (huge_length + 1);
++    if (huge_name == NULL)
++      {
++      puts ("malloc failure");
++      return 1;
++      }
++    memset (huge_name, 'X', huge_length);
++    huge_name[huge_length] = '\0';
++    /* Construct a composite locale specification. */
++    const char *prefix = "LC_CTYPE=de_DE.UTF-8;LC_TIME=";
++    memcpy (huge_name, prefix, strlen (prefix));
++    setlocale_fail (huge_name);
++    free (huge_name);
++  }
++
++  return 0;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+diff -pruN glibc-2.18/manual/locale.texi glibc-2.18.patched/manual/locale.texi
+--- glibc-2.18/manual/locale.texi      2013-08-11 04:22:55.000000000 +0530
++++ glibc-2.18.patched/manual/locale.texi      2014-08-26 16:14:50.404253785 +0530
+@@ -29,6 +29,7 @@ will follow the conventions preferred by
+ * Setting the Locale::          How a program specifies the locale
+                                  with library functions.
+ * Standard Locales::            Locale names available on all systems.
++* Locale Names::                Format of system-specific locale names.
+ * Locale Information::          How to access the information for the locale.
+ * Formatting Numbers::          A dedicated function to format numbers.
+ * Yes-or-No Questions::         Check a Response against the locale.
+@@ -99,14 +100,16 @@ locale named @samp{espana-castellano} to
+ most of Spain.
+ The set of locales supported depends on the operating system you are
+-using, and so do their names.  We can't make any promises about what
+-locales will exist, except for one standard locale called @samp{C} or
+-@samp{POSIX}.  Later we will describe how to construct locales.
+-@comment (@pxref{Building Locale Files}).
++using, and so do their names, except that the standard locale called
++@samp{C} or @samp{POSIX} always exist.  @xref{Locale Names}.
++
++In order to force the system to always use the default locale, the
++user can set the @code{LC_ALL} environment variable to @samp{C}.
+ @cindex combining locales
+-A user also has the option of specifying different locales for different
+-purposes---in effect, choosing a mixture of multiple locales.
++A user also has the option of specifying different locales for
++different purposes---in effect, choosing a mixture of multiple
++locales.  @xref{Locale Categories}.
+ For example, the user might specify the locale @samp{espana-castellano}
+ for most purposes, but specify the locale @samp{usa-english} for
+@@ -120,7 +123,7 @@ which locales apply.  However, the user
+ for a particular subset of those purposes.
+ @node Locale Categories, Setting the Locale, Choosing Locale, Locales
+-@section Categories of Activities that Locales Affect
++@section Locale Categories
+ @cindex categories for locales
+ @cindex locale categories
+@@ -128,7 +131,11 @@ The purposes that locales serve are grou
+ that a user or a program can choose the locale for each category
+ independently.  Here is a table of categories; each name is both an
+ environment variable that a user can set, and a macro name that you can
+-use as an argument to @code{setlocale}.
++use as the first argument to @code{setlocale}.
++
++The contents of the environment variable (or the string in the second
++argument to @code{setlocale}) has to be a valid locale name.
++@xref{Locale Names}.
+ @vtable @code
+ @comment locale.h
+@@ -172,7 +179,7 @@ for affirmative and negative responses.
+ @comment locale.h
+ @comment ISO
+ @item LC_ALL
+-This is not an environment variable; it is only a macro that you can use
++This is not a category; it is only a macro that you can use
+ with @code{setlocale} to set a single locale for all purposes.  Setting
+ this environment variable overwrites all selections by the other
+ @code{LC_*} variables or @code{LANG}.
+@@ -225,13 +232,7 @@ The symbols in this section are defined
+ @comment ISO
+ @deftypefun {char *} setlocale (int @var{category}, const char *@var{locale})
+ The function @code{setlocale} sets the current locale for category
+-@var{category} to @var{locale}.  A list of all the locales the system
+-provides can be created by running
+-
+-@pindex locale
+-@smallexample
+-  locale -a
+-@end smallexample
++@var{category} to @var{locale}.
+ If @var{category} is @code{LC_ALL}, this specifies the locale for all
+ purposes.  The other possible values of @var{category} specify an
+@@ -256,10 +257,9 @@ is passed in as @var{locale} parameter.
+ When you read the current locale for category @code{LC_ALL}, the value
+ encodes the entire combination of selected locales for all categories.
+-In this case, the value is not just a single locale name.  In fact, we
+-don't make any promises about what it looks like.  But if you specify
+-the same ``locale name'' with @code{LC_ALL} in a subsequent call to
+-@code{setlocale}, it restores the same combination of locale selections.
++If you specify the same ``locale name'' with @code{LC_ALL} in a
++subsequent call to @code{setlocale}, it restores the same combination
++of locale selections.
+ To be sure you can use the returned string encoding the currently selected
+ locale at a later time, you must make a copy of the string.  It is not
+@@ -275,6 +275,11 @@ for @var{category}.
+ If a nonempty string is given for @var{locale}, then the locale of that
+ name is used if possible.
++The effective locale name (either the second argument to
++@code{setlocale}, or if the argument is an empty string, the name
++obtained from the process environment) must be valid locale name.
++@xref{Locale Names}.
++
+ If you specify an invalid locale name, @code{setlocale} returns a null
+ pointer and leaves the current locale unchanged.
+ @end deftypefun
+@@ -328,7 +323,7 @@ locale categories, and future versions o
+ portability, assume that any symbol beginning with @samp{LC_} might be
+ defined in @file{locale.h}.
+-@node Standard Locales, Locale Information, Setting the Locale, Locales
++@node Standard Locales, Locale Names, Setting the Locale, Locales
+ @section Standard Locales
+ The only locale names you can count on finding on all operating systems
+@@ -362,7 +357,94 @@ with the environment, rather than trying
+ locale explicitly by name.  Remember, different machines might have
+ different sets of locales installed.
+-@node Locale Information, Formatting Numbers, Standard Locales, Locales
++@node Locale Names, Locale Information, Standard Locales, Locales
++@section Locale Names
++
++The following command prints a list of locales supported by the
++system:
++
++@pindex locale
++@smallexample
++  locale -a
++@end smallexample
++
++@strong{Portability Note:} With the notable exception of the standard
++locale names @samp{C} and @samp{POSIX}, locale names are
++system-specific.
++
++Most locale names follow XPG syntax and consist of up to four parts:
++
++@smallexample
++@var{language}[_@var{territory}[.@var{codeset}]][@@@var{modifier}]
++@end smallexample
++
++Beside the first part, all of them are allowed to be missing.  If the
++full specified locale is not found, less specific ones are looked for.
++The various parts will be stripped off, in the following order:
++
++@enumerate
++@item
++codeset
++@item
++normalized codeset
++@item
++territory
++@item
++modifier
++@end enumerate
++
++For example, the locale name @samp{de_AT.iso885915@@euro} denotes a
++German-language locale for use in Austria, using the ISO-8859-15
++(Latin-9) character set, and with the Euro as the currency symbol.
++
++In addition to locale names which follow XPG syntax, systems may
++provide aliases such as @samp{german}.  Both categories of names must
++not contain the slash character @samp{/}.
++
++If the locale name starts with a slash @samp{/}, it is treated as a
++path relative to the configured locale directories; see @code{LOCPATH}
++below.  The specified path must not contain a component @samp{..}, or
++the name is invalid, and @code{setlocale} will fail.
++
++@strong{Portability Note:} POSIX suggests that if a locale name starts
++with a slash @samp{/}, it is resolved as an absolute path.  However,
++the GNU C Library treats it as a relative path under the directories listed
++in @code{LOCPATH} (or the default locale directory if @code{LOCPATH}
++is unset).
++
++Locale names which are longer than an implementation-defined limit are
++invalid and cause @code{setlocale} to fail.
++
++As a special case, locale names used with @code{LC_ALL} can combine
++several locales, reflecting different locale settings for different
++categories.  For example, you might want to use a U.S. locale with ISO
++A4 paper format, so you set @code{LANG} to @samp{en_US.UTF-8}, and
++@code{LC_PAPER} to @samp{de_DE.UTF-8}.  In this case, the
++@code{LC_ALL}-style combined locale name is
++
++@smallexample
++LC_CTYPE=en_US.UTF-8;LC_TIME=en_US.UTF-8;LC_PAPER=de_DE.UTF-8;@dots{}
++@end smallexample
++
++followed by other category settings not shown here.
++
++@vindex LOCPATH
++The path used for finding locale data can be set using the
++@code{LOCPATH} environment variable.  This variable lists the
++directories in which to search for locale definitions, separated by a
++colon @samp{:}.
++
++The default path for finding locale data is system specific.  A typical
++value for the @code{LOCPATH} default is:
++
++@smallexample
++/usr/share/locale
++@end smallexample
++
++The value of @code{LOCPATH} is ignored by privileged programs for
++security reasons, and only the default directory is used.
++
++@node Locale Information, Formatting Numbers, Locale Names, Locales
+ @section Accessing Locale Information
+ There are several ways to access locale information.  The simplest