LibreOffice LibreOffice 7.2 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

## ◆ oslSecurity

typedef void* oslSecurity

Process handle.

See also
  osl_loginUser
  osl_freeSecurityHandle
  osl_executeProcess

## Enumeration Type Documentation

## ◆ oslSecurityError

enum oslSecurityError

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

## ◆ osl_freeSecurityHandle()

SAL_DLLPUBLIC void osl_freeSecurityHandle | ( | oslSecurity | Security | ) |

Free the security handle, created by osl_loginUser or osl_getCurrentSecurity.

Parameters

  [in] | Security | the security handle.

See also
  osl_loginUser

## ◆ osl_getConfigDir()

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] | Security | the security handle.
  [out] | strDirectory | the string that receives the directory path on success.

Returns
  True, if the security handle is valid, otherwise False.

## ◆ osl_getCurrentSecurity()

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

## ◆ osl_getHomeDir()

SAL_DLLPUBLIC sal_Bool osl_getHomeDir | ( | oslSecurity | Security,
|  | rtl_uString ** | strDirectory
| ) |  |

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

Parameters

  [in] | Security | the security handle.
  [out] | strDirectory | the string that receives the directory path on success.

Returns
  True, if the security handle is valid, otherwise False.

## ◆ osl_getShortUserName()

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] | Security | the security handle.
  [out] | strName | the string that receives the user name on success.

Returns
  True, if the security handle is valid, otherwise False.

Since
  LibreOffice 5.2

## ◆ osl_getUserIdent()

SAL_DLLPUBLIC sal_Bool osl_getUserIdent | ( | oslSecurity | Security,
|  | rtl_uString ** | strIdent
| ) |  |

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

Parameters

  [in] | Security | the security handle.
  [out] | strIdent | the string that receives the ident on success.

Returns
  True, if the security handle is valid, otherwise False.

## ◆ osl_getUserName()

SAL_DLLPUBLIC sal_Bool osl_getUserName | ( | oslSecurity | Security,
|  | rtl_uString ** | strName
| ) |  |

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

Parameters

  [in] | Security | the security handle.
  [out] | strName | the string that receives the user name on success.

Returns
  True, if the security handle is valid, otherwise False.

## ◆ osl_isAdministrator()

SAL_DLLPUBLIC sal_Bool osl_isAdministrator | ( | oslSecurity | Security | ) |

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

Parameters

  [in] | Security | the security handle for th user.

Returns
  True, if the user has administrator rights, otherwise false.

## ◆ osl_loadUserProfile()

SAL_DLLPUBLIC sal_Bool osl_loadUserProfile | ( | oslSecurity | Security | ) |

Load Profile of the User Implemented just for Windows.

Parameters

  [in] | Security | previously fetch Security of the User

Returns
  True if the Profile could successfully loaded, False otherwise.

## ◆ osl_loginUser()

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] | strUserName | denotes the name of the user to log in.
  [in] | strPasswd | the password for this user.
  [out] | pSecurity | returns 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

## ◆ osl_loginUserOnFileServer()

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] | strUserName | denotes the name of the user to log in.
  [in] | strPasswd | the password for this user.
  [in] | strFileServer | denotes the file server on which the user is logged in.
  [out] | pSecurity | returns 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

## ◆ osl_unloadUserProfile()

SAL_DLLPUBLIC void osl_unloadUserProfile | ( | oslSecurity | Security | ) |

Unload a User Profile Implemented just for Windows.

Parameters

  [in] | Security | previously fetch Security of the User

Returns
  nothing is returned!