You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by as...@apache.org on 2016/11/11 13:20:00 UTC
svn commit: r1769285 -
/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java
Author: asanso
Date: Fri Nov 11 13:19:59 2016
New Revision: 1769285
URL: http://svn.apache.org/viewvc?rev=1769285&view=rev
Log:
SLING-6275 - Unable to impersonate user with surrogate pair character
Modified:
sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java
Modified: sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java?rev=1769285&r1=1769284&r2=1769285&view=diff
==============================================================================
--- sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java (original)
+++ sling/trunk/bundles/auth/core/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java Fri Nov 11 13:19:59 2016
@@ -1218,8 +1218,10 @@ public class SlingAuthenticator implemen
final String owner) {
final String quotedUser;
+ final String quotedOwner;
try {
quotedUser = quoteCookieValue(user);
+ quotedOwner = quoteCookieValue(owner);
} catch (IllegalArgumentException iae) {
log.error(
"sendSudoCookie: Failed to quote value '{}' of cookie {}: {}",
@@ -1237,7 +1239,7 @@ public class SlingAuthenticator implemen
cookie.setMaxAge(maxAge);
cookie.setPath((path == null || path.length() == 0) ? "/" : path);
try {
- cookie.setComment(owner + " impersonates as " + user);
+ cookie.setComment(quotedOwner + " impersonates as " +quotedUser);
} catch (IllegalArgumentException iae) {
// ignore
}