diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-03-07 21:52:20 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-08 15:35:54 +0000 |
commit | 16fb0d3d0f68708c183c53bd18660a23970b77fe (patch) | |
tree | 8e86df69dcf4ab52368a0a1d767dff62930549fd /sal/osl | |
parent | f9ddda353851b019c2eb8a427ee9f8042f8107b0 (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/osl')
-rw-r--r-- | sal/osl/unx/security.cxx | 7 | ||||
-rw-r--r-- | sal/osl/w32/security.c | 5 |
2 files changed, 11 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; |