public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 access-control] fix #5136: ldap: Decode non-ASCII characters in attributes
@ 2024-01-09 13:35 Filip Schauer
  2024-01-09 13:38 ` Fiona Ebner
  2024-02-28 14:41 ` Thomas Lamprecht
  0 siblings, 2 replies; 6+ messages in thread
From: Filip Schauer @ 2024-01-09 13:35 UTC (permalink / raw)
  To: pve-devel

UTF8 decode non-ASCII characters when syncing user attributes, since
those will be encoded later on. Without this fix the attributes were
encoded twice, resulting in cases such as 'ü' turning into 'ü'.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
Changes since v1:
* Do not try to URI unescape the user attributes, since we do that later
  in PVE::AccessControl::parse_user_config anyways.

 src/PVE/Auth/LDAP.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Auth/LDAP.pm b/src/PVE/Auth/LDAP.pm
index b958f2b..06177db 100755
--- a/src/PVE/Auth/LDAP.pm
+++ b/src/PVE/Auth/LDAP.pm
@@ -301,7 +301,7 @@ sub get_users {
 
 	foreach my $attr (keys %$user_attributes) {
 	    if (my $ours = $ldap_attribute_map->{$attr}) {
-		$ret->{$username}->{$ours} = $user_attributes->{$attr}->[0];
+		$ret->{$username}->{$ours} = Encode::decode('utf8', $user_attributes->{$attr}->[0]);
 	    }
 	}
 
-- 
2.39.2





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-28 18:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 13:35 [pve-devel] [PATCH v2 access-control] fix #5136: ldap: Decode non-ASCII characters in attributes Filip Schauer
2024-01-09 13:38 ` Fiona Ebner
2024-01-09 13:51   ` Filip Schauer
2024-02-28 14:41 ` Thomas Lamprecht
2024-02-28 15:00   ` Fiona Ebner
2024-02-28 18:58     ` Stoiko Ivanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal