Kaydet (Commit) d37e9645 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

sal/osl/unx/security.c -> .cxx

Change-Id: If8dbfa3e26a02ac3d5ee0077f730eeca4b59c4d7
üst d059866a
...@@ -164,6 +164,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ ...@@ -164,6 +164,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
sal/osl/unx/process \ sal/osl/unx/process \
sal/osl/unx/process_impl \ sal/osl/unx/process_impl \
sal/osl/unx/profile \ sal/osl/unx/profile \
sal/osl/unx/security \
$(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \
)) ))
$(eval $(call gb_Library_add_cobjects,sal,\ $(eval $(call gb_Library_add_cobjects,sal,\
...@@ -172,7 +173,6 @@ $(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/nlsupport \
sal/osl/unx/pipe \ sal/osl/unx/pipe \
sal/osl/unx/readwrite_helper \ sal/osl/unx/readwrite_helper \
sal/osl/unx/security \
sal/osl/unx/socket \ sal/osl/unx/socket \
sal/osl/unx/system \ sal/osl/unx/system \
sal/osl/unx/tempfile \ sal/osl/unx/tempfile \
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
static oslSecurityError SAL_CALL static oslSecurityError SAL_CALL
osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd, osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd,
oslSecurity* pSecurity); 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_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_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); static sal_Bool SAL_CALL osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax);
...@@ -91,7 +91,7 @@ static oslSecurityImpl * growSecurityImpl( ...@@ -91,7 +91,7 @@ static oslSecurityImpl * growSecurityImpl(
*bufSize = SIZE_MAX - offsetof(oslSecurityImpl, m_buffer); *bufSize = SIZE_MAX - offsetof(oslSecurityImpl, m_buffer);
n = SIZE_MAX; n = SIZE_MAX;
} }
p = realloc(impl, n); p = static_cast<oslSecurityImpl *>(realloc(impl, n));
memset (p, 0, n); memset (p, 0, n);
} }
if (p == NULL) { if (p == NULL) {
...@@ -233,8 +233,8 @@ sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, ...@@ -233,8 +233,8 @@ sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent,
return sal_False; return sal_False;
nChr = snprintf(buffer, sizeof(buffer), "%u", pSecImpl->m_pPasswd.pw_uid); nChr = snprintf(buffer, sizeof(buffer), "%u", pSecImpl->m_pPasswd.pw_uid);
if ( nChr < 0 || SAL_INT_CAST(sal_uInt32, nChr) >= sizeof(buffer) if ( nChr < 0 || sal::static_int_cast<sal_uInt32>(nChr) >= sizeof(buffer)
|| SAL_INT_CAST(sal_uInt32, nChr) >= nMax ) || sal::static_int_cast<sal_uInt32>(nChr) >= nMax )
return sal_False; /* leave *pszIdent unmodified in case of failure */ return sal_False; /* leave *pszIdent unmodified in case of failure */
memcpy(pszIdent, buffer, nChr+1); memcpy(pszIdent, buffer, nChr+1);
...@@ -483,7 +483,7 @@ sal_Bool SAL_CALL osl_isAdministrator(oslSecurity Security) ...@@ -483,7 +483,7 @@ sal_Bool SAL_CALL osl_isAdministrator(oslSecurity Security)
void SAL_CALL osl_freeSecurityHandle(oslSecurity Security) void SAL_CALL osl_freeSecurityHandle(oslSecurity Security)
{ {
deleteSecurityImpl(Security); deleteSecurityImpl(static_cast<oslSecurityImpl *>(Security));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment