mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Merge pull request #40013 from nextcloud/fix/remove-pw-from-logging
Do not log passwords in debug mode
This commit is contained in:
commit
dce0db8d69
1 changed files with 9 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue