summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-04-02 10:36:04 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-04-02 10:43:21 +0200
commitd37e9645edbdabaaf16ce0f1f904405f3477dc41 (patch)
tree4c718dcb0732dab7e434aafd67affa6e224d20ef /sal
parentd059866a38ca555050abea1554ceaf7da98edfac (diff)
sal/osl/unx/security.c -> .cxx
Change-Id: If8dbfa3e26a02ac3d5ee0077f730eeca4b59c4d7
Diffstat (limited to 'sal')
-rw-r--r--sal/Library_sal.mk2
-rw-r--r--sal/osl/unx/security.cxx (renamed from sal/osl/unx/security.c)10
2 files changed, 6 insertions, 6 deletions
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index ec8d89b95119..2103fe830266 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -164,6 +164,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
sal/osl/unx/process \
sal/osl/unx/process_impl \
sal/osl/unx/profile \
+ sal/osl/unx/security \
$(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \
))
$(eval $(call gb_Library_add_cobjects,sal,\
@@ -172,7 +173,6 @@ $(eval $(call gb_Library_add_cobjects,sal,\
sal/osl/unx/nlsupport \
sal/osl/unx/pipe \
sal/osl/unx/readwrite_helper \
- sal/osl/unx/security \
sal/osl/unx/socket \
sal/osl/unx/system \
sal/osl/unx/tempfile \
diff --git a/sal/osl/unx/security.c b/sal/osl/unx/security.cxx
index 3806a0f96b2d..77764b5caed5 100644
--- a/sal/osl/unx/security.c
+++ b/sal/osl/unx/security.cxx
@@ -43,7 +43,7 @@
static oslSecurityError SAL_CALL
osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd,
oslSecurity* pSecurity);
-sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax);
+extern "C" sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax);
static sal_Bool SAL_CALL osl_psz_getUserName(oslSecurity Security, sal_Char* pszName, sal_uInt32 nMax);
static sal_Bool SAL_CALL osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax);
static sal_Bool SAL_CALL osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax);
@@ -91,7 +91,7 @@ static oslSecurityImpl * growSecurityImpl(
*bufSize = SIZE_MAX - offsetof(oslSecurityImpl, m_buffer);
n = SIZE_MAX;
}
- p = realloc(impl, n);
+ p = static_cast<oslSecurityImpl *>(realloc(impl, n));
memset (p, 0, n);
}
if (p == NULL) {
@@ -233,8 +233,8 @@ sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent,
return sal_False;
nChr = snprintf(buffer, sizeof(buffer), "%u", pSecImpl->m_pPasswd.pw_uid);
- if ( nChr < 0 || SAL_INT_CAST(sal_uInt32, nChr) >= sizeof(buffer)
- || SAL_INT_CAST(sal_uInt32, nChr) >= nMax )
+ if ( nChr < 0 || sal::static_int_cast<sal_uInt32>(nChr) >= sizeof(buffer)
+ || sal::static_int_cast<sal_uInt32>(nChr) >= nMax )
return sal_False; /* leave *pszIdent unmodified in case of failure */
memcpy(pszIdent, buffer, nChr+1);
@@ -483,7 +483,7 @@ sal_Bool SAL_CALL osl_isAdministrator(oslSecurity Security)
void SAL_CALL osl_freeSecurityHandle(oslSecurity Security)
{
- deleteSecurityImpl(Security);
+ deleteSecurityImpl(static_cast<oslSecurityImpl *>(Security));
}