LibreOffice: osl/security.h Source File

LibreOffice LibreOffice 6.0 SDK C/C++ API Reference

security.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20 #ifndef INCLUDED_OSL_SECURITY_H
21 #define INCLUDED_OSL_SECURITY_H
22
23 #include "sal/config.h"
24
25 #include "rtl/ustring.h"
26 #include "sal/saldllapi.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 typedef enum {
33 osl_Security_E_None,
34 osl_Security_E_UserUnknown,
35 osl_Security_E_WrongPassword,
36 osl_Security_E_Unknown,
37 osl_Security_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
38 } oslSecurityError;
39
45 typedef void* oslSecurity;
46
53 SAL_DLLPUBLIC oslSecurity SAL_CALL osl_getCurrentSecurity(void);
54
66 SAL_DLLPUBLIC oslSecurityError SAL_CALL osl_loginUser(
67 rtl_uString *strUserName,
68 rtl_uString *strPasswd,
69 oslSecurity *pSecurity
70 );
71
84 SAL_DLLPUBLIC oslSecurityError SAL_CALL osl_loginUserOnFileServer(
85 rtl_uString *strUserName,
86 rtl_uString *strPasswd,
87 rtl_uString *strFileServer,
88 oslSecurity *pSecurity
89 );
90
95 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isAdministrator(
96 oslSecurity Security);
97
102 SAL_DLLPUBLIC void SAL_CALL osl_freeSecurityHandle(
103 oslSecurity Security);
104
110 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getUserIdent(
111 oslSecurity Security, rtl_uString **strIdent);
112
118 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getUserName(
119 oslSecurity Security, rtl_uString **strName);
120
128 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getShortUserName(
129 oslSecurity Security, rtl_uString **strName);
130
136 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getHomeDir(
137 oslSecurity Security, rtl_uString **strDirectory);
138
144 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getConfigDir(
145 oslSecurity Security, rtl_uString **strDirectory);
146
147
154 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_loadUserProfile(
155 oslSecurity Security);
156
157
164 SAL_DLLPUBLIC void SAL_CALL osl_unloadUserProfile(
165 oslSecurity Security);
166
167 #ifdef __cplusplus
168 }
169 #endif
170
171 #endif // INCLUDED_OSL_SECURITY_H
172
173 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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...
osl_Security_E_WrongPassword
Definition: security.h:35
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.
osl_Security_E_FORCE_EQUAL_SIZE
Definition: security.h:37
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
oslSecurity
void * oslSecurity
Process handle.
Definition: security.h:45
osl_getUserIdent
SAL_DLLPUBLIC sal_Bool osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent)
Get the login ident for the user of this security handle.
osl_getCurrentSecurity
SAL_DLLPUBLIC oslSecurity osl_getCurrentSecurity(void)
Create a security handle for the current user.
oslSecurityError
oslSecurityError
Definition: security.h:32
sal_Bool
unsigned char sal_Bool
Definition: types.h:39
saldllapi.h
ustring.h
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.
osl_isAdministrator
SAL_DLLPUBLIC sal_Bool osl_isAdministrator(oslSecurity Security)
Query if the user who is denotes by this security has administrator rights.
osl_Security_E_Unknown
Definition: security.h:36
osl_loadUserProfile
SAL_DLLPUBLIC sal_Bool osl_loadUserProfile(oslSecurity Security)
Load Profile of the User Implemented just for Windows.
osl_freeSecurityHandle
SAL_DLLPUBLIC void osl_freeSecurityHandle(oslSecurity Security)
Free the security handle, created by osl_loginUser or osl_getCurrentSecurity.
config.h
osl_getHomeDir
SAL_DLLPUBLIC sal_Bool osl_getHomeDir(oslSecurity Security, rtl_uString **strDirectory)
Get the home directory of the user of this security handle.
osl_Security_E_UserUnknown
Definition: security.h:34
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.
osl_getUserName
SAL_DLLPUBLIC sal_Bool osl_getUserName(oslSecurity Security, rtl_uString **strName)
Get the login name for the user of this security handle.
SAL_MAX_ENUM
#define SAL_MAX_ENUM
Definition: types.h:228
osl_unloadUserProfile
SAL_DLLPUBLIC void osl_unloadUserProfile(oslSecurity Security)
Unload a User Profile Implemented just for Windows.
osl_Security_E_None
Definition: security.h:33