
functions
files
intro
|
|
Configuration of inetd |
include/inetd/routines.ycp |
Miscelanous functions for configuration of inetd. |
|
|
Imports
- Directory
- Inetd
- Popup
- Progress
- Require
- Service
- UsersCache
Local Variables
Local Functions
- AddNotInstalled (list<map <string, any> > netd_conf, list<term> table_data)
- CreateLocalGroupsList ()
- CreateLocalUsersList ()
- CreateTableData (list<map <string, any> > netd_conf)
- GetDefaults ()
- GetInetdInstalled ()
- GetInetdStatus ()
- GetServerBasename (string server, string server_args)
- GetXinetdInstalled ()
- GetXinetdStatus ()
- IsAnyServiceEnabled (list<map <string, any> > ready_conf)
- IsInstalled (string rpm)
- IsInstalledClearCache ()
- PollAbort ()
- ProgressNextStage (string title)
- ReallyAbort ()
- ServiceToTableItem (map service, integer ni_index)
- ServicesMatch (map<string, any> a, map<string, any> b)
- getenv (string environment)
- isServiceMatchPresent (list<map <string, any> > netd_conf, map<string, any> s)
- struct_match (map a, map b, list fields)
- struct_match_sparse (map a, map b, list fields)
|
|
|
local GetInetdInstalled () -> integer
|
|
Return rpm -q status for inetd package
- Return value:
local GetXinetdInstalled () -> integer
|
|
Return rpm -q status for xinetd package
- Return value:
local GetInetdStatus () -> integer
|
|
Return status of inetd service
- Return value:
local GetXinetdStatus () -> integer
|
|
Return status of xinetd service
- Return value:
local PollAbort () -> boolean
|
|
Check for pending Abort press
- Return value:
local ReallyAbort () -> boolean
|
|
If modified, ask for confirmation
- Return value:
|
true if abort is confirmed |
local ProgressNextStage (string title) -> void
|
|
Progress::NextStage and Progress::Title combined into one function
- Parameters:
local GetServerBasename (string server, string server_args) -> string
|
|
Used for cpmparisons whether the servers match:
If server is /usr/sbin/tcpd, consider server_args instead.
Then take the firse word (strips arguments or the parenthesized pkg name).
Then take the last slash-delimited component.
For sparse matching: nil is returned if server is nil
(or if server args is nil AND is needed)
- Parameters:
server |
"server" field of a service |
server_args |
"server_args" field of a service |
- Return value:
|
basename of the real server |
local struct_match (map a, map b, list fields) -> boolean
|
|
Considers the maps as structs and tests
some of their fields for equality (conjunctively, short circuit).
- Parameters:
a |
one struct |
b |
other struct |
fields |
list of keys |
- Return value:
|
Do the maps have all the named fields equal? |
local struct_match_sparse (map a, map b, list fields) -> boolean
|
|
Considers the maps as structs and tests
some of their fields for equality (conjunctively, short circuit).
If a key is missing in either of the maps, it is considered as matching.
Used when merging autoyast items, to match only those fields that
are specified in the profile. There, only one map is sparse.
(the profile map)
- Parameters:
a |
one struct |
b |
other struct |
fields |
list of keys |
- Return value:
|
Do the maps have all named fields that are in both of them equal? |
- Example:
-
match: $["a": 1, "b": 2, "c": 3], $["b": 2, "d": 4] |
local isServiceMatchPresent (list<map <string, any> > netd_conf, map<string, any> s) -> boolean
|
|
Determine, if service package is installed.
This function requires full configuration
(like Inetd::netd_conf) and standalone map with service.
Linear complexity (in the working config)
- Parameters:
netd_conf |
Full configuration |
s |
a service |
- Return value:
local GetDefaults () -> list<map <string, any> >
|
|
Encapsulates the mess of supporting two netds and loading the
defaults on the fly.
Needs Inetd::configured_service.
- Return value:
|
Inetd::default_conf_(x)inetd["netd_conf"] |
local AddNotInstalled (list<map <string, any> > netd_conf, list<term> table_data) -> list<term>
|
|
This function merges real xinetd configuration (read by agent) and
available services packages generated for SuSE distribution
This function is automaticaly calld by CreateTableData() if Inetd::configured_service
is `xinetd.
Adds those from default_conf that do not have a matching
service in the working config.
- Parameters:
netd_conf |
not used in this function, but used for
isServiceMatchPresent call. |
table_data |
Table data structure used as source data |
- Return value:
local ServiceToTableItem (map service, integer ni_index) -> term
|
|
- Parameters:
service |
service |
ni_index |
if nil, use iid as id, otherwise "NI"+ni_index |
- Return value:
local CreateTableData (list<map <string, any> > netd_conf) -> list<term>
|
|
Converts configuration format from agent to table data structures
- Parameters:
netd_conf |
netd_conf handles whole configuration of configured service |
- Return value:
local CreateLocalUsersList () -> list<string>
|
|
Read user names from passwd.
It does not get the NIS entries.
"+" is filtered out.
- Return value:
local CreateLocalGroupsList () -> list<string>
|
|
Read group names from group
It does not get the NIS entries.
"+" is filtered out.
- Return value:
local IsAnyServiceEnabled (list<map <string, any> > ready_conf) -> symbol
|
|
Find any service to be enabled
If no found, return `no
- Parameters:
ready_conf |
ready_conf handles whole service configuration (Inetd::netd_conf) |
- Return value:
|
returnes if found `yes, otherwise `no |
local ServicesMatch (map<string, any> a, map<string, any> b) -> boolean
|
|
Do the services match?
Considered fields:
"script", "service", "protocol", "server" (or "server_args", if tcpd)
The matching is sparse: a missing field in either map
means the field is condidered as matching.
- Parameters:
- Return value:
local getenv (string environment) -> string
|
|
Get contents of environment variable.
- Parameters:
environment |
name of requested variable |
- Return value:
|
environment variable contents |
local is_installed_cache -> map
|
|
Cache for IsInstalled.
local IsInstalledClearCache () -> void
|
|
Clears cache for IsInstalled .
This is too wasteful. Later, when it works, optimize for single packages.
local IsInstalled (string rpm) -> boolean
|
|
Queries RPM or autoyast list whether a package is installed.
Results are cached in is_installed_cache
- Parameters:
rpm |
eg. "finger-server", "" has special significance:
package unknown, so it cannot be installed |
- Return value:
|