Hello community, here is the log from the commit of package yast2-nfs-server checked in at Mon Feb 26 19:03:01 CET 2007. -------- --- yast2-nfs-server/yast2-nfs-server.changes 2007-02-26 10:12:49.000000000 +0100 +++ /mounts/work_src_done/NOARCH/yast2-nfs-server/yast2-nfs-server.changes 2007-02-26 16:56:24.000000000 +0100 @@ -1,0 +2,28 @@ +Mon Feb 26 16:52:08 CET 2007 - pchakravarthi@novell.com + +- Fixed #242545: settings were not visible. +- Do not ignore changes when an item is deleted and readded (#243466). +- Do not continue with no directory entered (#243034). +- Fixed "Unable to start idmapd please check the domain settings" + (/etc/sysconfig/nfs was not flushed, #242565). +- 2.15.1 + +------------------------------------------------------------------- +Mon Feb 26 15:17:11 CET 2007 - pchakravarthi@novell.com + +- Added a perl module ag_idmapd_conf for configuring entries in + /etc/idmapd.conf +- Added two scr agents - etc_idmapd_conf.scr and cfg_nfs.scr, the + former making use of ag_idmapd_conf and the later to configure + entries in /etc/sysconfig/nfs +- Modified Makefile.am in agents directory to reflect above. +- Modified NfsServer.ycp, ui.ycp and routines.ycp to make use of + all above and adding ui pieces to make the module NFSv4 aware. +- Modified the *.out files in testsuite/tests/ to reflect changes + made above. +- modified .spec.in file to add 'Requires' for limal-nfs-server + package and to include names of additional agent files. +- Relevant FATE ID : #300609 +- merged all this from SLE10-SP1 (mvidner). + +------------------------------------------------------------------- Old: ---- yast2-nfs-server-2.15.0.tar.bz2 New: ---- yast2-nfs-server-2.15.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-nfs-server.spec ++++++ --- /var/tmp/diff_new_pack.I22530/_old 2007-02-26 19:02:56.000000000 +0100 +++ /var/tmp/diff_new_pack.I22530/_new 2007-02-26 19:02:56.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package yast2-nfs-server (Version 2.15.0) +# spec file for package yast2-nfs-server (Version 2.15.1) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,16 +11,18 @@ # norootforbuild Name: yast2-nfs-server -Version: 2.15.0 +Version: 2.15.1 Release: 1 License: GNU General Public License (GPL) Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-nfs-server-2.15.0.tar.bz2 +Source0: yast2-nfs-server-2.15.1.tar.bz2 prefix: /usr BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite Requires: yast2 >= 2.11.11 Requires: yast2-packager +Requires: limal-nfs-server +Requires: limal-nfs-server-perl Provides: yast2-config-nfs-server yast2-config-nfs-server-devel Obsoletes: yast2-config-nfs-server yast2-config-nfs-server-devel Provides: yast2-trans-nfs-server @@ -42,7 +44,7 @@ Martin Vidner <mvidner@suse.cz> %prep -%setup -n yast2-nfs-server-2.15.0 +%setup -n yast2-nfs-server-2.15.1 %build %{prefix}/bin/y2tool y2autoconf @@ -76,11 +78,36 @@ /usr/share/YaST2/modules/NfsServer.ybc %{prefix}/share/applications/YaST2/nfs_server.desktop /usr/share/YaST2/scrconf/etc_exports.scr +/usr/share/YaST2/scrconf/etc_idmapd_conf.scr +/usr/share/YaST2/scrconf/cfg_nfs.scr /usr/lib/YaST2/servers_non_y2/ag_exports +/usr/lib/YaST2/servers_non_y2/ag_idmapd_conf %doc %{prefix}/share/doc/packages/yast2-nfs-server /usr/share/YaST2/schema/autoyast/rnc/nfs_server.rnc %changelog +* Mon Feb 26 2007 - pchakravarthi@novell.com +- Fixed #242545: settings were not visible. +- Do not ignore changes when an item is deleted and readded (#243466). +- Do not continue with no directory entered (#243034). +- Fixed "Unable to start idmapd please check the domain settings" + (/etc/sysconfig/nfs was not flushed, #242565). +- 2.15.1 +* Mon Feb 26 2007 - pchakravarthi@novell.com +- Added a perl module ag_idmapd_conf for configuring entries in + /etc/idmapd.conf +- Added two scr agents - etc_idmapd_conf.scr and cfg_nfs.scr, the + former making use of ag_idmapd_conf and the later to configure + entries in /etc/sysconfig/nfs +- Modified Makefile.am in agents directory to reflect above. +- Modified NfsServer.ycp, ui.ycp and routines.ycp to make use of + all above and adding ui pieces to make the module NFSv4 aware. +- Modified the *.out files in testsuite/tests/ to reflect changes + made above. +- modified .spec.in file to add 'Requires' for limal-nfs-server + package and to include names of additional agent files. +- Relevant FATE ID : #300609 +- merged all this from SLE10-SP1 (mvidner). * Mon Feb 26 2007 - mvidner@suse.cz - Added no_subtree_check to the default options to reflect a change in nfs-utils-1.1.0 (#233709). ++++++ yast2-nfs-server-2.15.0.tar.bz2 -> yast2-nfs-server-2.15.1.tar.bz2 ++++++ ++++ 1648 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/agents/ag_idmapd_conf new/yast2-nfs-server-2.15.1/agents/ag_idmapd_conf --- old/yast2-nfs-server-2.15.0/agents/ag_idmapd_conf 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-nfs-server-2.15.1/agents/ag_idmapd_conf 2007-02-26 15:14:11.000000000 +0100 @@ -0,0 +1,164 @@ +#!/usr/bin/perl -w +# +# $Id: $ +# +# Agent for modifying /etc/idmapd.conf parameters. +# +# using limal-nfs-server swig interface, see: +# http://svn.suse.de/svn/limal/limal-head/limal-nfs-server/ +# + +use strict; +use ycp; +use Errno qw(ENOENT); +use LIMAL::NfsServer; +use LIMAL; + +my $filename=""; +my $conf = new LIMAL::NfsServer::KNfsIdmapdConf(); +my @idmapdentry = (); +my $entryName=""; + +# read the conf file + +sub parse_file() +{ + eval { + $conf->load($filename); + }; + if($@) + { + return $@; + } + return undef; +} + + +# verify and tell if there are errors in the conf file +sub checked_write_file () +{ + eval + { + my $res = $conf->verifyConf(); + my @msg = ""; + + if ($res->size() > 0) + { + y2error("Check failed !!"); + for(my $i = 0; $i < $res->size(); $i++) + { + push(@msg, $res->getitem($i)); + y2error($res->getitem($i)); + } + die "Error in Idmapd Entries ".join(": ",@msg. "\n"); + } + }; + return 0 if ($@); + + eval + { + $conf->save($filename,""); + }; + return 0 if ($@); + + return 1; + +} + + +sub set_entry () +{ + eval + { + $conf->setEntry($idmapdentry[0],$idmapdentry[1]); + if ($@) + { + y2error("Unable to set entry!"); + } + }; + return 0 if ($@); + + return 1; +} + + +sub get_value () +{ + my $value = ""; + eval + { + $value = $conf->getValueFor($entryName); + }; + return undef if ($@); + + return $value; +} + + +# +# MAIN program +# + +$filename="/etc/idmapd.conf"; + +while ( <STDIN> ) +{ + my ($command, $path, $argument) = ycp::ParseCommand ($_); + + if ($command eq "Write") + { + parse_file(); + my $result = "true"; + if ($path eq "." && ref ($argument) eq "ARRAY") + { + @idmapdentry = @{$argument}; + $result = set_entry() ? "true" : "false"; + if( $@) + { + y2error ("$@"); + } + + $result = checked_write_file()? "true":"false"; + } + else + { + y2error ("Wrong path $path or argument: ", ref ($argument)); + $result = "false"; + } + + ycp::Return ($result); + } + elsif ($command eq "Read") + { + parse_file(); + my $value = ""; + if ($path eq ".") + { + $entryName = $argument; + $value = get_value(); + } + if ($@) + { + y2error ("$@"); + } + else + { + y2error ("Wrong path $path"); + } + ycp::Return ($value); + + } + + elsif ($command eq "result") + { + exit; + } + + # Unknown command + else + { + y2error ("Unknown instruction $command or argument: ", ref ($argument)); + ycp::Return (undef); + } + +} diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/agents/cfg_nfs.scr new/yast2-nfs-server-2.15.1/agents/cfg_nfs.scr --- old/yast2-nfs-server-2.15.0/agents/cfg_nfs.scr 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-nfs-server-2.15.1/agents/cfg_nfs.scr 2007-02-26 15:14:11.000000000 +0100 @@ -0,0 +1,11 @@ +/** + * File: cfg_nfs.scr + * Summary: Agent for reading/writing /etc/sysconfig/nfs + * Access: read / write + * + */ +.sysconfig.nfs + +`ag_ini( + `SysConfigFile("/etc/sysconfig/nfs") +) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/agents/etc_idmapd_conf.scr new/yast2-nfs-server-2.15.1/agents/etc_idmapd_conf.scr --- old/yast2-nfs-server-2.15.0/agents/etc_idmapd_conf.scr 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-nfs-server-2.15.1/agents/etc_idmapd_conf.scr 2007-02-26 15:14:10.000000000 +0100 @@ -0,0 +1,43 @@ +/** + * File: + * etc_idmapdconf.scr + * Summary: + * SCR Agent for reading/writing /etc/idmapd.conf + * Access: + * Currently only write + * Authors: + * Chakravarthi P <pchakravarthi@novell.com> + * See: + * anyagent + * libscr + * man idmapd.conf + * Example: + * Partial /etc/idmapd.conf: + * + * [General] + * + * Verbosity=0 + * Pipefs-Directory=/var/lib/nfs/rpc_pipefs + * Domain=abc.com + * + * [<Another Section>] + * <name>=<value> + * + ** + * Read(.etc.idmapd_conf, "Domain") + * (abc.com) + * + * Read(.etc.idmapd_conf, "Verbosity") + * (0) + * + * Write(.etc.idmapd_conf, $["Domain", "doodahh"]) + * (false) + * + * Write(.etc.idmapd_conf, $["Verbosity", "4"]) + * (true) + * + * + */ +.etc.idmapd_conf + +`ag_idmapd_conf () diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/agents/Makefile.am new/yast2-nfs-server-2.15.1/agents/Makefile.am --- old/yast2-nfs-server-2.15.0/agents/Makefile.am 2005-05-18 16:25:32.000000000 +0200 +++ new/yast2-nfs-server-2.15.1/agents/Makefile.am 2007-02-26 16:36:29.000000000 +0100 @@ -1,11 +1,14 @@ # # Makefile.am for nfs-server/agents # -# $Id: Makefile.am 4227 2002-08-05 14:11:16Z mvidner $ +# $Id: Makefile.am 36506 2007-02-26 15:36:26Z mvidner $ # -agent_SCRIPTS = ag_exports +agent_SCRIPTS = ag_exports\ + ag_idmapd_conf -scrconf_DATA = etc_exports.scr +scrconf_DATA = etc_exports.scr\ + etc_idmapd_conf.scr\ + cfg_nfs.scr EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/configure.in new/yast2-nfs-server-2.15.1/configure.in --- old/yast2-nfs-server-2.15.0/configure.in 2007-02-26 10:19:30.000000000 +0100 +++ new/yast2-nfs-server-2.15.1/configure.in 2007-02-26 16:57:56.000000000 +0100 @@ -3,7 +3,7 @@ dnl -- This file is generated by y2autoconf 2.14.0 - DO NOT EDIT! -- dnl (edit configure.in.in instead) -AC_INIT(yast2-nfs-server, 2.15.0, http://bugs.opensuse.org/, yast2-nfs-server) +AC_INIT(yast2-nfs-server, 2.15.1, http://bugs.opensuse.org/, yast2-nfs-server) dnl Check for presence of file 'RPMNAME' AC_CONFIG_SRCDIR([RPMNAME]) @@ -17,7 +17,7 @@ AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs dnl Important YaST2 variables -VERSION="2.15.0" +VERSION="2.15.1" RPMNAME="yast2-nfs-server" MAINTAINER="Martin Vidner <mvidner@suse.cz>" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/src/NfsServer.ycp new/yast2-nfs-server-2.15.1/src/NfsServer.ycp --- old/yast2-nfs-server-2.15.0/src/NfsServer.ycp 2006-10-13 15:01:31.000000000 +0200 +++ new/yast2-nfs-server-2.15.1/src/NfsServer.ycp 2007-02-26 16:36:29.000000000 +0100 @@ -11,7 +11,7 @@ * Authors: * Martin Vidner <mvidner@suse.cz> * - * $Id: NfsServer.ycp 33404 2006-10-13 13:01:27Z mvidner $ + * $Id: NfsServer.ycp 36506 2007-02-26 15:36:26Z mvidner $ * */ @@ -25,6 +25,7 @@ import "Summary"; import "SuSEFirewall"; import "Wizard"; + import "Popup"; /* default value of settings modified */ @@ -65,6 +66,25 @@ /** + * Enable nfsv4 + */ + global boolean enable_nfsv4 = (SCR::Read(.sysconfig.nfs.NFS4_SUPPORT)=="yes"); + + + /** + * GSS Security ? + */ + global boolean nfs_security = (SCR::Read(.sysconfig.nfs.NFS_SECURITY_GSS)=="yes"); + + + /** + * Domain name to be used for nfsv4 (idmapd.conf) + */ + global string domain = ""; + + + + /** * Should the server be started? * New since 9.0: Exports are independent of this setting. */ @@ -140,11 +160,8 @@ */ global define boolean Read () ``{ start = Service::Enabled("nfsserver"); - y2milestone ("enabled: %1", start); exports = (list<map<string,any> >) SCR::Read (.etc.exports); - y2milestone ("exports: %1", exports); have_nfslock = (boolean) SCR::Read (.init.scripts.exists, "nfslock"); - y2milestone ("have_nfslock: %1", have_nfslock); boolean progress_orig = Progress::set (false); SuSEFirewall::Read (); @@ -225,6 +242,29 @@ Progress::Finish (); return false; } + if(enable_nfsv4) + { + SCR::Write(.sysconfig.nfs.NFS4_SUPPORT,"yes"); + SCR::Write(.sysconfig.nfs,nil); + } + else + { + SCR::Write(.sysconfig.nfs.NFS4_SUPPORT,"no"); + } + + if(nfs_security) + { + SCR::Write(.sysconfig.nfs.NFS_SECURITY_GSS,"yes"); + } + else + { + SCR::Write(.sysconfig.nfs.NFS_SECURITY_GSS,"no"); + } + + if( !( SCR::Write(.etc.idmapd_conf,["Domain",(string)domain]) ) ) + { + Popup::Message(_("Unable to write to idmapd.conf.")); + } Progress::NextStage (); @@ -270,6 +310,69 @@ ok = false; } + if (enable_nfsv4) + { + if (Service::Status("idmapd") == 3 ) + { + if (! Service::Start("idmapd")) + { + Report::Error(_("Unable to start idmapd. Please check your domain setting.")); + ok = false; + } + } + if (Service::Status("idmapd")== 0) + { + if (! Service::Restart("idmapd")) + { + Report::Error(_("Unable to restart idmapd")); + ok = false; + } + } + } + else + { + if (Service::Status("idmapd") == 3) + { + if(!Service::Stop("idmapd")) + { + Report::Error(_("Unable to stop idmapd")); + ok = false; + } + } + } + + if (nfs_security) + { + if (Service::Status("svcgssd") == 3 ) + { + if (! Service::Start("svcgssd")) + { + Report::Error(_("Unable to start svcgssd. Please ensure your kerberos and gssapi (nfs-utils) set up is fine.")); + ok = false; + } + } + if(Service::Status("svcgssd")== 0) + { + if (! Service::Restart("svcgssd")) + { + Report::Error(_("'svcgssd' is already running. Unable to restart it.")); + ok = false; + } + } + } + else + { + if (Service::Status("svcgssd") == 0) + { + if(!Service::Stop("svcgssd")) + { + Report::Error(_("'svcgssd' is running. Unable to stop it.")); + ok = false; + } + } + + } + if (!write_only) { if (Service::Status("portmap") != 0 ) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/src/routines.ycp new/yast2-nfs-server-2.15.1/src/routines.ycp --- old/yast2-nfs-server-2.15.0/src/routines.ycp 2006-10-13 15:01:32.000000000 +0200 +++ new/yast2-nfs-server-2.15.1/src/routines.ycp 2007-02-26 16:36:29.000000000 +0100 @@ -13,7 +13,7 @@ * Dan Vesely <dan@suse.cz> * Martin Vidner <mvidner@suse.cz> * - * $Id: routines.ycp 33404 2006-10-13 13:01:27Z mvidner $ + * $Id: routines.ycp 36506 2007-02-26 15:36:26Z mvidner $ * * Network NFS routines * @@ -21,6 +21,7 @@ { textdomain "nfs_server"; + import "NfsServer"; import "Popup"; import "Report"; @@ -75,6 +76,195 @@ return (list<string>) (flt[0, "allowed"]:nil); } + + /** + * Find out whether client representations are related + * @param clntexpr1 first client representation to which check is being made + * @param clntexpr2 another client representatio against which the check is done + * @return 1, if clntexpr1 is contained in clntexpr2 and -1, if otherway round, + * and 0 if they are independent + * @example 1.2.3.4 (is contained in) 1.*.3.4, + *.abc.com (contains)xyz.abc.com and xyz.* and abc.com are independent + * + * FIXME This is not too intelligent. Ideally a while loop with matching '*' is required. + * 1) Doesn't look default name domain. + * 2) Doesn't know how to deal with *.abc.* ; only single '*' please :( + */ + define integer ClientRelated (string clntexpr1, string clntexpr2) ``{ + + integer pos = findfirstof (clntexpr2,"*"); + integer len = size (clntexpr2); + + clntexpr2 = tolower (clntexpr2); + clntexpr1 = tolower (clntexpr1); + + if (pos == nil) + { + pos = findfirstof (clntexpr1,"*"); + if (pos == nil) + return 0; // FIXME We must continue investigating with name/ip resolution + // Both expressions not having *, doesn't mean they are not + // related. + return -1*ClientRelated (clntexpr2, clntexpr1); + } + + if (clntexpr2 == "*") + return 1; + if (clntexpr1 == clntexpr2) + return 1; + + if (pos == len - 1) // expressions of type abc.xyz.* + { + string check = substring (clntexpr2, 0, pos); + integer matchpos = findfirstof (clntexpr1, check); + if (matchpos == 0) + return 1; + + } else if (pos == 0) { // expressions of type *.abc.xyz + + string check = substring (clntexpr2, 1); + integer matchpos = findfirstof (clntexpr1, check); + string right = substring (clntexpr1,matchpos); + if (check == right) + return 1; + + } else { + // expressions of type abc.*.xyz + string checkleft = substring (clntexpr2, 0, pos); + integer matchpos = findfirstof (clntexpr1, checkleft); + if (matchpos == 0) + { + string checkright = substring (clntexpr2, pos+1); + integer matchpos = findfirstof (clntexpr1, checkright); + string right = substring (clntexpr1, matchpos); + + if (checkright == right) + return 1; + } + } + + return 0; + } + + + /** + * nfs-utils-1.0.1 gives a warning + * if neither of sync, async is specified. + * + * no_subtree_check: + * http://nfs.sourceforge.net/#faq_c7 + * nfs-utils-1.1.0, will switch the default from subtree_check + * to no_subtree_check (#233709) + */ + const string default_options = "ro,root_squash,sync,no_subtree_check"; + + /** + * Give out appropriate default options + * @param nfsv4 Is nfsv4 enabled ? + * @param exports list of exports + * @param client some string representation of the client (*, *.domain, ip address) + * @return a comma separated default options string, that is most appropriate + */ + define string GetDefaultOpts (boolean nfsv4, list<map> exports, string client) ``{ + + boolean withfsid = false; + + if (!nfsv4) + return default_options; + + foreach (map<string, any> entry, (list<map<string,any> >) exports, { + foreach (string hostops, entry["allowed"]:["()"], { + integer pos = findfirstof(hostops, "("); + string opts = ""; + string clientexpr = ""; + if (pos != nil) { + opts = substring(hostops, pos+1); + clientexpr = substring(hostops, 0, pos); + + pos = findfirstof(opts, ")"); + if (pos != nil) + opts = substring(opts, 0, pos); + } + if (ClientRelated (client, clientexpr)!=0) + { + if (issubstring (opts, "fsid=0")) { + withfsid = true; + break; + } + } + }); + if (withfsid) + break; + }); + + if (withfsid) + return default_options; + else + return "fsid=0," + default_options; + } + + + /** + * Report the first error that is encountered while checking for Unique NFSv4 + * psuedofilesystem root. + * @param exports list of exports + * @param expath the exported filesystem path + * @param client string representing a client (*, *.domain, ip address etc) + * @param eopts comma separated string of export options + * @return the first error encountered or nil + */ + define string CheckUniqueRootForClient (list<map> exports, string expath, + string client, string eopts) ``{ + string exportpath = ""; + string errorstring = nil; + integer clientrelation = 0; + + if (!issubstring(eopts,"fsid=0")) // Then no need to check for conflict. + return nil; + + foreach (map<string, any> entry, (list<map<string,any> >)exports, { + exportpath = entry["mountpoint"]:""; + foreach (string hostops, entry["allowed"]:["()"], { + string opts = ""; + string clientexpr = ""; + integer pos = findfirstof (hostops,"("); + if (pos != nil) { + opts = substring(hostops, pos+1); + clientexpr = substring(hostops, 0, pos); + + pos = findfirstof(opts, ")"); + if (pos != nil) + opts = substring(opts, 0, pos); + } + clientrelation = ClientRelated (client, clientexpr); + if (clientrelation != 0) + { + if (issubstring (opts, "fsid=0")) { + if (exportpath != expath) { // Aww ! Two different roots + if (clientrelation == 1) { + errorstring = + sformat(_("%3 and %4 are both exported with the option fsid=0 +for the same client '%1' (contained in '%2')"), client, clientexpr, expath, exportpath); + } else { + errorstring = + sformat(_("%3 and %4 are both exported with the option fsid=0 +for the same client '%1' (contained in '%2')"), clientexpr, client, expath, exportpath); + } + break; + } + + } + } + }); + if (errorstring != nil) + break; + }); + + return errorstring; + + } + + /** * @param exports list of exports * @return a ui table list of mountpoints, id'ed by themselves @@ -86,14 +276,80 @@ }); } + + /** + * @param clients list of "host(opts)" strings + * @return a string that has comma-separated list of bind target paths. + */ + define string getbindpaths (map entry) ``{ + + string exportpath = entry["mountpoint"]:""; + list<string> clients = entry["allowed"]:["()"]; + string bindpaths = ""; + list <string> paths = []; + foreach (string hostopts, clients, { + integer pos = findfirstof(hostopts, "("); + string opts = substring(hostopts, pos+1); + string clientexpr = substring(hostopts, 0, pos); + string bindpath = ""; + + pos = findfirstof(opts, ")"); + if (pos != nil) + opts = substring(opts, 0, pos); + if (opts == ""){ + y2error ("Your /etc/exports file has errors. The export path %1 has no export options specified.", exportpath); + } + pos = search (opts,"bind="); + if (pos != nil){ + bindpath = substring (opts, pos+5); + pos = findfirstof (bindpath, ","); + if (pos != nil){ + bindpath = substring (bindpath, 0, pos); + } + } + if (bindpath != "") + paths = prepend (paths, bindpath); + }); + if (size(paths) != 0) + bindpaths = mergestring (paths, ","); + + + return bindpaths; + } + + /** * @param exports list of exports - * @return a SelectionBox for the mountpoints, `id(`exportsbox) + * @return a ui table list of mountpoints and the corresponding + * bindmount targets, if any. + */ + define list<term> ExportsRows(list<map> exports) ``{ + return maplist(map entry, exports, ``{ + string exportpath = entry["mountpoint"]:""; + string bindpaths = getbindpaths (entry); + return `item(`id(exportpath), exportpath+" ", bindpaths); + }); + } + + + /** + * @param exports list of exports + * @return a SelectionBox for the mountpoints, `id(`exportsbox) containing + * list of exported directory paths. + * If nfsv4 is enabled return a table of 2 colums, first being the + * export path and the second one having bindmount targets as specified + * by in the export entries in /etc/exports */ define term ExportsSelBox(list<map> exports) ``{ - return `SelectionBox(`id(`exportsbox), `opt(`notify), - // selection box label - _("Dire&ctories"), ExportsItems(exports)); + if (NfsServer::enable_nfsv4) { + return `Table(`id(`exptable), `opt(`notify,`immediate), + `header("Directories","Bindmount Targets"), + ExportsRows(exports)); + } else { + return `SelectionBox(`id(`exportsbox), `opt(`notify), + // selection box label + _("Dire&ctories"), ExportsItems(exports)); + } } /** @@ -116,6 +372,7 @@ return false; } + /** * Check for the validity of export options: * [A-Za-z0-9=/.,_-]* @@ -134,6 +391,7 @@ return true; } + /** * Check for the validity of export options: only those listed in * exports(5) are accepted. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/src/ui.ycp new/yast2-nfs-server-2.15.1/src/ui.ycp --- old/yast2-nfs-server-2.15.0/src/ui.ycp 2007-02-26 09:49:29.000000000 +0100 +++ new/yast2-nfs-server-2.15.1/src/ui.ycp 2007-02-26 16:36:29.000000000 +0100 @@ -13,7 +13,7 @@ * Dan Vesely (dan@suse.cz) * Martin Vidner <mvidner@suse.cz> * - * $Id: ui.ycp 36472 2007-02-26 08:49:27Z mvidner $ + * $Id: ui.ycp 36506 2007-02-26 15:36:26Z mvidner $ * * Network NFS server dialogs * @@ -79,30 +79,37 @@ any ret = nil; do { ret = UI::UserInput(); - mountpoint = (string) UI::QueryWidget(`id(`mpent), `Value); + if (ret == `ok) { - list allowed = FindAllowed(exports, mountpoint); - if (allowed != nil) { - // error popup message - Popup::Message(_("The exports table already -contains this directory.")); + if (mountpoint == nil || mountpoint == "") + { + Popup::Message(_("Please enter a non-empty export path. Eg: /exports")); ret = nil; } - else if (!spaces_allowed && findfirstof (mountpoint, " \t") != nil) + else { - Popup::Message(sformat ( -// message popup; %1, %2 are package names + list allowed = FindAllowed(exports, mountpoint); + if (allowed != nil) + { + // error popup message + Popup::Message(_("The exports table already contains this directory.")); + ret = nil; + } + else if (!spaces_allowed && findfirstof (mountpoint, " \t") != nil) + { + Popup::Message(sformat ( + // message popup; %1, %2 are package names _("The user mode NFS server (%1) cannot export directories with spaces in their names. Use the kernel-based server (%2) to do that."), "nfs-server", "nfs-utils")); - ret = nil; - } - else if (SCR::Read (.target.size, mountpoint) < 0 && !Mode::config ()) { + ret = nil; + } + else if (SCR::Read (.target.size, mountpoint) < 0 && !Mode::config ()) { // the dir does not exist - ret = Popup::YesNo(_("The directory does not exist. -Create it?")) ? `ok : nil; + ret = Popup::YesNo(_("The directory does not exist. Create it?")) ? `ok : nil; + } } } else if (ret == `browse) @@ -118,6 +125,10 @@ if (size (dir) > 0) { + integer len = size (dir); + // remove the trailing "/" + if (dir != "/" && (substring (dir,len-1,1) == "/")) + dir = substring (dir,0,len-1); UI::ChangeWidget (`id (`mpent), `Value, dir); } @@ -142,25 +153,21 @@ boolean use_star_for_anonymous = false; /** - * nfs-utils-1.0.1 gives a warning - * if neither of sync, async is specified. - * - * no_subtree_check: - * http://nfs.sourceforge.net/#faq_c7 - * nfs-utils-1.1.0, will switch the default from subtree_check - * to no_subtree_check (#233709) - */ - string default_options = "ro,root_squash,sync,no_subtree_check"; - - /** * Ask user for an entry for the allowed hosts list. + * @param exports the current UI version of the exports list + * @param expath the exported filesystem for which this is done * @param hosts hosts default value * @param opts options default value * @param allowed current list, to check for duplicates * @return [newhosts, newopts] or nil if cancelled. Options without parentheses. */ - define list<string> GetAllowedHosts(string hosts, string opts, list<string> allowed) ``{ + define list<string> GetAllowedHosts(list<map> exports, string expath ,string hosts, string opts, + list<string> allowed, boolean fromedit) ``{ Wizard::SetScreenShotName ("nfs-server-2b-hosts"); + string error = nil; + map event = nil; + boolean hostchanged = false; + boolean optchanged = false; if (hosts == nil) hosts = ""; if (opts == nil) opts = ""; @@ -178,9 +185,9 @@ // make at least the default options fit `HSpacing (30), // text entry label - `TextEntry(`id(`hostsent), _("&Host Wild Card"), hosts), + `TextEntry(`id(`hostsent),`opt(`notify), _("&Host Wild Card"), hosts), // text entry label - `TextEntry(`id(`optsent), _("O&ptions"), opts), + `TextEntry(`id(`optsent),`opt(`notify), _("O&ptions"),opts), `VSpacing(0.2), // ok pushbutton: confirm the dialog `HBox(`PushButton(`id(`ok), `opt(`default, `key_F10), Label::OKButton()), @@ -192,7 +199,17 @@ UI::SetFocus (`id (`hostsent)); any ret = nil; do { - ret = UI::UserInput(); + event = UI::WaitForEvent(); + ret = event["ID"]:nil; + + if (ret == `hostsent) + { + hosts = (string) UI::QueryWidget(`id(`hostsent), `Value); + UI::ChangeWidget(`id(`hostsent), `Value, hosts); + if (!hostchanged) + hostchanged = true; + continue; + } hosts = (string) UI::QueryWidget(`id(`hostsent), `Value); if (use_star_for_anonymous && hosts == "") @@ -205,12 +222,46 @@ hosts = ""; UI::ChangeWidget (`id(`hostsent), `Value, hosts); } - opts = (string) UI::QueryWidget(`id(`optsent), `Value); - opts = deletechars (opts, " ()"); - UI::ChangeWidget (`id(`optsent), `Value, opts); + + if (ret == `optsent) + { + // check to see if user has changed options entry in the dialogue + // thrown due to a "Add Hosts" (as opposed to editing existing ones). + // If yes, suggest the user with a suitable default option set. + if (hostchanged && !fromedit) + { + if (!optchanged) + { + hosts = (string) UI::QueryWidget (`id(`hostsent),`Value); + opts = GetDefaultOpts(NfsServer::enable_nfsv4, exports,hosts); + UI::ChangeWidget (`id(`optsent),`Value,opts); + optchanged = true; + } + } + } + if (ret == `ok && (!CheckNoSpaces(hosts) || !CheckExportOptions(opts))) ret = nil; + if (ret == `ok && !NfsServer::enable_nfsv4) + { + if (issubstring (opts,"fsid=0")) { + Popup::Message(_("'fsid=0'is not a valid option unless +NFSv4 is enabled (previous page)")); + ret = nil; + } + } + + if (ret == `ok && NfsServer::enable_nfsv4) + { + error = CheckUniqueRootForClient (exports,expath,hosts,opts); + if (error != nil) + { + Popup::Message(error); + ret = nil; + } + } + if (ret == `ok && contains(allowed_names, hosts)) { // error popup message Popup::Message(_("Options for this wild card @@ -219,11 +270,22 @@ } } while (ret != `ok && ret != `cancel); + opts = (string) UI::QueryWidget (`id(`optsent),`Value); UI::CloseDialog(); + + if (opts == "") + { + opts = GetDefaultOpts(NfsServer::enable_nfsv4, exports,hosts); + } + + opts = deletechars (opts, " ()"); + Wizard::RestoreScreenShotName (); if (ret == `ok) + { return [ hosts, opts ]; + } return nil; } @@ -236,6 +298,15 @@ Wizard::SetScreenShotName ("nfs-server-1-start"); boolean start_nfs_server = NfsServer::start; + string domain = (string) SCR::Read(.etc.idmapd_conf,"Domain"); + if (domain == nil) + { + Popup::Message(_("Unable to read /etc/idmapd.conf file. Defaulting the domain to 'localdomain'")); + domain = "localdomain"; + } + + boolean enable_nfsv4 = NfsServer::enable_nfsv4; + boolean nfs_security = NfsServer::nfs_security; boolean changed = false; @@ -258,6 +329,15 @@ help_text = help_text + fw_cwm_widget["help"]:""; + help_text = help_text + +_("<P>If the server needs to handle NFSv4 clients, enable the option <B>Enable NFSv4</B>, +and fillin the NFSv4 domain name in the text entry, for id mapping daemon to use. Please leave +it as localdomain or refer to man page for idmapd and idmapd.conf if you are not sure.</P>"); + + help_text = help_text + +_("<P>If the server and client must authenticate using GSS library, please enable the <B>Enable GSS Security</B> +checkbox. For being able to use GSS API, currently you need to have kerberos and gssapi (nfs-utils > 1.0.7) on your system</P>"); + /* The end of the definitions */ term nfs_contents = @@ -268,7 +348,7 @@ // radio button label `VBox(`Left(`RadioButton(`id(`servyes), `opt (`notify), _("&Start"), start_nfs_server)), //radio button label - `Left(`RadioButton(`id(`servno), `opt (`notify), _("&Do Not Start"), !start_nfs_server)))), + `Left(`RadioButton(`id(`servno), `opt (`notify), _("Do &Not Start"), !start_nfs_server)))), `VSpacing(0.2))); term fw_contents = // frame label @@ -277,10 +357,33 @@ fw_cwm_widget["custom_widget"]:`Empty (), `VSpacing(0.2))); - term contents = `HVSquash (`VBox ( + term nfsv4_contents = + `Frame (_("Enable NFSv4"), + `VBox( + `VSpacing(0.2), + `Left(`CheckBox(`id(`enable_nfsv4),`opt(`notify),_("Enable NFS&v4"), enable_nfsv4)), + `VSpacing(0.2), + `TextEntry (`id(`domain),_("Enter NFSv4 do&main name:"), domain), + `VSpacing(0.2) + ) + ); + + + term sec_contents = + `Left(`CheckBox(`id(`nfs_security),`opt(`notify),_("Enable &GSS Security"),nfs_security)); + + + term contents = `HVSquash ( + `VBox ( nfs_contents, `VSpacing (1), - fw_contents)); + fw_contents, + `VSpacing (1), + nfsv4_contents, + `VSpacing (1), + sec_contents + ) + ); // dialog title Wizard::SetContents(_("NFS Server Configuration"), @@ -289,6 +392,15 @@ // initialize the widget (set the current value) CWMFirewallInterfaces::OpenFirewallInit (fw_cwm_widget, ""); + if (enable_nfsv4) + { + UI::ChangeWidget(`id(`domain),`Enabled, true); + } + else + { + UI::ChangeWidget(`id(`domain),`Enabled, false); + } + map event = nil; any ret = nil; do { @@ -304,8 +416,27 @@ Wizard::SetFocusToNextButton(); } - event = UI::WaitForEvent (); + event = UI::WaitForEvent (); ret = event["ID"]:nil; + if (ret == `enable_nfsv4) + { + enable_nfsv4 = (UI::QueryWidget(`id(`enable_nfsv4),`Value)==true); + NfsServer::enable_nfsv4 = enable_nfsv4; + if (enable_nfsv4) + { + UI::ChangeWidget(`id(`domain),`Enabled, true); + } + else + { + UI::ChangeWidget(`id(`domain),`Enabled, false); + } + } + + if (ret == `nfs_security) + { + nfs_security = (UI::QueryWidget(`id(`nfs_security),`Value)==true); + NfsServer::nfs_security = nfs_security; + } if (ret == `cancel) { ret = `abort; @@ -328,7 +459,7 @@ // grab current settings, store them to SuSEFirewall:: CWMFirewallInterfaces::OpenFirewallStore (fw_cwm_widget, "", event); NfsServer::start = start_nfs_server; - + NfsServer::domain = (string) UI::QueryWidget(`id(`domain),`Value); if (!start_nfs_server) { return `finish; @@ -346,13 +477,13 @@ define symbol ExportsDialog () ``{ Wizard::SetScreenShotName ("nfs-server-2-exports"); - // Help, part 1 of 4 + // Help, part 1 of 5 string help_text = _("<P>The upper box contains all the directories to export. If a directory is selected, the lower box shows the hosts allowed to mount this directory.</P> "); - // Help, part 2 of 4 + // Help, part 2 of 5 help_text = help_text + _("<P><b>Host Wild Card</b> sets which hosts can access the selected directory. It can be a single host, groups, wild cards, or IP networks.</P> @@ -361,45 +492,58 @@ // #91175 if (use_star_for_anonymous) { - // Help, part 3 of 4, variant for kernel space server + // Help, part 3 of 5, variant for kernel space server help_text = help_text + _("<p>Enter an asterisk (<tt>*</tt>) to specify all hosts.</p>"); } else { - // Help, part 3 of 4, variant for user space server + // Help, part 3 of 5, variant for user space server help_text = help_text + _("<p>Leave the field empty to specify all hosts.</p>"); } - // Help, part 4 of 4 + if (NfsServer::enable_nfsv4) + { + // Help, part 4 of 5, caution about fsid=0 in case NFSv4 is enabled. + help_text = help_text + _("<p>The NFSv4 option is enabled in the previous page. Make sure that only one exported filesystem is marked with fsid=0 option for a particular client.</p>"); + + help_text = help_text + _("<p>In case of multiple exports to a NFSv4 client, there is a need to bind the exported paths (not with fsid=0) to the one with fsid=0. To do this, simply add another export option, bind=/target/path where /target/path amounts to some directory existing below the fsid=0 - exported tree.</p>"); + } + + // Help, part 5 of 5 help_text = help_text + _("<P>Refer to <tt>man exports</tt> for more information.</P> "); list<map<string,any> > exports = NfsServer::exports; - term contents = - `VBox( - `ReplacePoint(`id(`exportsrep), ExportsSelBox(exports)), - // push button label - `HBox(`PushButton(`id(`mpnewbut), `opt (`key_F3), _("Add &Directory")), + term contents = `VBox(); + + contents = add (contents,`ReplacePoint(`id(`exportsrep), ExportsSelBox(exports))); + + // push button label + contents = add (contents, `HBox(`PushButton(`id(`mpnewbut), `opt (`key_F3), _("Add &Directory")), // push button label `PushButton(`id(`mpeditbut), `opt (`key_F4), _("&Edit")), // push button label - `PushButton(`id(`mpdelbut), `opt (`key_F5), _("De&lete"))), + `PushButton(`id(`mpdelbut), `opt (`key_F5), _("De&lete"))) + ); // push button label - `VBox(`Left(`Label(`id(`allowedlab), `opt(`hstretch), "")), + contents = add (contents, `VBox(`Left(`Label(`id(`allowedlab), `opt(`hstretch), "")), `Table(`id(`allowedtab), `opt(`notify, `immediate), // table header `header(_("Host Wild Card")+" ", // table header _("Options")+" "), - [])), + [])) + ); // push button label - `HBox(`PushButton(`id(`alwnewbut), _("Add &Host")), + + contents = add (contents, `HBox(`PushButton(`id(`alwnewbut), _("Add &Host")), // push button label `PushButton(`id(`alweditbut), _("Ed&it")), // push button label `PushButton(`id(`alwdelbut), _("Dele&te"))) - ); + ); + Wizard::SetContentsButtons ( // dialog title @@ -407,16 +551,27 @@ contents, help_text, Label::BackButton (), Label::FinishButton()); + map event = nil; any ret = nil; any simulated = nil; // simulated user input string oldmp = nil; // preselect an item - convenience, button enabling if (size (exports) > 0) { - UI::ChangeWidget (`id (`exportsbox), `CurrentItem, exports[0,"mountpoint"]:""); + if (NfsServer::enable_nfsv4){ + UI::ChangeWidget (`id (`exptable), `CurrentItem, exports[0,"mountpoint"]:""); + } else + UI::ChangeWidget (`id (`exportsbox), `CurrentItem, exports[0,"mountpoint"]:""); } do { - string mountpoint = (string) UI::QueryWidget (`id (`exportsbox), `CurrentItem); + + string mountpoint = ""; + if (NfsServer::enable_nfsv4) { + mountpoint = (string) UI::QueryWidget (`id (`exptable), `CurrentItem); + } + else + mountpoint = (string) UI::QueryWidget (`id (`exportsbox), `CurrentItem); + boolean anymp = mountpoint != nil; UI::ChangeWidget (`id (`mpeditbut), `Enabled, anymp); @@ -445,7 +600,8 @@ // used for `alweditbut afted `mpnewbut if (simulated == nil) { - ret = UI::UserInput(); + event = UI::WaitForEvent(); + ret = event["ID"]:nil; if (ret == `cancel) { ret = `abort; @@ -466,18 +622,28 @@ list default_allowed = [ sformat ("%1(%2)", use_star_for_anonymous? "*":"", - default_options) + GetDefaultOpts(NfsServer::enable_nfsv4, exports,"*") + ) ]; exports = add(exports, $[ "mountpoint" : mountpoint, "allowed" : default_allowed ]); UI::ReplaceWidget(`id(`exportsrep), ExportsSelBox(exports)); - UI::ChangeWidget(`id(`exportsbox), `CurrentItem, mountpoint); + if (NfsServer::enable_nfsv4) + UI::ChangeWidget(`id(`exptable), `CurrentItem, mountpoint); + else + UI::ChangeWidget(`id(`exportsbox), `CurrentItem, mountpoint); simulated = `alweditbut; } } else if (ret == `mpeditbut) { - string mp = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); + string mp = nil; + + if (NfsServer::enable_nfsv4) + mp = (string) UI::QueryWidget(`id(`exptable), `CurrentItem); + else + mp = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); + if (mp != nil) { string mountpoint = GetDirectory(mp, (list<map>) filter(map ent, exports, ``{ @@ -491,44 +657,77 @@ return add(ent, "mountpoint", mountpoint); return ent; }); + UI::ReplaceWidget(`id(`exportsrep), ExportsSelBox(exports)); - UI::ChangeWidget(`id(`exportsbox), `CurrentItem, mountpoint); + + if (NfsServer::enable_nfsv4) + UI::ChangeWidget(`id(`exptable), `CurrentItem, mountpoint); + else + UI::ChangeWidget(`id(`exportsbox), `CurrentItem, mountpoint); } } } else if (ret == `mpdelbut) { - string mountpoint = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); - if (mountpoint != nil) + string mountpoint = nil; + + if (NfsServer::enable_nfsv4) + mountpoint = (string) UI::QueryWidget(`id(`exptable), `CurrentItem); + else + mountpoint = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); + + if (mountpoint != nil) { exports = filter(map<string,any> entry, exports, ``(entry["mountpoint"]:"" != mountpoint)); + } UI::ReplaceWidget(`id(`exportsrep), ExportsSelBox(exports)); if (size (exports) > 0) { - UI::ChangeWidget (`id (`exportsbox), `CurrentItem, + if (NfsServer::enable_nfsv4) + UI::ChangeWidget(`id(`exptable), `CurrentItem, + exports[0,"mountpoint"]:""); + else + UI::ChangeWidget (`id (`exportsbox), `CurrentItem, exports[0,"mountpoint"]:""); } } else if (ret == `alwnewbut) { - string mountpoint = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); + string mountpoint = nil; + + if (NfsServer::enable_nfsv4) + mountpoint = (string) UI::QueryWidget(`id(`exptable), `CurrentItem); + else + mountpoint = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); + if (mountpoint != nil) { list<string> allowed = FindAllowed(exports, mountpoint); - list<string> hostopt = GetAllowedHosts(nil, nil, allowed); + list<string> hostopt = GetAllowedHosts(exports, mountpoint, nil, nil, allowed, false); if (hostopt != nil) { allowed = add(allowed, hostopt[0]:"" + "(" + hostopt[1]:"" + ")"); exports = ReplaceInExports(exports, mountpoint, allowed); UI::ChangeWidget(`id(`allowedtab), `Items, AllowedTableItems(allowed)); + if (NfsServer::enable_nfsv4) + { + UI::ReplaceWidget(`id(`exportsrep), ExportsSelBox(exports)); + UI::ChangeWidget(`id(`exptable), `CurrentItem, mountpoint); + } } } } else if (ret == `alweditbut) { - string mountpoint = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); + string mountpoint = nil; + + if (NfsServer::enable_nfsv4) + mountpoint = (string) UI::QueryWidget(`id(`exptable), `CurrentItem); + else + mountpoint = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); + if (mountpoint != nil) { list<string> allowed = FindAllowed(exports, mountpoint); string hosts = ""; @@ -542,19 +741,30 @@ } allowed = remove (allowed, alw_no); } - list<string> hostopt = GetAllowedHosts(hosts, opts, allowed); + list<string> hostopt = GetAllowedHosts(exports, mountpoint, hosts, opts, allowed, true); if (hostopt != nil) { allowed = add(allowed, hostopt[0]:"" + "(" + hostopt[1]:"" + ")"); exports = ReplaceInExports(exports, mountpoint, allowed); UI::ChangeWidget(`id(`allowedtab), `Items, AllowedTableItems(allowed)); + if (NfsServer::enable_nfsv4) + { + UI::ReplaceWidget(`id(`exportsrep), ExportsSelBox(exports)); + UI::ChangeWidget(`id(`exptable), `CurrentItem, mountpoint); + } } } } else if (ret == `alwdelbut) { - string mountpoint = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); + string mountpoint = nil; + + if (NfsServer::enable_nfsv4) + mountpoint = (string) UI::QueryWidget(`id(`exptable), `CurrentItem); + else + mountpoint = (string) UI::QueryWidget(`id(`exportsbox), `CurrentItem); + if (mountpoint != nil) { list<string> allowed = FindAllowed(exports, mountpoint); integer alwno = (integer) UI::QueryWidget(`id(`allowedtab), `CurrentItem); @@ -568,6 +778,11 @@ UI::ChangeWidget(`id(`allowedtab), `Items, AllowedTableItems(allowed)); + if (NfsServer::enable_nfsv4) + { + UI::ReplaceWidget(`id(`exportsrep), ExportsSelBox(exports)); + UI::ChangeWidget(`id(`exptable), `CurrentItem, mountpoint); + } } } } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/testsuite/tests/readwrite2.out new/yast2-nfs-server-2.15.1/testsuite/tests/readwrite2.out --- old/yast2-nfs-server-2.15.0/testsuite/tests/readwrite2.out 2006-01-16 15:29:47.000000000 +0100 +++ new/yast2-nfs-server-2.15.1/testsuite/tests/readwrite2.out 2007-02-26 15:14:15.000000000 +0100 @@ -1,3 +1,5 @@ +Read .sysconfig.nfs.NFS4_SUPPORT nil +Read .sysconfig.nfs.NFS_SECURITY_GSS nil Dump Dump Read - services are running Dump @@ -20,6 +22,9 @@ Read .target.dir "/pub" nil Execute .target.mkdir "/pub" true Write .etc.exports [$["allowed":["proj*.local.domain(rw)"], "mountpoint":"/projects"], $["allowed":["*.local.domain(ro)", "@trusted(rw)"], "mountpoint":"/usr"], $["allowed":["(ro,insecure,all_squash)"], "mountpoint":"/pub"]] true +Write .sysconfig.nfs.NFS4_SUPPORT "no" true +Write .sysconfig.nfs.NFS_SECURITY_GSS "no" true +Write .etc.idmapd_conf ["Domain", ""] true Read .init.scripts.exists "nfsserver" true Execute .target.bash "/etc/init.d/nfsserver stop" $["TERM":"raw"] 0 Read .init.scripts.exists "nfsserver" true @@ -56,6 +61,9 @@ Read .target.dir "/pub" nil Execute .target.mkdir "/pub" true Write .etc.exports [$["allowed":["proj*.local.domain(rw)"], "mountpoint":"/projects"], $["allowed":["*.local.domain(ro)", "@trusted(rw)"], "mountpoint":"/usr"], $["allowed":["(ro,insecure,all_squash)"], "mountpoint":"/pub"]] true +Write .sysconfig.nfs.NFS4_SUPPORT "no" true +Write .sysconfig.nfs.NFS_SECURITY_GSS "no" true +Write .etc.idmapd_conf ["Domain", ""] true Read .init.scripts.exists "portmap" true Read .init.scripts.exists "portmap" true Read .init.scripts.exists "portmap" true @@ -72,6 +80,12 @@ Read .init.scripts.exists "nfsserver" true Read .init.scripts.runlevel "nfsserver" $["nfsserver":$["start":["3", "5"], "stop":["3", "5"]], "portmap":$["start":["3", "5"], "stop":["3", "5"]]] Read .init.scripts.comment "nfsserver" $["nfsserver":$[], "portmap":$[]] +Read .init.scripts.exists "idmapd" true +Execute .target.bash "/etc/init.d/idmapd status" $["TERM":"raw"] 0 +Read .init.scripts.exists "svcgssd" true +Execute .target.bash "/etc/init.d/svcgssd status" $["TERM":"raw"] 0 +Read .init.scripts.exists "svcgssd" true +Execute .target.bash "/etc/init.d/svcgssd stop" $["TERM":"raw"] 0 Read .init.scripts.exists "portmap" true Execute .target.bash "/etc/init.d/portmap status" $["TERM":"raw"] 0 Read .init.scripts.exists "nfsserver" true @@ -103,6 +117,9 @@ Read .target.dir "/pub" nil Execute .target.mkdir "/pub" true Write .etc.exports [$["allowed":["proj*.local.domain(rw)"], "mountpoint":"/projects"], $["allowed":["*.local.domain(ro)", "@trusted(rw)"], "mountpoint":"/usr"], $["allowed":["(ro,insecure,all_squash)"], "mountpoint":"/pub"]] true +Write .sysconfig.nfs.NFS4_SUPPORT "no" true +Write .sysconfig.nfs.NFS_SECURITY_GSS "no" true +Write .etc.idmapd_conf ["Domain", ""] true Read .init.scripts.exists "nfsserver" true Execute .target.bash "/etc/init.d/nfsserver stop" $["TERM":"raw"] 0 Read .init.scripts.exists "nfsserver" true @@ -138,6 +155,9 @@ Read .target.dir "/pub" nil Execute .target.mkdir "/pub" true Write .etc.exports [$["allowed":["proj*.local.domain(rw)"], "mountpoint":"/projects"], $["allowed":["*.local.domain(ro)", "@trusted(rw)"], "mountpoint":"/usr"], $["allowed":["(ro,insecure,all_squash)"], "mountpoint":"/pub"]] true +Write .sysconfig.nfs.NFS4_SUPPORT "no" true +Write .sysconfig.nfs.NFS_SECURITY_GSS "no" true +Write .etc.idmapd_conf ["Domain", ""] true Read .init.scripts.exists "portmap" true Read .init.scripts.exists "portmap" true Read .init.scripts.exists "portmap" true @@ -156,6 +176,12 @@ Read .init.scripts.runlevel "nfsserver" $["nfsserver":$["start":[], "stop":[]], "portmap":$["start":[], "stop":[]]] Read .init.scripts.comment "nfsserver" $["nfsserver":$[], "portmap":$[]] Execute .target.bash_output "/sbin/insserv -d /etc/init.d/nfsserver" $["exit":0, "stderr":"", "stdout":""] +Read .init.scripts.exists "idmapd" true +Execute .target.bash "/etc/init.d/idmapd status" $["TERM":"raw"] 0 +Read .init.scripts.exists "svcgssd" true +Execute .target.bash "/etc/init.d/svcgssd status" $["TERM":"raw"] 0 +Read .init.scripts.exists "svcgssd" true +Execute .target.bash "/etc/init.d/svcgssd stop" $["TERM":"raw"] 0 Read .init.scripts.exists "portmap" true Execute .target.bash "/etc/init.d/portmap status" $["TERM":"raw"] 0 Read .init.scripts.exists "nfsserver" true diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/testsuite/tests/readwrite.out new/yast2-nfs-server-2.15.1/testsuite/tests/readwrite.out --- old/yast2-nfs-server-2.15.0/testsuite/tests/readwrite.out 2006-01-16 15:29:34.000000000 +0100 +++ new/yast2-nfs-server-2.15.1/testsuite/tests/readwrite.out 2007-02-26 15:14:14.000000000 +0100 @@ -1,3 +1,5 @@ +Read .sysconfig.nfs.NFS4_SUPPORT nil +Read .sysconfig.nfs.NFS_SECURITY_GSS nil Dump Read Read .init.scripts.exists "nfsserver" true Read .init.scripts.runlevel "nfsserver" $["nfslock":$["start":["3", "5"], "stop":["3", "5"]], "nfsserver":$["start":["3", "5"], "stop":["3", "5"]], "portmap":$["start":["3", "5"], "stop":["3", "5"]]] @@ -16,6 +18,9 @@ Read .target.dir "/pub" nil Execute .target.mkdir "/pub" true Write .etc.exports [$["allowed":["proj*.local.domain(rw)"], "mountpoint":"/projects"], $["allowed":["*.local.domain(ro)", "@trusted(rw)"], "mountpoint":"/usr"], $["allowed":["(ro,insecure,all_squash)"], "mountpoint":"/pub"]] true +Write .sysconfig.nfs.NFS4_SUPPORT "no" true +Write .sysconfig.nfs.NFS_SECURITY_GSS "no" true +Write .etc.idmapd_conf ["Domain", ""] true Read .init.scripts.exists "portmap" true Read .init.scripts.exists "portmap" true Read .init.scripts.exists "portmap" true @@ -31,6 +36,12 @@ Read .init.scripts.exists "nfsserver" true Read .init.scripts.runlevel "nfsserver" $["nfslock":$["start":["3", "5"], "stop":["3", "5"]], "nfsserver":$["start":["3", "5"], "stop":["3", "5"]], "portmap":$["start":["3", "5"], "stop":["3", "5"]]] Read .init.scripts.comment "nfsserver" $["nfslock":$[], "nfsserver":$[], "portmap":$[]] +Read .init.scripts.exists "idmapd" true +Execute .target.bash "/etc/init.d/idmapd status" $["TERM":"raw"] 0 +Read .init.scripts.exists "svcgssd" true +Execute .target.bash "/etc/init.d/svcgssd status" $["TERM":"raw"] 0 +Read .init.scripts.exists "svcgssd" true +Execute .target.bash "/etc/init.d/svcgssd stop" $["TERM":"raw"] 0 Read .init.scripts.exists "portmap" true Execute .target.bash "/etc/init.d/portmap status" $["TERM":"raw"] 0 Read .init.scripts.exists "nfsserver" true diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/testsuite/tests/readwrite-unfsd.out new/yast2-nfs-server-2.15.1/testsuite/tests/readwrite-unfsd.out --- old/yast2-nfs-server-2.15.0/testsuite/tests/readwrite-unfsd.out 2006-01-16 15:29:08.000000000 +0100 +++ new/yast2-nfs-server-2.15.1/testsuite/tests/readwrite-unfsd.out 2007-02-26 15:14:14.000000000 +0100 @@ -1,3 +1,5 @@ +Read .sysconfig.nfs.NFS4_SUPPORT nil +Read .sysconfig.nfs.NFS_SECURITY_GSS nil Dump Read Read .init.scripts.exists "nfsserver" true Read .init.scripts.runlevel "nfsserver" $["network":$["start":["3", "5"], "stop":["3", "5"]], "networkmanager":$["start":[], "stop":[]], "nfsserver":$["start":["3", "5"], "stop":["3", "5"]], "portmap":$["start":["3", "5"], "stop":["3", "5"]]] @@ -16,6 +18,9 @@ Read .target.dir "/pub" nil Execute .target.mkdir "/pub" true Write .etc.exports [$["allowed":["proj*.local.domain(rw)"], "mountpoint":"/projects"], $["allowed":["*.local.domain(ro)", "@trusted(rw)"], "mountpoint":"/usr"], $["allowed":["(ro,insecure,all_squash)"], "mountpoint":"/pub"]] true +Write .sysconfig.nfs.NFS4_SUPPORT "no" true +Write .sysconfig.nfs.NFS_SECURITY_GSS "no" true +Write .etc.idmapd_conf ["Domain", ""] true Read .init.scripts.exists "portmap" true Read .init.scripts.exists "portmap" true Read .init.scripts.exists "portmap" true @@ -26,6 +31,12 @@ Read .init.scripts.exists "nfsserver" true Read .init.scripts.runlevel "nfsserver" $["network":$["start":["3", "5"], "stop":["3", "5"]], "networkmanager":$["start":[], "stop":[]], "nfsserver":$["start":["3", "5"], "stop":["3", "5"]], "portmap":$["start":["3", "5"], "stop":["3", "5"]]] Read .init.scripts.comment "nfsserver" $["nfsserver":$[], "portmap":$[]] +Read .init.scripts.exists "idmapd" true +Execute .target.bash "/etc/init.d/idmapd status" $["TERM":"raw"] 0 +Read .init.scripts.exists "svcgssd" true +Execute .target.bash "/etc/init.d/svcgssd status" $["TERM":"raw"] 0 +Read .init.scripts.exists "svcgssd" true +Execute .target.bash "/etc/init.d/svcgssd stop" $["TERM":"raw"] 0 Read .init.scripts.exists "portmap" true Execute .target.bash "/etc/init.d/portmap status" $["TERM":"raw"] 0 Read .init.scripts.exists "nfsserver" true diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-nfs-server-2.15.0/VERSION new/yast2-nfs-server-2.15.1/VERSION --- old/yast2-nfs-server-2.15.0/VERSION 2007-02-26 10:12:34.000000000 +0100 +++ new/yast2-nfs-server-2.15.1/VERSION 2007-02-26 16:55:15.000000000 +0100 @@ -1 +1 @@ -2.15.0 +2.15.1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de