Skip to content

Commit e467a49

Browse files
Vladimir Kotalahornace
authored andcommitted
log the correct user instance
1 parent f1a866e commit e467a49

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

plugins/src/main/java/opengrok/auth/plugin/LdapAttrPlugin.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ public void fillSession(HttpServletRequest req, User user) {
135135

136136
if ((ldapUser = (LdapUser) req.getSession().
137137
getAttribute(LdapUserPlugin.getSessionAttrName(ldapUserInstance))) == null) {
138-
LOGGER.log(Level.WARNING, "cannot get {0} attribute", LdapUserPlugin.SESSION_ATTR);
138+
LOGGER.log(Level.WARNING, "cannot get {0} attribute from {1}",
139+
new Object[]{LdapUserPlugin.SESSION_ATTR, user});
139140
return;
140141
}
141142

@@ -152,22 +153,22 @@ public void fillSession(HttpServletRequest req, User user) {
152153
AbstractLdapProvider.LdapSearchResult<Map<String, Set<String>>> res;
153154
if ((res = ldapProvider.lookupLdapContent(dn, new String[]{ldapAttr})) == null) {
154155
LOGGER.log(Level.WARNING, "cannot lookup attributes {0} for user {1} on {2})",
155-
new Object[]{ldapAttr, user, ldapProvider});
156+
new Object[]{ldapAttr, ldapUser, ldapProvider});
156157
return;
157158
}
158159

159160
records = res.getAttrs();
160161
} else {
161162
LOGGER.log(Level.FINE, "no DN for user {0} on {1}",
162-
new Object[]{user, ldapProvider});
163+
new Object[]{ldapUser, ldapProvider});
163164
}
164165
} catch (LdapException ex) {
165166
throw new AuthorizationException(ex);
166167
}
167168

168169
if (records == null || records.isEmpty() || (attributeValues = records.get(ldapAttr)) == null) {
169170
LOGGER.log(Level.WARNING, "empty records or attribute values {0} for user {1} on {2}",
170-
new Object[]{ldapAttr, user, ldapProvider});
171+
new Object[]{ldapAttr, ldapUser, ldapProvider});
171172
return;
172173
}
173174

0 commit comments

Comments
 (0)