aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2023-08-23 09:33:22 +0200
committerAnna Larch <anna@nextcloud.com>2023-08-24 10:39:27 +0200
commit5d5134e61515f69042488e5ab70022b884a4ef5a (patch)
treee5569d1b15490cb63cee2e39fe32711a8aa4bdc9 /apps/user_ldap
parent313a06aeedf2b5a4238ec4ab2a42a452e89deea6 (diff)
downloadnextcloud-server-5d5134e61515f69042488e5ab70022b884a4ef5a.tar.gz
nextcloud-server-5d5134e61515f69042488e5ab70022b884a4ef5a.zip
Do not log passwords in debug mode
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/LDAP.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index 6309a0c8f91..edaf08a7816 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -33,6 +33,7 @@
*/
namespace OCA\User_LDAP;
+use OCP\IConfig;
use OCP\Profiler\IProfiler;
use OC\ServerNotAvailableException;
use OCA\User_LDAP\DataCollector\LdapDataCollector;
@@ -317,6 +318,14 @@ class LDAP implements ILDAPWrapper {
private function preFunctionCall(string $functionName, array $args): void {
$this->curArgs = $args;
+ if(strcasecmp($functionName, 'ldap_bind') === 0) {
+ // The arguments are not key value pairs
+ // \OCA\User_LDAP\LDAP::bind passes 3 arguments, the 3rd being the pw
+ // Remove it via direct array access for now, although a better solution could be found mebbe?
+ // @link https://github.com/nextcloud/server/issues/38461
+ $args[2] = IConfig::SENSITIVE_VALUE;
+ }
+
$this->logger->debug('Calling LDAP function {func} with parameters {args}', [
'app' => 'user_ldap',
'func' => $functionName,