http://sourceforge.net/tracker/?func=detail&atid=117457&aid=3239411&group_id=17457
authorJamie Cameron <jcameron@webmin.com>
Thu, 24 Mar 2011 04:20:25 +0000 (21:20 -0700)
committerJamie Cameron <jcameron@webmin.com>
Thu, 24 Mar 2011 04:20:25 +0000 (21:20 -0700)
When adding a new directive, don't put it inside a Match block

sshd/sshd-lib.pl

index 818ba33..fcbd50f 100755 (executable)
@@ -128,8 +128,11 @@ for($i=0; $i<@o || $i<@n; $i++) {
                        }
                }
        elsif ($n[$i] && !$before) {
-               # Adding a line at the end
+               # Adding a line at the end, but before the last Match directive
                local $ll = $_[1]->[@{$_[1]}-1]->{'line'};
+               foreach my $m (&find("Match", $_[1])) {
+                       $ll = $m->{'line'} - 1;
+                       }
                splice(@$lref, $ll+1, 0, "$id$_[0] $n[$i]");
                }
        elsif ($n[$i] && $before) {