Author: jsuchome
Date: Wed Jan 5 16:15:19 2011
New Revision: 63096
URL: http://svn.opensuse.org/viewcvs/yast?rev=63096&view=rev
Log:
- import all config file sections, not only [global]
- do not let dollar sign be part of autoYaST XML (bnc#662250)
- 2.20.2
Modified:
trunk/samba-client/VERSION
trunk/samba-client/package/yast2-samba-client.changes
trunk/samba-client/src/Samba.ycp
trunk/samba-client/src/SambaConfig.pm
trunk/samba-client/src/samba-client.rnc
Modified: trunk/samba-client/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/VERSION?rev=63096&r1=63095&r2=63096&view=diff
==============================================================================
--- trunk/samba-client/VERSION (original)
+++ trunk/samba-client/VERSION Wed Jan 5 16:15:19 2011
@@ -1 +1 @@
-2.20.1
+2.20.2
Modified: trunk/samba-client/package/yast2-samba-client.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/package/yast2-samba-client.changes?rev=63096&r1=63095&r2=63096&view=diff
==============================================================================
--- trunk/samba-client/package/yast2-samba-client.changes (original)
+++ trunk/samba-client/package/yast2-samba-client.changes Wed Jan 5 16:15:19 2011
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Wed Jan 5 15:59:27 CET 2011 - jsuchome@suse.cz
+
+- import all config file sections, not only [global]
+- do not let dollar sign be part of autoYaST XML (bnc#662250)
+- 2.20.2
+
+-------------------------------------------------------------------
Mon Jan 3 14:32:15 CET 2011 - jsuchome@suse.cz
- updated schema file to include all known options (bnc#660979)
Modified: trunk/samba-client/src/Samba.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/src/Samba.ycp?rev=63096&r1=63095&r2=63096&view=diff
==============================================================================
--- trunk/samba-client/src/Samba.ycp (original)
+++ trunk/samba-client/src/Samba.ycp Wed Jan 5 16:15:19 2011
@@ -886,49 +886,67 @@
*/
global boolean Import (map settings) {
- if (haskey(settings, "global")) {
- map globals = settings["global"]:$[];
- SambaConfig::GlobalSetStr("workgroup",globals["workgroup"]:"WORKGROUP");
-
- if (tolower (globals["winbind_offline_logon"]:"") == "yes" &&
- tolower (globals["cached_login"]:"") == "yes")
- SetWinbindCaching (true);
+ globals_configured = false;
+ map globals = settings["global"]:$[];
+ list<map> sections = [];
+
+ foreach (string key, any value, (map) settings, {
+
+ // handle special keys separately
+ if (key == "shares_group")
+ {
+ shares_group = settings["shares_group"]:shares_group;
+ }
+ else if (key == "active_directory")
+ {
+ SambaAD::SetADS (settings["active_directory","kdc"]:"");
+ }
+ else if (key == "join")
+ {
+ password_data = settings["join"]:$[];
+ }
+ else if (key == "mkhomedir")
+ {
+ SetMkHomeDir (settings["mkhomedir"]:mkhomedir);
+ }
+ else if (key == "disable_dhcp_hostname")
+ {
+ disable_dhcp_hostname = settings["disable_dhcp_hostname"]:disable_dhcp_hostname;
+ }
+ else if (key != "winbind" && is (value, map))
+ {
+ // form a section to import SambaConfig
+ sections = add (sections, $[
+ "name" : key,
+ "parameters" : value
+ ]);
+ }
+ });
- if (haskey (globals, "usershare_max_shares") ||
- haskey (settings, "shares_group"))
- SetShares (tointeger (globals["usershare_max_shares"]:"0"),
- settings["shares_group"]:shares_group);
-
- if (tolower (globals["usershare_allow_guests"]:"") == "yes")
- SetGuessAccess (true);
-
- globals_configured = true;
- modified = true;
- } else {
- globals_configured = false;
- }
- if (haskey (settings, "shares_group"))
- shares_group = settings["shares_group"]:shares_group;
-
- if (haskey(settings, "active_directory"))
- {
- SambaAD::SetADS (settings["active_directory","kdc"]:"");
- }
// call this _after_ evaluation if AD is used
boolean winbind = settings["winbind"]:settings["global","winbind"]:false;
if (winbind != nil)
{
SetWinbind (winbind);
}
- if (haskey(settings, "join"))
+
+ if (sections != [])
{
- password_data = settings["join"]:$[];
+ SambaConfig::Import (sections);
}
- if (haskey (settings, "mkhomedir"))
+
+ // explicitely adapt some variables based on 'globals' section
+ if (globals != $[])
{
- SetMkHomeDir (settings["mkhomedir"]:mkhomedir);
+ if (haskey (globals, "usershare_max_shares") ||
+ haskey (settings, "shares_group"))
+ {
+ SetShares (tointeger (globals["usershare_max_shares"]:"0"),
+ settings["shares_group"]:shares_group);
+ }
+ globals_configured = true;
}
- disable_dhcp_hostname = settings["disable_dhcp_hostname"]:disable_dhcp_hostname;
+ modified = true;
return true;
}
Modified: trunk/samba-client/src/SambaConfig.pm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/src/SambaConfig.pm?rev=63096&r1=63095&r2=63096&view=diff
==============================================================================
--- trunk/samba-client/src/SambaConfig.pm (original)
+++ trunk/samba-client/src/SambaConfig.pm Wed Jan 5 16:15:19 2011
@@ -466,7 +466,9 @@
next unless $Config{$share}; # skip removed shares
next if $share =~ /^_/; # skip internal shares
my %section;
- $section{name} = $share;
+ my $name = $share;
+ $name =~ s/\$/_dollarsign_/; # $ cannot be in autoYaST XML (bnc#662250)
+ $section{name} = $name;
$section{comment} = $Config{$share}{_comment} if $Config{$share}{_comment};
$section{disabled} = Boolean(1) if $Config{$share}{_disabled};
while(my ($key, $val) = each %{$Config{$share}}) {
@@ -497,6 +499,7 @@
if ($config && ref $config eq "ARRAY") { # normal import
foreach my $section (@$config) {
my $name = $section->{name};
+ $name =~ s/_dollarsign_/\$/; # see Import
next unless $name;
$self->ShareSetComment($name, $section->{comment}) if $section->{comment};
$self->ShareDisable($name) if $section->{disabled};
Modified: trunk/samba-client/src/samba-client.rnc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/src/samba-client.rnc?rev=63096&r1=63095&r2=63096&view=diff
==============================================================================
--- trunk/samba-client/src/samba-client.rnc (original)
+++ trunk/samba-client/src/samba-client.rnc Wed Jan 5 16:15:19 2011
@@ -41,7 +41,7 @@
element read_only { text }? &
element valid_users { text }?
}? &
- element print$ {
+ element print_dollarsign_ {
element comment { text }? &
element create_mask { text }? &
element directory_mask { text }? &
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org