YaST2 Developers Documentation: Configuration of nfs server

Configuration of nfs server

routines.ycp
Network NFS routines

This module has an unstable interface.

Network NFS routines

Imports

  • NfsServer
  • Popup
  • Report

Local Functions

local AllowedToHostsOpts (string hosts) -> list<string>

Split the allowed host specification

Parameters:
hosts "hosts(opts)"
Return value:
["hosts", "opts"]
local AllowedTableItems (list<string> allowed) -> list<term>

Parameters:
allowed a list of allowed host specifications
Return value:
a ui table list of items
Example
 AllowedTableItems (["*.local.domain(ro)", "@trusted(rw)"])
local FindAllowed (list<map> exports, string mp) -> list<string>

Find entry in exports according to the mountpoint

Parameters:
exports list of exports
mp mount point
Return value:
a list of allowed host specifications or nil if not found
local ClientRelated (string clntexpr1, string clntexpr2) -> integer

Find out whether client representations are related

Parameters:
clntexpr1 first client representation to which check is being made
clntexpr2 another client representatio against which the check is done
Return value:
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 :(
local GetDefaultOpts (boolean nfsv4, list<map> exports, string client) -> string

Give out appropriate default options

Parameters:
nfsv4 Is nfsv4 enabled ?
exports list of exports
client some string representation of the client (*, *.domain, ip address)
Return value:
a comma separated default options string, that is most appropriate
local CheckUniqueRootForClient (list<map> exports, string expath, string client, string eopts) -> string

Report the first error that is encountered while checking for Unique NFSv4 psuedofilesystem root.

Parameters:
exports list of exports
expath the exported filesystem path
client string representing a client (*, *.domain, ip address etc)
eopts comma separated string of export options
Return value:
the first error encountered or nil
local ExportsItems (list<map> exports) -> list<term>

Parameters:
exports list of exports
Return value:
a ui table list of mountpoints, id'ed by themselves
local getbindpaths (map entry) -> string

Parameters:
entry
Return value:
a string that has comma-separated list of bind target paths.
local ExportsRows (list<map> exports) -> list<term>

Parameters:
exports list of exports
Return value:
a ui table list of mountpoints and the corresponding bindmount targets, if any.
local ExportsSelBox (list<map> exports) -> term

Parameters:
exports list of exports
Return value:
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
local CheckNoSpaces (string name) -> boolean

Check for the validity of client specification: fewer than 70 chars, no blanks. If invalid, a message is displayed.

Parameters:
name options
Return value:
whether valid
local CheckExportOptions (string options) -> boolean

Check for the validity of export options: [A-Za-z0-9=/.,_-]* If invalid, a message is displayed.

Parameters:
options spaces and parentheses already removed
Return value:
whether valid
local CheckExportOptions_strict (string options) -> boolean

Check for the validity of export options: only those listed in exports(5) are accepted. Unused - to allow not only nfs-utils but also nfs-server. If invalid, a message is displayed.

Parameters:
options spaces and parentheses already removed
Return value:
whether valid
local CheckSyntaxErrors (list<map<string,any> > exports) -> void

Check for suspicious allowed lists and warn the user. Like "host(rw, sync)" with the space.

Parameters:
exports
local ReplaceInExports (list<map<string,any> > exports, string mountpoint, list<string> allowed) -> list<map<string,any> >

Replaces 'allowed' list in exports (for specified mountpoint)

Parameters:
exports exports list
mountpoint mount point
allowed new allowed host list for that mout point
Return value:
modified exports list