Skip to content

Commit 1e6e722

Browse files
committed
Do not log passwords in debug mode
Signed-off-by: Anna Larch <[email protected]>
1 parent 480d2c2 commit 1e6e722

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/user_ldap/lib/LDAP.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
*/
3434
namespace OCA\User_LDAP;
3535

36+
use OCP\IConfig;
3637
use OCP\Profiler\IProfiler;
3738
use OC\ServerNotAvailableException;
3839
use OCA\User_LDAP\DataCollector\LdapDataCollector;
@@ -317,6 +318,14 @@ protected function invokeLDAPMethod(string $func, ...$arguments) {
317318

318319
private function preFunctionCall(string $functionName, array $args): void {
319320
$this->curArgs = $args;
321+
if(strcasecmp($functionName, 'ldap_bind') === 0) {
322+
// The arguments are not key value pairs
323+
// \OCA\User_LDAP\LDAP::bind passes 3 arguments, the 3rd being the pw
324+
// Remove it via direct array access for now, although a better solution could be found mebbe?
325+
// @link https://github.com/nextcloud/server/issues/38461
326+
$args[2] = IConfig::SENSITIVE_VALUE;
327+
}
328+
320329
$this->logger->debug('Calling LDAP function {func} with parameters {args}', [
321330
'app' => 'user_ldap',
322331
'func' => $functionName,

0 commit comments

Comments
 (0)