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

secimpl.h -> secimpl.hxx

Change-Id: I0fb87c5658bd02e327df8fdf3e0aa79f20bbc111
üst 299a8a50
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <rtl/bootstrap.h> #include <rtl/bootstrap.h>
#include "sockimpl.h" #include "sockimpl.h"
#include "secimpl.h" #include "secimpl.hxx"
#define PIPEDEFAULTPATH "/tmp" #define PIPEDEFAULTPATH "/tmp"
#define PIPEALTERNATEPATH "/var/tmp" #define PIPEALTERNATEPATH "/var/tmp"
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#include "file_url.hxx" #include "file_url.hxx"
#include "readwrite_helper.hxx" #include "readwrite_helper.hxx"
#include "sockimpl.h" #include "sockimpl.h"
#include "secimpl.h" #include "secimpl.hxx"
#define MAX_ARGS 255 #define MAX_ARGS 255
#define MAX_ENVS 255 #define MAX_ENVS 255
......
...@@ -17,25 +17,17 @@ ...@@ -17,25 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#ifndef _OSL_SECURITYIMPL_H_ #ifndef INCLUDED_SAL_OSL_UNX_SECIMPL_HXX
#define _OSL_SECURITYIMPL_H_ #define INCLUDED_SAL_OSL_UNX_SECIMPL_HXX
#include <pwd.h> #include <pwd.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _oslSecurityImpl { typedef struct _oslSecurityImpl {
struct passwd m_pPasswd; struct passwd m_pPasswd;
char m_buffer[1]; /* should be a C99 flexible array member */ char m_buffer[1]; /* should be a C99 flexible array member */
} oslSecurityImpl; } oslSecurityImpl;
sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax); bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax);
#ifdef __cplusplus
}
#endif
#endif #endif
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#include <crypt.h> #include <crypt.h>
#endif #endif
#include "secimpl.h" #include "secimpl.hxx"
#ifdef ANDROID #ifdef ANDROID
#define getpwuid_r(uid, pwd, buf, buflen, result) (*(result) = getpwuid(uid), (*(result) ? (memcpy (buf, *(result), sizeof (struct passwd)), 0) : errno)) #define getpwuid_r(uid, pwd, buf, buflen, result) (*(result) = getpwuid(uid), (*(result) ? (memcpy (buf, *(result), sizeof (struct passwd)), 0) : errno))
...@@ -227,7 +227,7 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **ustrIdent ...@@ -227,7 +227,7 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **ustrIdent
return bRet; return bRet;
} }
sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax) bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax)
{ {
sal_Char buffer[32]; sal_Char buffer[32];
sal_Int32 nChr; sal_Int32 nChr;
...@@ -235,15 +235,15 @@ sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, ...@@ -235,15 +235,15 @@ sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent,
oslSecurityImpl *pSecImpl = (oslSecurityImpl *)Security; oslSecurityImpl *pSecImpl = (oslSecurityImpl *)Security;
if (pSecImpl == NULL) if (pSecImpl == NULL)
return sal_False; return 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::static_int_cast<sal_uInt32>(nChr) >= sizeof(buffer) if ( nChr < 0 || sal::static_int_cast<sal_uInt32>(nChr) >= sizeof(buffer)
|| sal::static_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 false; /* leave *pszIdent unmodified in case of failure */
memcpy(pszIdent, buffer, nChr+1); memcpy(pszIdent, buffer, nChr+1);
return sal_True; return true;
} }
sal_Bool SAL_CALL osl_getUserName(oslSecurity Security, rtl_uString **ustrName) sal_Bool SAL_CALL osl_getUserName(oslSecurity Security, rtl_uString **ustrName)
......
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