summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-03-07 21:52:20 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-03-08 15:35:54 +0000
commit16fb0d3d0f68708c183c53bd18660a23970b77fe (patch)
tree8e86df69dcf4ab52368a0a1d767dff62930549fd /sal
parentf9ddda353851b019c2eb8a427ee9f8042f8107b0 (diff)
tdf#98407 PathSubstitution: Add substitution for $(username)
This allows to use the username as a placeholder in the config paths (Autotext, Gallery, etc) Change-Id: I76434e980cd8ec8785a5587d0bc5fdd67dc42de2 Reviewed-on: https://gerrit.libreoffice.org/22901 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/security.cxx7
-rw-r--r--sal/osl/w32/security.c5
-rw-r--r--sal/util/sal.map5
3 files changed, 16 insertions, 1 deletions
diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx
index 16a5f74cba36..c4d9d29fa405 100644
--- a/sal/osl/unx/security.cxx
+++ b/sal/osl/unx/security.cxx
@@ -66,7 +66,7 @@ static bool sysconf_SC_GETPW_R_SIZE_MAX(std::size_t * value) {
way and always set EINVAL, so be resilient here: */
return false;
} else {
- SAL_WARN_IF( m < 0 || (unsigned long) m >= std::numeric_limits<std::size_t>::max(), "sal.osl",
+ SAL_WARN_IF( m < 0 || (unsigned long) m >= std::numeric_limits<std::size_t>::max(), "sal.osl",
"m < 0 || (unsigned long) m >= std::numeric_limits<std::size_t>::max()");
*value = (std::size_t) m;
return true;
@@ -261,6 +261,11 @@ sal_Bool SAL_CALL osl_getUserName(oslSecurity Security, rtl_uString **ustrName)
return bRet;
}
+sal_Bool SAL_CALL osl_getShortUserName(oslSecurity Security, rtl_uString **ustrName)
+{
+ return osl_getUserName(Security, ustrName); // No domain name on unix
+}
+
static bool SAL_CALL osl_psz_getUserName(oslSecurity Security, sal_Char* pszName, sal_uInt32 nMax)
{
oslSecurityImpl *pSecImpl = static_cast<oslSecurityImpl *>(Security);
diff --git a/sal/osl/w32/security.c b/sal/osl/w32/security.c
index da13ce64665c..1d31eeffd9ba 100644
--- a/sal/osl/w32/security.c
+++ b/sal/osl/w32/security.c
@@ -424,6 +424,11 @@ sal_Bool SAL_CALL osl_getUserName(oslSecurity Security, rtl_uString **strName)
return getUserNameImpl(Security, strName, sal_True);
}
+sal_Bool SAL_CALL osl_getShortUserName(oslSecurity Security, rtl_uString **strName)
+{
+ return getUserNameImpl(Security, strName, sal_False);
+}
+
sal_Bool SAL_CALL osl_getHomeDir(oslSecurity Security, rtl_uString **pustrDirectory)
{
rtl_uString *ustrSysDir = NULL;
diff --git a/sal/util/sal.map b/sal/util/sal.map
index e3f920c7e33c..1ccac615b67f 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -690,6 +690,11 @@ LIBO_UDK_5.1 { # symbols available in >= LibO 5.1
rtl_uString_newReplaceFirstToAsciiL;
} LIBO_UDK_5.0;
+LIBO_UDK_5.2 { # symbols available in >= LibO 5.2
+ global:
+ osl_getShortUserName;
+} LIBO_UDK_5.1;
+
PRIVATE_1.0 {
global:
osl_detail_ObjectRegistry_storeAddresses;