summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-09-05 19:09:16 +0200
committerGitHub <noreply@github.com>2023-09-05 19:09:16 +0200
commitf756d8f70a4a33a8ed6f5a0f7031f4461216efc1 (patch)
tree16e244fcc750c094a81f110ccbece39f70061373
parent1c29d87f487c7cc83bbd79690b3529a2cd865120 (diff)
parent91e081b064a68fba7151dc30e133bcc48132ef3d (diff)
downloadnextcloud-server-f756d8f70a4a33a8ed6f5a0f7031f4461216efc1.tar.gz
nextcloud-server-f756d8f70a4a33a8ed6f5a0f7031f4461216efc1.zip
Merge pull request #40076 from nextcloud/fix/stable26/remove-pw-from-logging
[stable26] Do not log passwords in debug mode
-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 41a6f651f3b..454350ba095 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,