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 @@
#include <rtl/bootstrap.h>
#include "sockimpl.h"
#include "secimpl.h"
#include "secimpl.hxx"
#define PIPEDEFAULTPATH "/tmp"
#define PIPEALTERNATEPATH "/var/tmp"
......
......@@ -60,7 +60,7 @@
#include "file_url.hxx"
#include "readwrite_helper.hxx"
#include "sockimpl.h"
#include "secimpl.h"
#include "secimpl.hxx"
#define MAX_ARGS 255
#define MAX_ENVS 255
......
......@@ -17,25 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef _OSL_SECURITYIMPL_H_
#define _OSL_SECURITYIMPL_H_
#ifndef INCLUDED_SAL_OSL_UNX_SECIMPL_HXX
#define INCLUDED_SAL_OSL_UNX_SECIMPL_HXX
#include <pwd.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _oslSecurityImpl {
struct passwd m_pPasswd;
char m_buffer[1]; /* should be a C99 flexible array member */
} oslSecurityImpl;
sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax);
#ifdef __cplusplus
}
#endif
bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax);
#endif
......
......@@ -42,7 +42,7 @@
#include <crypt.h>
#endif
#include "secimpl.h"
#include "secimpl.hxx"
#ifdef ANDROID
#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
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_Int32 nChr;
......@@ -235,15 +235,15 @@ sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent,
oslSecurityImpl *pSecImpl = (oslSecurityImpl *)Security;
if (pSecImpl == NULL)
return sal_False;
return false;
nChr = snprintf(buffer, sizeof(buffer), "%u", pSecImpl->m_pPasswd.pw_uid);
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 */
return false; /* leave *pszIdent unmodified in case of failure */
memcpy(pszIdent, buffer, nChr+1);
return sal_True;
return true;
}
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