r51245 - in /branches/upstream/libconfig-model-openssh-perl/current: ./ lib/Config/Model/ lib/Config/Model/models/ lib/Config/Model/models/Ssh/ t/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Mon Jan 18 21:46:05 UTC 2010


Author: jawnsy-guest
Date: Mon Jan 18 21:45:56 2010
New Revision: 51245

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=51245
Log:
[svn-upgrade] Integrating new upstream version, libconfig-model-openssh-perl (1.209)

Removed:
    branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh/HostBlock.pl
Modified:
    branches/upstream/libconfig-model-openssh-perl/current/ChangeLog
    branches/upstream/libconfig-model-openssh-perl/current/MANIFEST
    branches/upstream/libconfig-model-openssh-perl/current/META.yml
    branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/OpenSsh.pm
    branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh.pl
    branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh/HostElement.pl
    branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Sshd.pl
    branches/upstream/libconfig-model-openssh-perl/current/t/ssh_config.t

Modified: branches/upstream/libconfig-model-openssh-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-openssh-perl/current/ChangeLog?rev=51245&op=diff
==============================================================================
--- branches/upstream/libconfig-model-openssh-perl/current/ChangeLog (original)
+++ branches/upstream/libconfig-model-openssh-perl/current/ChangeLog Mon Jan 18 21:45:56 2010
@@ -1,3 +1,25 @@
+2010-01-18  Dominique Dumont  <dominique.dumont at hp.com> v1.209
+
+	* lib/Config/Model/models/Sshd.pl: Added automatic migration of
+	data from deprecated KeepAlive parameter to TCPKeepAlive
+	parameter. This enables an automatic migration from old sshd
+	config to new syntax.
+
+	* lib/Config/Model/models/Ssh/HostElement.pl: Since ssh_config doc
+	mentions that LocalForward and RemoteForward can be specified
+	several times, these 2 parameters are changed from leaf to a list
+	of leaf.
+
+	* lib/Config/Model/models/Ssh.pl: As specifying Host block as list
+	of patterns and content was not practical, the Host element in Ssh
+	model was changed from list of HostBlock nodes to hash of
+	HostElement. The Host patterns is used as the key of the
+	hash. This enables a better view of shh configuration in the GUI.
+
+	* lib/Config/Model/OpenSsh.pm (assign): Store value in uniline
+	leaf even with embedded white spaces.
+	(write_all_host_block): adapted to Host structure change in model
+
 2009-09-10  Dominique Dumont  <dominique.dumont at hp.com> v1.208
 
 	* lib/Config/Model/models/**.pl: Changed 'level' of some elements

Modified: branches/upstream/libconfig-model-openssh-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-openssh-perl/current/MANIFEST?rev=51245&op=diff
==============================================================================
--- branches/upstream/libconfig-model-openssh-perl/current/MANIFEST (original)
+++ branches/upstream/libconfig-model-openssh-perl/current/MANIFEST Mon Jan 18 21:45:56 2010
@@ -3,7 +3,6 @@
 config-edit-ssh
 config-edit-sshd
 lib/Config/Model/models/Ssh.pl
-lib/Config/Model/models/Ssh/HostBlock.pl
 lib/Config/Model/models/Ssh/HostElement.pl
 lib/Config/Model/models/Sshd.pl
 lib/Config/Model/models/Sshd/MatchBlock.pl

Modified: branches/upstream/libconfig-model-openssh-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-openssh-perl/current/META.yml?rev=51245&op=diff
==============================================================================
--- branches/upstream/libconfig-model-openssh-perl/current/META.yml (original)
+++ branches/upstream/libconfig-model-openssh-perl/current/META.yml Mon Jan 18 21:45:56 2010
@@ -1,28 +1,28 @@
 ---
+abstract: 'OpenSsh configuration files graphical editor'
+author:
+  - 'Dominique Dumont (ddumont at cpan dot org)'
+configure_requires:
+  Module::Build: 0.36
+generated_by: 'Module::Build version 0.3601'
+license: lgpl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
 name: Config-Model-OpenSsh
-version: 1.208
-author:
-  - Dominique Dumont (ddumont at cpan dot org)
-abstract: OpenSsh configuration files graphical editor
-license: lgpl
-resources:
-  license: http://opensource.org/licenses/lgpl-license.php
+provides:
+  Config::Model::OpenSsh:
+    file: lib/Config/Model/OpenSsh.pm
+    version: 1.209
+recommends:
+  Config::Model::Backend::Augeas: 0
+  Config::Model::CursesUI: 0
+  Config::Model::TkUI: 0
 requires:
   Config::Model: 0.637
   Log::Log4perl: 0
   Parse::RecDescent: 0
   perl: v5.8.0
-recommends:
-  Config::Model::Backend::Augeas: 0
-  Config::Model::CursesUI: 0
-  Config::Model::TkUI: 0
-configure_requires:
-  Module::Build: 0.35
-provides:
-  Config::Model::OpenSsh:
-    file: lib/Config/Model/OpenSsh.pm
-    version: 1.208
-generated_by: Module::Build version 0.35
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
+resources:
+  license: http://opensource.org/licenses/lgpl-license.php
+version: 1.209

Modified: branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/OpenSsh.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/OpenSsh.pm?rev=51245&op=diff
==============================================================================
--- branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/OpenSsh.pm (original)
+++ branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/OpenSsh.pm Mon Jan 18 21:45:56 2010
@@ -18,7 +18,7 @@
 use Parse::RecDescent ;
 use vars qw($VERSION $grammar $parser)  ;
 
-$VERSION = '1.208' ;
+$VERSION = '1.209' ;
 
 
 my $logger = Log::Log4perl::get_logger(__PACKAGE__);
@@ -227,7 +227,7 @@
     my $type = $elt->get_type;
     #print "got $key type $type and ",join('+', at arg),"\n";
     if    ($type eq 'leaf') { 
-	$elt->store( $arg[0] ) ;
+	$elt->store( join(' ', at arg) ) ;
     }
     elsif ($type eq 'list') { 
 	$elt->push ( @arg ) ;
@@ -275,18 +275,11 @@
   sub host {
     my ($root, at patterns)  = @_;
 
-    my $list_obj = $root->fetch_element('Host');
+    my $hash_obj = $root->fetch_element('Host');
 
     $logger->info("ssh: load host patterns '".join("','", @patterns)."'");
 
-    # create new host block
-    my $nb_of_elt = $list_obj->fetch_size;
-    my $block_obj = $list_obj->fetch_with_id($nb_of_elt) ;
-    my $pattern_obj = $block_obj->fetch_element('patterns') ;
-
-    map { $pattern_obj->push($_) ; } @patterns;
-
-    $current_node = $block_obj->fetch_element('block');
+    $current_node = $hash_obj->fetch_with_id("@patterns");
   }
 
   sub clear {
@@ -477,34 +470,20 @@
     my $mode = shift || '';
 
     my $result = '' ;
-    foreach my $elt ($host_elt->fetch_all($mode) ) {
-	$result .= write_host_block($elt,$mode) ;
-    }
-
+
+    foreach my $pattern ( $host_elt->get_all_indexes) {
+	my $block_elt = $host_elt->fetch_with_id($pattern) ;
+	my $block_data = write_node_content($block_elt,'custom') ;
+
+	# write data only if custom pattern or custom data is found this
+	# is necessary to avoid writing data from /etc/ssh/ssh_config that
+	# were entered as 'preset' data
+	if ($block_data) {
+	    $result .= "Host $pattern\n$block_data\n" ;
+	}
+    }
     return $result ;
 }
-
-sub write_host_block {
-    my $host_elt = shift ;
-    my $result = "\nHost " ;
-
-    my $pattern_elt = $host_elt->fetch_element('patterns') ;
-    my @custom_pattern = $pattern_elt -> fetch_all_values('custom') ;
-
-    my $block_elt = $host_elt->fetch_element('block') ;
-    my $block_data = write_node_content($block_elt,'custom') ;
-
-    # write data only if custom pattern or custom data is found this
-    # is necessary to avoid writing data from /etc/ssh/ssh_config that
-    # were entered as 'preset' data
-    if (@custom_pattern or $block_data) {
-	$result .= ' '.join(' ',$pattern_elt->fetch_all_values('custom'));
-	$result .= "\n$block_data\n" ;
-	return $result ;
-    }
-
-    return '';
-}
 1;
 
 =head1 AUTHOR
@@ -513,7 +492,7 @@
 
 =head1 LICENSE
 
-   Copyright (c) 2008-2009 Dominique Dumont.
+   Copyright (c) 2008-2010 Dominique Dumont.
 
    This file is part of Config-Model-OpenSsh.
 

Modified: branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh.pl?rev=51245&op=diff
==============================================================================
--- branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh.pl (original)
+++ branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh.pl Mon Jan 18 21:45:56 2010
@@ -36,10 +36,12 @@
                              'level' => 'important',
                              'cargo' => {
                                           'type' => 'node',
-                                          'config_class_name' => 'Ssh::HostBlock'
+                                          'config_class_name' => 'Ssh::HostElement'
                                         },
-                             'type' => 'list',
-                             'description' => "The declarations make in 'parameters' are applied only to the hosts that match one of the patterns given in pattern elements. A single \x{2018}*\x{2019} as a pattern can be used to provide global defaults for all hosts. The host is the hostname argument given on the command line (i.e. the name is not converted to a canonicalized host name before matching)."
+                             'ordered' => '1',
+                             'type' => 'hash',
+                             'description' => "The declarations make in 'parameters' are applied only to the hosts that match one of the patterns given in pattern elements. A single \x{2018}*\x{2019} as a pattern can be used to provide global defaults for all hosts. The host is the hostname argument given on the command line (i.e. the name is not converted to a canonicalized host name before matching). Since the first obtained value for each parameter is used, more host-specific declarations should be given near the beginning of the hash (which takes order into account), and general defaults at the end.",
+                             'index_type' => 'string'
                            }
                          ]
           }

Modified: branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh/HostElement.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh/HostElement.pl?rev=51245&op=diff
==============================================================================
--- branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh/HostElement.pl (original)
+++ branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Ssh/HostElement.pl Mon Jan 18 21:45:56 2010
@@ -359,10 +359,24 @@
                            },
                            'LocalForward',
                            {
-                             'value_type' => 'uniline',
-                             'experience' => 'advanced',
-                             'type' => 'leaf',
-                             'description' => 'Specifies that a TCP port on the local machine be forwarded over the secure channel to the specified host and port from the remote machine. The first argument must be [bind_address:]port and the second argument must be host:hostport. IPv6 addresses can be specified by enclosing addresses in square brackets or by using an alternative syntax: [bind_address/]port and host/hostport. Multiple forwardings may be specified, and additional forwardings can be given on the command line. Only the superuser can forward privileged ports. By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of "localhost" indicates that the listening port be bound for local use only, while an empty address or \'*\' indicates that the port should be available from all interfaces.'
+                             'cargo' => {
+                                          'value_type' => 'uniline',
+                                          'type' => 'leaf'
+                                        },
+                             'summary' => 'Local port forwarding',
+                             'experience' => 'advanced',
+                             'type' => 'list',
+                             'description' => 'Specifies that a TCP port on the local machine be forwarded over the secure channel to the specified host and port from the remote machine. The first argument must be [bind_address:]port and the second argument must be host:hostport. 
+
+IPv6 addresses can be specified by enclosing addresses in square brackets or by using an alternative syntax: [bind_address/]port and host/hostport. 
+
+Multiple forwardings may be specified, and additional forwardings can be given on the command line. Only the superuser can forward privileged ports. 
+
+By default, the local port is bound in accordance with the GatewayPorts setting. However, an explicit bind_address may be used to bind the connection to a specific address. The bind_address of "localhost" indicates that the listening port be bound for local use only, while an empty address or \'*\' indicates that the port should be available from all interfaces.
+
+Example:
+   LocalForward 20000 192.168.0.66:80
+'
                            },
                            'LogLevel',
                            {
@@ -515,10 +529,14 @@
                            },
                            'RemoteForward',
                            {
-                             'value_type' => 'uniline',
                              'level' => 'important',
-                             'experience' => 'advanced',
-                             'type' => 'leaf',
+                             'cargo' => {
+                                          'value_type' => 'uniline',
+                                          'type' => 'leaf'
+                                        },
+                             'summary' => 'remote port forward to local',
+                             'experience' => 'advanced',
+                             'type' => 'list',
                              'description' => 'Specifies that a TCP port on the remote machine be forwarded over the secure channel to the specified host and port from the local machine.  The first argument must be [bind_address:]port and the second argument must be host:hostport.  IPv6 addresses can be specified by enclosing addresses in square brackets or by using an alternative syntax: [bind_address/]port and host/hostport. Multiple forwardings may be specified, and additional forwardings can be given on the command line.  Only the superuser can forward privileged ports.
 
 If the bind_address is not specified, the default is to only bind to loopback addresses.  If the bind_address is \'*\' or an empty string, then the forwarding is requested to listen on all inter faces.  Specifying a remote bind_address will only succeed if the server\'s GatewayPorts option is enabled (see sshd_config(5)).'

Modified: branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Sshd.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Sshd.pl?rev=51245&op=diff
==============================================================================
--- branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Sshd.pl (original)
+++ branches/upstream/libconfig-model-openssh-perl/current/lib/Config/Model/models/Sshd.pl Mon Jan 18 21:45:56 2010
@@ -713,6 +713,16 @@
                                            'LOCAL7'
                                          ]
                            },
+                           'KeepAlive',
+                           {
+                             'value_type' => 'enum',
+                             'status' => 'deprecated',
+                             'type' => 'leaf',
+                             'choice' => [
+                                           'no',
+                                           'yes'
+                                         ]
+                           },
                            'TCPKeepAlive',
                            {
                              'value_type' => 'enum',
@@ -721,6 +731,12 @@
                                          'no' => 'disable TCP keepalive messages'
                                        },
                              'upstream_default' => 'yes',
+                             'migrate_from' => {
+                                                 'formula' => '$keep_alive',
+                                                 'variables' => {
+                                                                  'keep_alive' => '- KeepAlive'
+                                                                }
+                                               },
                              'type' => 'leaf',
                              'description' => 'Specifies whether the system should send TCP keepalive messages to the other side. If they are sent, death of the connection or crash of one of the machines will be properly noticed. However, this means that connections will die if the route is down temporarily, and some people find it annoying.  On the other hand, if TCP keepalives are not sent, sessions may hang indefinitely on the server, leaving "ghost" users and consuming server resources. This option was formerly called KeepAlive.',
                              'choice' => [

Modified: branches/upstream/libconfig-model-openssh-perl/current/t/ssh_config.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libconfig-model-openssh-perl/current/t/ssh_config.t?rev=51245&op=diff
==============================================================================
--- branches/upstream/libconfig-model-openssh-perl/current/t/ssh_config.t (original)
+++ branches/upstream/libconfig-model-openssh-perl/current/t/ssh_config.t Mon Jan 18 21:45:56 2010
@@ -4,7 +4,7 @@
 # $Revision: 608 $
 
 use ExtUtils::testlib;
-use Test::More tests => 14;
+use Test::More tests => 12;
 use Config::Model ;
 use Config::Model::OpenSsh ; # required for tests
 use Log::Log4perl qw(:easy) ;
@@ -93,8 +93,7 @@
 my $dump =  $root_cfg->dump_tree ();
 print $dump if $trace ;
 
-like($dump,qr/Host:1/, "check Host section") ;
-like($dump,qr/patterns=foo\.\*,\*\.bar/,"check Host pattern") ;
+like($dump,qr/Host:foo\.\*,\*\.bar/, "check Host pattern") ;
 
 $root_inst->write_back() ;
 ok(1,"wrote ssh_config data in $wr_dir") ;
@@ -131,9 +130,8 @@
     $dump =  $user_cfg->dump_tree (mode => 'full' );
     print $dump if $trace ;
 
-    like($dump,qr/Host:1/, "check Host section") ;
-    like($dump,qr/patterns=foo\.\*,\*\.bar/,"check root Host pattern") ;
-    like($dump,qr/patterns=mine.bar/,"check user Host pattern") ;
+    like($dump,qr/Host:foo\.\*,\*\.bar/,"check root Host pattern") ;
+    like($dump,qr/Host:mine.bar/,"check user Host pattern") ;
 
     #require Tk::ObjScanner; Tk::ObjScanner::scan_object($user_cfg) ;
     $user_inst->write_back() ;




More information about the Pkg-perl-cvs-commits mailing list