Hello community,

here is the log from the commit of package yast2-samba-client for 
openSUSE:Factory checked in at 2017-06-17 10:17:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-samba-client (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-samba-client.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-samba-client"

Sat Jun 17 10:17:58 2017 rev:92 rq:503233 version:3.1.19

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-samba-client/yast2-samba-client.changes    
2016-10-18 13:26:18.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-samba-client.new/yast2-samba-client.changes   
    2017-06-17 10:18:00.121962624 +0200
@@ -1,0 +2,7 @@
+Fri May 26 09:37:23 UTC 2017 - [email protected]
+
+- Enable yast to create temporary smb.conf based on existing
+  contents of /etc/samba/smb.conf; (bsc#1039764).
+- 3.1.19
+
+-------------------------------------------------------------------

Old:
----
  yast2-samba-client-3.1.18.tar.bz2

New:
----
  yast2-samba-client-3.1.19.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-samba-client.spec ++++++
--- /var/tmp/diff_new_pack.iuarPM/_old  2017-06-17 10:18:01.469772500 +0200
+++ /var/tmp/diff_new_pack.iuarPM/_new  2017-06-17 10:18:01.473771935 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-samba-client
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-samba-client
-Version:        3.1.18
+Version:        3.1.19
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-samba-client-3.1.18.tar.bz2 -> yast2-samba-client-3.1.19.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-3.1.18/.travis.yml 
new/yast2-samba-client-3.1.19/.travis.yml
--- old/yast2-samba-client-3.1.18/.travis.yml   2016-10-13 16:40:55.366299855 
+0200
+++ new/yast2-samba-client-3.1.19/.travis.yml   2017-06-12 18:56:01.270130359 
+0200
@@ -1,16 +1,11 @@
-language: cpp
-compiler:
-    - gcc
+sudo: required
+language: bash
+services:
+  - docker
+
 before_install:
-    # disable rvm, use system Ruby
-    - rvm reset
-    - wget 
https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh
-    - sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite 
yast2-perl-bindings yast2 yast2-pam" -g "yast-rake gettext"
+  - docker build -t yast-samba-client-image .
 script:
-    - rake check:syntax
-    - rake check:pot
-    - make -f Makefile.cvs
-    - make
-    - sudo make install
-    - make check
-
+  # the "yast-travis-ruby" script is included in the base yastdevel/ruby image
+  # see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby
+  - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" 
yast-samba-client-image yast-travis-ruby
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-3.1.18/Dockerfile 
new/yast2-samba-client-3.1.19/Dockerfile
--- old/yast2-samba-client-3.1.18/Dockerfile    1970-01-01 01:00:00.000000000 
+0100
+++ new/yast2-samba-client-3.1.19/Dockerfile    2017-06-12 18:56:01.270130359 
+0200
@@ -0,0 +1,3 @@
+FROM yastdevel/ruby
+COPY . /usr/src/app
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-samba-client-3.1.18/package/yast2-samba-client.changes 
new/yast2-samba-client-3.1.19/package/yast2-samba-client.changes
--- old/yast2-samba-client-3.1.18/package/yast2-samba-client.changes    
2016-10-13 16:40:55.402299855 +0200
+++ new/yast2-samba-client-3.1.19/package/yast2-samba-client.changes    
2017-06-12 18:56:01.270130359 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri May 26 09:37:23 UTC 2017 - [email protected]
+
+- Enable yast to create temporary smb.conf based on existing
+  contents of /etc/samba/smb.conf; (bsc#1039764).
+- 3.1.19
+
+-------------------------------------------------------------------
 Tue Oct 11 13:23:28 UTC 2016 - [email protected]
 
 - Adjust vertical spacing in Server Directories Frame; (bsc#988901).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-samba-client-3.1.18/package/yast2-samba-client.spec 
new/yast2-samba-client-3.1.19/package/yast2-samba-client.spec
--- old/yast2-samba-client-3.1.18/package/yast2-samba-client.spec       
2016-10-13 16:40:55.402299855 +0200
+++ new/yast2-samba-client-3.1.19/package/yast2-samba-client.spec       
2017-06-12 18:56:01.270130359 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-samba-client
-Version:        3.1.18
+Version:        3.1.19
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-samba-client-3.1.18/src/modules/SambaConfig.pm 
new/yast2-samba-client-3.1.19/src/modules/SambaConfig.pm
--- old/yast2-samba-client-3.1.18/src/modules/SambaConfig.pm    2016-10-13 
16:40:55.438299855 +0200
+++ new/yast2-samba-client-3.1.19/src/modules/SambaConfig.pm    2017-06-12 
18:56:01.270130359 +0200
@@ -1145,6 +1145,36 @@
     return $modified;
 }
 
+# return global config values from smb.conf (and any overrides passed in)
+BEGIN{ $TYPEINFO{GetGlobalCfgStr} = ["function", "string", "any"]; }
+sub GetGlobalCfgStr {
+    my ($self, $overrides_ref) = @_;
+    my $content = "[global]\n";
+    my %overrides = ();
+    # allow global values to be overridden with contents of hash passed in
+    if ($overrides_ref && ref $overrides_ref eq "HASH") {
+        %overrides = %$overrides_ref;
+        # only write out key/value if the value is defined
+        # this allows us to override and remove key/values by passing in
+        # undef for the the key
+        foreach my $key (sort keys %overrides) {
+            my $newval = $overrides{$key};
+            if (defined $newval) {
+                $content .= "\t$key = $newval\n";
+            }
+        }
+    }
+    foreach my $key (sort keys %{$Config{global}}) {
+        next if $key =~ /^_/;
+        my $val = $self->ShareGetStr("global", $key, undef);
+        # only write out keys that we haven't overridden
+        if (!exists $overrides{$key} && defined $val) {
+            $content .= "\t$key = $val\n";
+        }
+    }
+    return $content;
+}
+
 # set share for /etc/security/pam_winbind.conf.
 BEGIN{ $TYPEINFO{WinbindShareSetMap} = ["function", "boolean", "string", 
["map", "string", "string"]]; }
 sub WinbindShareSetMap {
@@ -1169,5 +1199,4 @@
 BEGIN{ $TYPEINFO{WinbindGlobalSetMap} = ["function", "boolean", ["map", 
"string", "string"]]; }
 sub WinbindGlobalSetMap { return WinbindShareSetMap(shift, "global", @_); }
 
-
 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-samba-client-3.1.18/src/modules/SambaNetJoin.pm 
new/yast2-samba-client-3.1.19/src/modules/SambaNetJoin.pm
--- old/yast2-samba-client-3.1.18/src/modules/SambaNetJoin.pm   2016-10-13 
16:40:55.442299855 +0200
+++ new/yast2-samba-client-3.1.19/src/modules/SambaNetJoin.pm   2017-06-12 
18:56:01.270130359 +0200
@@ -230,32 +230,35 @@
     my $protocol       = SambaAD->ADS () ne "" ? "ads" : "rpc";
     my $netbios_name   = SambaConfig->GlobalGetStr("netbios name", undef);
     my $conf_file      = SCR->Read (".target.tmpdir")."/smb.conf";
-    my $include                = "";
-    $include   = "\n\tinclude = /etc/samba/dhcp.conf" if (SCR->Read 
(".sysconfig.network.dhcp.DHCLIENT_MODIFY_SMB_CONF") eq "yes");
+    my $realm  = SambaAD->Realm ();
+    my $content;
+    my %glb_overrides;
+
+    $glb_overrides{"include"} = "/etc/samba/dhcp.conf" if (SCR->Read 
(".sysconfig.network.dhcp.DHCLIENT_MODIFY_SMB_CONF") eq "yes");
 
     if ($protocol eq "ads") {
-       my $realm       = SambaAD->Realm ();
-       my $content     = "[global]$include\n\trealm = $realm\n\tsecurity = 
ADS\n\tworkgroup = $domain\n";
+       $glb_overrides{"realm"} = $realm;
+       $glb_overrides{"workgroup"} = $domain;
+       $glb_overrides{"security"} = "ads";
+
         if ($self->ClusterPresent (0)) {
             # ensure cluster related options are used from original file
             # bnc#809208
             my $clustering      = SambaConfig->GlobalGetStr ("clustering", 
undef);
-            if (defined $clustering) {
-              my $ctdbd_socket    = SambaConfig->GlobalGetStr ("ctdbd socket", 
"");
-              $content .= "\t" . "clustering = $clustering" . "\n";
-              $content .= "\t" . "ctdbd socket =$ctdbd_socket" . "\n";
-            }
-            else {
+            if (!defined $clustering) {
               y2warning ("'clustering' not defined in smb.conf");
               return FALSE;
             }
         }
-       SCR->Write (".target.string", $conf_file, $content);
     }
     else {
-       SCR->Write (".target.string", $conf_file, "[global]$include\n\tsecurity 
= domain\n\tworkgroup = $domain\n");
-    }
+       $glb_overrides{"realm"} = undef;
+       $glb_overrides{"workgroup"} = $domain;
+       $glb_overrides{"security"} = "domain";
 
+    }
+    $content = SambaConfig->GetGlobalCfgStr(\%glb_overrides);
+    SCR->Write (".target.string", $conf_file, $content);
     # FIXME -P is probably wrong, but suppresses password prompt
     my $cmd = "LANG=C net $protocol testjoin -s $conf_file -P";
     if ($protocol ne "ads") {
@@ -291,9 +294,11 @@
     my $conf_file      = $tmpdir."/smb.conf";
     my $cmd            = "";
 
-    my $include                = "";
+    my $realm  = SambaAD->Realm ();
+    my $content;
+    my %glb_overrides;
     # bnc#520648 (DHCP may know WINS server address)
-    $include   = "\n\tinclude = /etc/samba/dhcp.conf" if (SCR->Read 
(".sysconfig.network.dhcp.DHCLIENT_MODIFY_SMB_CONF") eq "yes");
+    $glb_overrides{"include"} = "/etc/samba/dhcp.conf" if (SCR->Read 
(".sysconfig.network.dhcp.DHCLIENT_MODIFY_SMB_CONF") eq "yes");
 
     AdaptDNS ();
 
@@ -302,34 +307,33 @@
        $self->PrepareCTDB ($server);
 
        my $krb_file    = $tmpdir."/krb5.conf";
-       my $realm       = SambaAD->Realm ();
-       my $content     = "[global]$include\n\trealm = $realm\n\tsecurity = 
ADS\n\tworkgroup = $domain\n";
+       $glb_overrides{"realm"} = $realm;
+       $glb_overrides{"workgroup"} = $domain;
+       $glb_overrides{"security"} = "ads";
        my $kerberos_method     = SambaConfig->GlobalGetStr ("kerberos method", 
"");
        if ($kerberos_method) {
-           $content    = $content."\tkerberos method = $kerberos_method\n";
+            $glb_overrides{"kerberos method"} = $kerberos_method;
        }
         if ($self->ClusterPresent (0)) {
             # ensure cluster related options are used from original file
             # bnc#809208
             my $clustering      = SambaConfig->GlobalGetStr ("clustering", 
undef);
-            if (defined $clustering) {
-              my $ctdbd_socket    = SambaConfig->GlobalGetStr ("ctdbd socket", 
"");
-              $content .= "\t" . "clustering = $clustering" . "\n";
-              $content .= "\t" . "ctdbd socket =$ctdbd_socket" . "\n";
-            }
-            else {
+            if (!defined $clustering) {
               y2error ("'clustering' not defined in smb.conf, canceling join 
attempt");
               return __("Unable to proceed with join: Inconsistent cluster 
state");
             }
         }
-       SCR->Write (".target.string", $conf_file, $content);
        $cmd            = "KRB5_CONFIG=$krb_file ";
        SCR->Write (".target.string", $krb_file, "[realms]\n\t$realm = {\n\tkdc 
= $server\n\t}\n");
     }
     else {
-       SCR->Write (".target.string", $conf_file, "[global]$include\n\tsecurity 
= domain\n\tworkgroup = $domain\n");
+       $glb_overrides{"realm"} = undef;
+       $glb_overrides{"workgroup"} = $domain;
+       $glb_overrides{"security"} = "domain";
     }
 
+    $content = SambaConfig->GetGlobalCfgStr(\%glb_overrides);
+    SCR->Write (".target.string", $conf_file, $content);
     $cmd = $cmd."net $protocol join "
        . ($protocol ne "ads" ? lc($join_level||"") : "")
        . ($protocol ne "ads" ? " -w '$domain'" : "")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-samba-client-3.1.18/testsuite/tests/SambaConfig_GetGlobalCfgStr.out 
new/yast2-samba-client-3.1.19/testsuite/tests/SambaConfig_GetGlobalCfgStr.out
--- 
old/yast2-samba-client-3.1.18/testsuite/tests/SambaConfig_GetGlobalCfgStr.out   
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/yast2-samba-client-3.1.19/testsuite/tests/SambaConfig_GetGlobalCfgStr.out   
    2017-06-12 18:56:01.274130359 +0200
@@ -0,0 +1,15 @@
+Dump   $["global":$["a":1, "b":true, "c":"string"], 
"share":$["sharekey":"sharevalue"]]
+Dump   [global]
+Dump           a = 1
+Dump           b = 1
+Dump           c = string
+Dump   
+Dump   [global]
+Dump           a = 2
+Dump           b = 1
+Dump           c = string
+Dump   
+Dump   [global]
+Dump           b = 1
+Dump           c = string
+Dump   
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-samba-client-3.1.18/testsuite/tests/SambaConfig_GetGlobalCfgStr.rb 
new/yast2-samba-client-3.1.19/testsuite/tests/SambaConfig_GetGlobalCfgStr.rb
--- 
old/yast2-samba-client-3.1.18/testsuite/tests/SambaConfig_GetGlobalCfgStr.rb    
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/yast2-samba-client-3.1.19/testsuite/tests/SambaConfig_GetGlobalCfgStr.rb    
    2017-06-12 18:56:01.274130359 +0200
@@ -0,0 +1,36 @@
+# encoding: utf-8
+
+# test SambaConfig_Global::GetGlobalCfgStr:
+module Yast
+  class Samba_GlobalClient < Client
+    def main
+      Yast.import "Testsuite"
+      Yast.import "SambaConfig"
+
+      @i = {
+        "global"         => {
+          "a"   => 1,
+          "b" => true,
+          "c"=> "string",
+        },
+        "share" => { "sharekey" => "sharevalue" },
+      }
+
+      Testsuite.Dump(@i)
+
+      SambaConfig.Import(@i)
+      # test output of normal globals read in
+      Testsuite.Dump(SambaConfig.GetGlobalCfgStr())
+      j = { "a"   => "2" }
+      # test override of a param
+      Testsuite.Dump(SambaConfig.GetGlobalCfgStr(j))
+      # test override (removal) of a param
+      j["a"] = nil
+      Testsuite.Dump(SambaConfig.GetGlobalCfgStr(j))
+
+      nil
+    end
+  end
+end
+
+Yast::Samba_GlobalClient.new.main


Reply via email to