Author: jsuchome Date: Fri Sep 5 16:32:29 2008 New Revision: 50764 URL: http://svn.opensuse.org/viewcvs/yast?rev=50764&view=rev Log: - fixed writing /etc/nsswitch.conf - ag_pam_mount: added path to reading specific file elements - preliminary support for reading pam_mount.conf.xml - 2.17.2 Modified: trunk/samba-client/VERSION trunk/samba-client/agent-pam_mount/ag_pam_mount trunk/samba-client/package/yast2-samba-client.changes trunk/samba-client/src/Samba.ycp trunk/samba-client/src/dialogs.ycp trunk/samba-client/yast2-samba-client.spec.in Modified: trunk/samba-client/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/VERSION?rev=50764&r1=50763&r2=50764&view=diff ============================================================================== --- trunk/samba-client/VERSION (original) +++ trunk/samba-client/VERSION Fri Sep 5 16:32:29 2008 @@ -1 +1 @@ -2.17.1 +2.17.2 Modified: trunk/samba-client/agent-pam_mount/ag_pam_mount URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/agent-pam_mount/ag_pam_mount?rev=50764&r1=50763&r2=50764&view=diff ============================================================================== --- trunk/samba-client/agent-pam_mount/ag_pam_mount (original) +++ trunk/samba-client/agent-pam_mount/ag_pam_mount Fri Sep 5 16:32:29 2008 @@ -24,16 +24,52 @@ if ($command eq "Read") { - # read given file, store its contents in global $pam_mount structure - my %retmap = (); - $pam_mount_file = $argument; - $pam_mount_file = "/etc/security/pam_mount.conf.xml" if ! $argument; + if ($path eq "." && $pam_mount) { + y2milestone ("pam_mount already parsed"); + ycp::Return ("true"); + } + elsif ($path eq "." || $path eq ".force") { + + # read given file, store its contents in global $pam_mount structure + my %retmap = (); + $pam_mount_file = $argument; + $pam_mount_file = "/etc/security/pam_mount.conf.xml" if ! $argument; + my $parser = new XML::LibXML; + $pam_mount = $parser->parse_file ($pam_mount_file); - my $parser = new XML::LibXML; - $pam_mount = $parser->parse_file ($pam_mount_file); + if ($pam_mount) { + ycp::Return ("true"); + } + else { + ycp::Return ("false"); + } + } + elsif ($path eq ".get") { - ycp::Return (\%retmap, 1); # TODO return anything? + if (!$argument->{"element"}) { + y2error ("element name not specified"); + ycp::Return (undef); + } + else { + my @retlist = (); + my $el_name = $argument->{"element"} || ""; + my $nodeList = $pam_mount->getElementsByTagName ($el_name); + for (my $i=1;$i<= $nodeList->size();$i++) { + my $element = $nodeList -> get_node ($i); + my $element_map = {}; + foreach my $attr ($element->attributes ()) { + my $nn = $attr->nodeName; + my $val = $attr->getValue (); + if ($nn && $val) { + $element_map->{$nn} = $val; + } + } + push @retlist, $element_map if ($element_map); + } + ycp::Return (\@retlist, 1); + } + } } elsif ($command eq "Write") { @@ -56,9 +92,9 @@ } # change the value of an atrribute for given element # SCR::Write (.pam_mount.modify_attr, $[ - # "tag" : "mntoptions", - # "attr" : "require", - # "value" : "nosuid" + # "element" : "mntoptions", + # "attr" : "require", + # "value" : "nosuid" # ]); elsif ($path eq ".modify_attr") { if (!defined $argument || ref ($argument) ne "HASH") { @@ -66,11 +102,11 @@ ycp::Return ("false"); } else { - my $tag_name = $argument->{"tag"} || ""; + my $el_name = $argument->{"element"} || ""; my $attr_name = $argument->{"attr"} || ""; my $value = $argument->{"value"} || ""; - my $nodeList = $pam_mount->getElementsByTagName ($tag_name); + my $nodeList = $pam_mount->getElementsByTagName ($el_name); for (my $i=1;$i<= $nodeList->size();$i++) { my $element = $nodeList -> get_node ($i); @@ -88,7 +124,7 @@ # create new element under root node # e.g. <volume user="user" fstype="civfs"/> would be added by # SCR::Write (.pam_mount.add, $[ - # "tag" : "volume", + # "element" : "volume", # "attrmap" : $[ # "user" : "hh", # "fstype" : "cifs" @@ -101,15 +137,15 @@ y2error ("argument not present or not a map"); ycp::Return ("false"); } - elsif (!$argument->{"tag"}) { - y2error ("tag name not specified"); + elsif (!$argument->{"element"}) { + y2error ("element name not specified"); ycp::Return ("false"); } else { - my $tag_name = $argument->{"tag"} || ""; + my $el_name = $argument->{"element"} || ""; my $attr_map = $argument->{"attrmap"}; - my $new_element = XML::LibXML::Element->new ($tag_name); + my $new_element = XML::LibXML::Element->new ($el_name); while (my ($name, $val) = each %$attr_map) { $new_element->setAttribute ($name, $val); } 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=50764&r1=50763&r2=50764&view=diff ============================================================================== --- trunk/samba-client/package/yast2-samba-client.changes (original) +++ trunk/samba-client/package/yast2-samba-client.changes Fri Sep 5 16:32:29 2008 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Fri Sep 5 16:18:30 CEST 2008 - jsuchome@suse.cz + +- fixed writing /etc/nsswitch.conf +- ag_pam_mount: added path to reading specific file elements +- preliminary support for reading pam_mount.conf.xml +- 2.17.2 + +------------------------------------------------------------------- Wed Aug 13 10:54:52 CEST 2008 - jsuchome@suse.cz - added option to use WINS for hosts resolution (fate#300971) Modified: trunk/samba-client/src/Samba.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/src/Samba.ycp?rev=50764&r1=50763&r2=50764&view=diff ============================================================================== --- trunk/samba-client/src/Samba.ycp (original) +++ trunk/samba-client/src/Samba.ycp Fri Sep 5 16:32:29 2008 @@ -118,6 +118,9 @@ // if hosts are resolved via WINS boolean hosts_resolution = nil; +// host line of nsswitch.conf +list<string> hosts_db = []; + boolean hosts_resolution_orig = false; // packages to install for specific arhitectures (#224418) @@ -171,6 +174,30 @@ }; /** + * Read the data from /etc/security/pam_mount.conf.xml regarding + * mounting user's home directories + */ +global define boolean ReadPamMount () { + + if (!FileUtils::Exists ("/etc/security/pam_mount.conf.xml")) + { + y2warning ("/etc/security/pam_mount.conf.xml does not exist"); + return false; + } + // initially, parse the whole file and let the agent build data map + if (SCR::Read (.pam_mount) != true) + { + y2warning ("reading /etc/security/pam_mount.conf.xml failed"); + return false; + } + + list volumes = (list) SCR::Read (.pam_mount.get, $[ + "element" : "volume", + ]); + return true; +} + +/** * Read the state of mkhomedir in /etc/pam.d/common-session (bug #143519) */ global define boolean ReadMkHomeDir () { @@ -219,8 +246,8 @@ if (hosts_resolution == nil) { - list hosts = Nsswitch::ReadDb ("hosts"); - hosts_resolution = contains (hosts, "wins"); + hosts_db = Nsswitch::ReadDb ("hosts"); + hosts_resolution = contains (hosts_db, "wins"); hosts_resolution_orig = hosts_resolution; } return hosts_resolution; @@ -242,7 +269,11 @@ if (hosts_resolution != hosts_resolution_orig) { - Nsswitch::WriteDb ("hosts", add (Nsswitch::ReadDb ("hosts"), "wins")); + if (hosts_resolution) + hosts_db = add (hosts_db, "wins"); + else + hosts_db = filter (string e, hosts_db, ``(e != "wins")); + Nsswitch::WriteDb ("hosts", hosts_db); boolean ret = Nsswitch::Write (); y2milestone ("/etc/nsswitch.conf written: %1", ret); return ret; @@ -602,6 +633,8 @@ SuSEFirewall::Read (); + ReadPamMount (); + // finished Progress::NextStage(); globals_configured = true; Modified: trunk/samba-client/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/src/dialogs.ycp?rev=50764&r1=50763&r2=50764&view=diff ============================================================================== --- trunk/samba-client/src/dialogs.ycp (original) +++ trunk/samba-client/src/dialogs.ycp Fri Sep 5 16:32:29 2008 @@ -54,37 +54,58 @@ boolean hosts_resolution = Samba::GetHostsResolution (); - UI::OpenDialog (`opt (`decorated), `HBox ( - `HWeight (2, `RichText (`id (`help), help_text)), - `HSpacing (), - `HWeight (3, `VBox ( - `VSpacing (0.5), - // frame label - `Frame (_("&UID Range"), `HBox ( + string mount_server = ""; + string mount_path = ""; + string mount_share = ""; + string unc_path = ""; + // \\\\nue-lurch-1\\Profiles\\storage1\\dom1\\"; + + term contents = `HBox (`HSpacing (3), `VBox ( + `VSpacing (0.4), + // frame label + `Frame (_("&UID Range"), `HBox ( // int field label `IntField (`id (`uid_min), _("&Minimum"), 0, 99999, uid_min), // int field label `IntField (`id (`uid_max), _("Ma&ximum"), 0, 99999, uid_max) - )), - `VSpacing (0.5), - // frame label - `Frame (_("&GID Range"), `HBox ( + )), + `VSpacing (0.5), + // frame label + `Frame (_("&GID Range"), `HBox ( // int field label `IntField (`id (`gid_min), _("M&inimum"), 0, 99999, gid_min), // int field label `IntField (`id (`gid_max), _("M&aximum"), 0, 99999, gid_max) - )), - `VSpacing (), + )), + `VSpacing (), + // frame label + `Frame (_("Windows Internet Name Service"), `VBox ( HostsResolutionTerm (hosts_resolution), - DHCPSupportTerm (dhcp_support), - `VSpacing (), - `HBox ( - `PushButton (`id(`ok), Label::OKButton()), - `PushButton (`id(`cancel), Label::CancelButton()) - ) + DHCPSupportTerm (dhcp_support) )), - `HSpacing () - )); + `VSpacing (0.4), + // frame label + `Frame (_("Mount Server Home Directory"), `VBox ( + /* + // text entry label + `InputField (`id (`mount_server),`opt (`hstretch),_("&Server Name"), + mount_server), + // text entry label + `InputField (`id (`mount_share), `opt (`hstretch), _("S&hare Name"), + mount_share), + // text entry label + `InputField (`id (`mount_path), `opt (`hstretch),_("&Path"), + mount_path) + */ + // text entry label + `InputField (`id (`mount), `opt (`hstretch), _("&UNC Path"), + unc_path) + )) + ), `HSpacing (3)); + + Wizard::OpenOKDialog (); + // dialog title + Wizard::SetContents (_("Expert Settings"), contents, help_text, true, true); any ret = `cancel; while (true) @@ -231,7 +252,8 @@ ]); term firewall_layout = firewall_widget["custom_widget"]:`VBox (); - Wizard::SetContentsButtons( caption, `HVSquash( `VBox( +// Wizard::SetContentsButtons( caption, `HVSquash( `VBox( + Wizard::SetContentsButtons (caption, `HBox (`HSpacing (3), `VBox ( // translators: frame label `Frame (_("Membership"), `VBox ( @@ -276,7 +298,7 @@ ]), autoyast_term, ntp_term - )), + ), `HSpacing (3)), (Stage::cont() ? HELPS["MembershipDialog_cont"]:"" : HELPS["MembershipDialog_nocont"]:"") + HELPS["MembershipDialog_common"]:"" + Modified: trunk/samba-client/yast2-samba-client.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/yast2-samba-client.spec.in?rev=50764&r1=50763&r2=50764&view=diff ============================================================================== --- trunk/samba-client/yast2-samba-client.spec.in (original) +++ trunk/samba-client/yast2-samba-client.spec.in Fri Sep 5 16:32:29 2008 @@ -36,5 +36,6 @@ @moduledir@/Samba.ybc @desktopdir@/samba-client.desktop @scrconfdir@/*.scr +@agentdir@/ag_pam_mount @schemadir@/autoyast/rnc/samba-client.rnc %doc @docdir@ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org