summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2023-08-23 09:33:22 +0200
committerAnna <anna@nextcloud.com>2023-08-24 13:03:37 +0200
commit1e6e722703911b71a11d1e4cfdbd7048b340b46d (patch)
treec749f4a0034beb3b5e82c06afc9cb9f7098ab57a /apps
parent480d2c2fd08d3cf52f46f3132a0596580820f4c3 (diff)
downloadnextcloud-server-1e6e722703911b71a11d1e4cfdbd7048b340b46d.tar.gz
nextcloud-server-1e6e722703911b71a11d1e4cfdbd7048b340b46d.zip
Do not log passwords in debug mode
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps')
-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,