11. YaPI::Samba

This package is the public Yast2 API to configure the Samba server.

11.1. List of Global Functions

11.2. Functions

11.2.1. $hostList = GetServiceStatus ();

Returns the current status of smb and nmb services. True means the services are both started in at least on runlevel. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.2. $serverRole = DetermineRole();

This function determines role of a server in the SMB network. The return values can be unknown, standalone, bdc and pdc. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.3. $enabled = EditService($enable);

Modifies the status of the service. If the parameter is true, smb and nmb services are enabled in the default runlevels, if there were not enabled already in at least single runlevel. False will turn off the service in all runlevels. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.4. $result = EditServerAsBDC($pdc_name)

Configures the global settings of a server to behave like a backup domain controller. The primary domain controller is setup by the argument. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.5. $result = EditServerAsPDC()

Configures the global settings of a server to behave like a primary domain controller. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.6. $result = EditServerAsStandalone();

Configures the global settings of a server to behave like a standalone server not taking part in any domain. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.7. $description = GetServerDescription();

Returns the configured description of the server. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.8. $result = EditServerDescription($description);

Configures the description of the server shown in clients. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.9. @passdb = GetSAMBackends();

Returns a list of configured SAM backends. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.10. @passdb = GetSAMConfiguration();

Returns a list of options specified for the given SAM. The structure of the options is sam-type specific. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.11. $result = EditSAMConfiguration($samString, $passdbHash);

Modifies the configuration of the given sam. The structure of the hash must follow the structure as specified for GetSAMConfiguration. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.12. $result = EditDefaultSAM($samString);

Sets the SAM as default one, meaning that adding a new user will be done using this SAM. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.13. $result = AddSAM($samString,$isDefault);

Creates a new SAM using the given name and configuration. The structure of the hash must follow the structure as specified for GetSAMConfiguration. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.14. $result = DeleteSAM($samString);

Deletes the specified sam. It is not possible to Delete the default one. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.15. $result = EnableShare($shareName,$enable);

Enables/disables the given share. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.16. $result = GetShareEnabled($shareName);

Returns true if the given stare is enabled, false if disabled. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.17. $result = AddShare($shareName,$options);

Creates a new share with the given name and initial options. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.18. $result = DeleteShare($shareName);

Deletes the given share. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.19. $result = EditShare($shareName,$options);

Modifies the given share to use the given options. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.20. $options = GetShare($shareName);

Returns a hash describing the given share. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.21. $shares = GetAllDirectories();

Returns a list of all shares configured to provide a directory, including special-purpose shares like homes and netlogon. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.22. $result = EnableHomes($enable);

Enables a special-purpose share for sharing homes of a user. If the share does not exist, a default template is used. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.23. $result = EnableNetlogon($enable);

Enables a special-purpose share for login scripts. If the share does not exist, a default template is used. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.24. $shares = GetAllPrinters();

Returns a list of all printers configured to be shared. On error, undef is returned and the Error() function can be used to get the error hash.

11.2.25. $result = EnablePrinters($printerList,$enable);

Enables/disables sharing of the given printers. On error, undef is returned and the Error() function can be used to get the error hash.