LibreOffice LibreOffice 7.2 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/*
21 * This file is part of LibreOffice published API.
22 */
23
24#ifndef INCLUDED_OSL_SECURITY_H
25#define INCLUDED_OSL_SECURITY_H
26
27#include "sal/config.h"
28
29#include "rtl/ustring.h"
30#include "sal/saldllapi.h"
31
32#ifdef __cplusplus
33 extern "C" {
34#endif
35
36 typedef enum {
37 osl_Security_E_None,
38 osl_Security_E_UserUnknown,
39 osl_Security_E_WrongPassword,
40 osl_Security_E_Unknown,
41 osl_Security_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
42} oslSecurityError;
43
49 typedef void* oslSecurity;
50
57 SAL_DLLPUBLIC oslSecurity SAL_CALL osl_getCurrentSecurity(void);
58
70 SAL_DLLPUBLIC oslSecurityError SAL_CALL osl_loginUser(
71 rtl_uString *strUserName,
72 rtl_uString *strPasswd,
73 oslSecurity *pSecurity
74 );
75
88 SAL_DLLPUBLIC oslSecurityError SAL_CALL osl_loginUserOnFileServer(
89 rtl_uString *strUserName,
90 rtl_uString *strPasswd,
91 rtl_uString *strFileServer,
92 oslSecurity *pSecurity
93 );
94
99 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_isAdministrator(
100 oslSecurity Security);
101
106 SAL_DLLPUBLIC void SAL_CALL osl_freeSecurityHandle(
107 oslSecurity Security);
108
114 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getUserIdent(
115 oslSecurity Security, rtl_uString **strIdent);
116
122 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getUserName(
123 oslSecurity Security, rtl_uString **strName);
124
132 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getShortUserName(
133 oslSecurity Security, rtl_uString **strName);
134
140 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getHomeDir(
141 oslSecurity Security, rtl_uString **strDirectory);
142
148 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_getConfigDir(
149 oslSecurity Security, rtl_uString **strDirectory);
150
151
158 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_loadUserProfile(
159 oslSecurity Security);
160
161
168 SAL_DLLPUBLIC void SAL_CALL osl_unloadUserProfile(
169 oslSecurity Security);
170
171#ifdef __cplusplus
172}
173#endif
174
175#endif // INCLUDED_OSL_SECURITY_H
176
177/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
saldllapi.h
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition: saldllapi.h:34
SAL_MAX_ENUM
#define SAL_MAX_ENUM
Definition: types.h:205
sal_Bool
unsigned char sal_Bool
Definition: types.h:38
config.h
ustring.h
osl_unloadUserProfile
SAL_DLLPUBLIC void osl_unloadUserProfile(oslSecurity Security)
Unload a User Profile Implemented just for Windows.
oslSecurityError
oslSecurityError
Definition: security.h:36
osl_Security_E_UserUnknown
@ osl_Security_E_UserUnknown
Definition: security.h:38
osl_Security_E_Unknown
@ osl_Security_E_Unknown
Definition: security.h:40
osl_Security_E_WrongPassword
@ osl_Security_E_WrongPassword
Definition: security.h:39
osl_Security_E_FORCE_EQUAL_SIZE
@ osl_Security_E_FORCE_EQUAL_SIZE
Definition: security.h:41
osl_Security_E_None
@ osl_Security_E_None
Definition: security.h:37
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_getUserName
SAL_DLLPUBLIC sal_Bool osl_getUserName(oslSecurity Security, rtl_uString **strName)
Get the login name for the user of this security handle.
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_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_isAdministrator
SAL_DLLPUBLIC sal_Bool osl_isAdministrator(oslSecurity Security)
Query if the user who is denotes by this security has administrator rights.
osl_freeSecurityHandle
SAL_DLLPUBLIC void osl_freeSecurityHandle(oslSecurity Security)
Free the security handle, created by osl_loginUser or osl_getCurrentSecurity.
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_getCurrentSecurity
SAL_DLLPUBLIC oslSecurity osl_getCurrentSecurity(void)
Create a security handle for the current user.
osl_loadUserProfile
SAL_DLLPUBLIC sal_Bool osl_loadUserProfile(oslSecurity Security)
Load Profile of the User Implemented just for Windows.
osl_getUserIdent
SAL_DLLPUBLIC sal_Bool osl_getUserIdent(oslSecurity Security, rtl_uString **strIdent)
Get the login ident for the user of this security handle.
oslSecurity
void * oslSecurity
Process handle.
Definition: security.h:49
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.