Skip to content

Commit 72cf655

Browse files
author
Dave Wichers
committed
Minor code cleanup to one method in Utils and removal of some commented
out printlns.
1 parent 6928628 commit 72cf655

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/main/java/org/owasp/benchmark/helpers/LDAPManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,20 @@ private boolean search(LDAPPerson person) {
112112

113113
NamingEnumeration<SearchResult> results = ctx.search(base, filter, sc);
114114

115+
boolean foundUser = results.hasMore();
116+
115117
while (results.hasMore()) {
116118
SearchResult sr = (SearchResult) results.next();
117119
Attributes attrs = sr.getAttributes();
118120

119121
Attribute attr = attrs.get("uid");
120122
if (attr != null) {
121-
// logger.debug("record found " + attr.get());
122123
// System.out.println("record found " + attr.get());
123124
}
124125
}
125126
ctx.close();
126127

127-
return true;
128+
return foundUser;
128129
} catch (Exception e) {
129130
System.out.println("LDAP error search: ");
130131
e.printStackTrace();

src/main/java/org/owasp/benchmark/helpers/Utils.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,6 @@ public static void printOSCommandResults(java.lang.Process proc, HttpServletResp
236236

237237
try {
238238
// read the output from the command
239-
// System.out.println("Here is the standard output of the
240-
// command:\n");
241239
out.write("Here is the standard output of the command:<br>");
242240
String s = null;
243241
while ((s = stdInput.readLine()) != null) {
@@ -246,8 +244,6 @@ public static void printOSCommandResults(java.lang.Process proc, HttpServletResp
246244
}
247245

248246
// read any errors from the attempted command
249-
// System.out.println("Here is the standard error of the command (if
250-
// any):\n");
251247
out.write("<br>Here is the std err of the command (if any):<br>");
252248
while ((s = stdError.readLine()) != null) {
253249
out.write(ESAPI.encoder().encodeForHTML(s));

0 commit comments

Comments
 (0)