LibreOffice
LibreOffice 6.0 SDK C/C++ API Reference
Typedefs | Enumerations | Functions
security.h File Reference
#include <sal/config.h>
#include <rtl/ustring.h>
#include <sal/saldllapi.h>

Go to the source code of this file.

Typedefs

typedef void * oslSecurity
 Process handle. More...
 

Enumerations

enum  oslSecurityError {
  osl_Security_E_None, osl_Security_E_UserUnknown, osl_Security_E_WrongPassword, osl_Security_E_Unknown,
  osl_Security_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
}
 

Functions

SAL_DLLPUBLIC oslSecurity osl_getCurrentSecurity (void)
 Create a security handle for the current user. More...
 
SAL_DLLPUBLIC oslSecurityError osl_loginUser (rtl_uString *strUserName, rtl_uString *strPasswd, oslSecurity *pSecurity)
 Deprecated API Create a security handle for the denoted user. More...
 
SAL_DLLPUBLIC oslSecurityError osl_loginUserOnFileServer (rtl_uString *strUserName, rtl_uString *strPasswd, rtl_uString *strFileServer, oslSecurity *pSecurity)
 Create a security handle for the denoted user. More...
 
SAL_DLLPUBLIC sal_Bool osl_isAdministrator (oslSecurity Security)
 Query if the user who is denotes by this security has administrator rights. More...
 
SAL_DLLPUBLIC void osl_freeSecurityHandle (oslSecurity Security)
 Free the security handle, created by osl_loginUser or osl_getCurrentSecurity. More...
 
SAL_DLLPUBLIC sal_Bool osl_getUserIdent (oslSecurity Security, rtl_uString **strIdent)
 Get the login ident for the user of this security handle. More...
 
SAL_DLLPUBLIC sal_Bool osl_getUserName (oslSecurity Security, rtl_uString **strName)
 Get the login name for the user of this security handle. More...
 
SAL_DLLPUBLIC sal_Bool osl_getShortUserName (oslSecurity Security, rtl_uString **strName)
 Get the login name for the user of this security handle, excluding the domain name on Windows. More...
 
SAL_DLLPUBLIC sal_Bool osl_getHomeDir (oslSecurity Security, rtl_uString **strDirectory)
 Get the home directory of the user of this security handle. More...
 
SAL_DLLPUBLIC sal_Bool osl_getConfigDir (oslSecurity Security, rtl_uString **strDirectory)
 Get the directory for configuration data of the user of this security handle. More...
 
SAL_DLLPUBLIC sal_Bool osl_loadUserProfile (oslSecurity Security)
 Load Profile of the User Implemented just for Windows. More...
 
SAL_DLLPUBLIC void osl_unloadUserProfile (oslSecurity Security)
 Unload a User Profile Implemented just for Windows. More...
 

Typedef Documentation

typedef void* oslSecurity

Enumeration Type Documentation

Enumerator
osl_Security_E_None 
osl_Security_E_UserUnknown 
osl_Security_E_WrongPassword 
osl_Security_E_Unknown 
osl_Security_E_FORCE_EQUAL_SIZE 

Function Documentation

SAL_DLLPUBLIC void osl_freeSecurityHandle ( oslSecurity  Security)

Free the security handle, created by osl_loginUser or osl_getCurrentSecurity.

Parameters
[in]Securitythe security handle.
See also
osl_loginUser
SAL_DLLPUBLIC sal_Bool osl_getConfigDir ( oslSecurity  Security,
rtl_uString **  strDirectory 
)

Get the directory for configuration data of the user of this security handle.

Parameters
[in]Securitythe security handle.
[out]strDirectorythe string that receives the directory path on success.
Returns
True, if the security handle is valid, otherwise False.
SAL_DLLPUBLIC oslSecurity osl_getCurrentSecurity ( void  )

Create a security handle for the current user.

Returns
a security handle or NULL on failure.
See also
osl_freeSecurityHandle
osl_executeProcess
osl_executeApplication
SAL_DLLPUBLIC sal_Bool osl_getHomeDir ( oslSecurity  Security,
rtl_uString **  strDirectory 
)

Get the home directory of the user of this security handle.

Parameters
[in]Securitythe security handle.
[out]strDirectorythe string that receives the directory path on success.
Returns
True, if the security handle is valid, otherwise False.
SAL_DLLPUBLIC sal_Bool osl_getShortUserName ( oslSecurity  Security,
rtl_uString **  strName 
)

Get the login name for the user of this security handle, excluding the domain name on Windows.

Parameters
[in]Securitythe security handle.
[out]strNamethe string that receives the user name on success.
Returns
True, if the security handle is valid, otherwise False.
Since
LibreOffice 5.2
SAL_DLLPUBLIC sal_Bool osl_getUserIdent ( oslSecurity  Security,
rtl_uString **  strIdent 
)

Get the login ident for the user of this security handle.

Parameters
[in]Securitythe security handle.
[out]strIdentthe string that receives the ident on success.
Returns
True, if the security handle is valid, otherwise False.
SAL_DLLPUBLIC sal_Bool osl_getUserName ( oslSecurity  Security,
rtl_uString **  strName 
)

Get the login name for the user of this security handle.

Parameters
[in]Securitythe security handle.
[out]strNamethe string that receives the user name on success.
Returns
True, if the security handle is valid, otherwise False.
SAL_DLLPUBLIC sal_Bool osl_isAdministrator ( oslSecurity  Security)

Query if the user who is denotes by this security has administrator rights.

Parameters
[in]Securitythe security handle for th user.
Returns
True, if the user has administrator rights, otherwise false.
SAL_DLLPUBLIC sal_Bool osl_loadUserProfile ( oslSecurity  Security)

Load Profile of the User Implemented just for Windows.

Parameters
[in]Securitypreviously fetch Security of the User
Returns
True if the Profile could successfully loaded, False otherwise.
SAL_DLLPUBLIC oslSecurityError osl_loginUser ( rtl_uString *  strUserName,
rtl_uString *  strPasswd,
oslSecurity pSecurity 
)

Deprecated API Create a security handle for the denoted user.

Try to log in the user on the local system.

Parameters
[in]strUserNamedenotes the name of the user to log in.
[in]strPasswdthe password for this user.
[out]pSecurityreturns the security handle if user could be logged in.
Returns
osl_Security_E_None if user could be logged in, otherwise an error-code.
See also
osl_freeSecurityHandle
osl_executeProcess
osl_executeApplication
SAL_DLLPUBLIC oslSecurityError osl_loginUserOnFileServer ( rtl_uString *  strUserName,
rtl_uString *  strPasswd,
rtl_uString *  strFileServer,
oslSecurity pSecurity 
)

Create a security handle for the denoted user.

Try to log in the user on the denoted file server. On success the homedir will be the mapped drive on this server.

Parameters
[in]strUserNamedenotes the name of the user to log in.
[in]strPasswdthe password for this user.
[in]strFileServerdenotes the file server on which the user is logged in.
[out]pSecurityreturns the security handle if user could be logged in.
Returns
osl_Security_E_None if user could be logged in, otherwise an error-code.
See also
osl_freeSecurityHandle
osl_executeProcess
osl_executeApplication
SAL_DLLPUBLIC void osl_unloadUserProfile ( oslSecurity  Security)

Unload a User Profile Implemented just for Windows.

Parameters
[in]Securitypreviously fetch Security of the User
Returns
nothing is returned!