Skip to content

Commit 45f0bfd

Browse files
yoffRasmusWL
andauthored
Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
1 parent 68d18ea commit 45f0bfd

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

python/ql/lib/semmle/python/frameworks/Ldap.qll

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,17 @@ private import semmle.python.ApiGraphs
1515
*/
1616
private module Ldap {
1717
/**
18-
* The name of an `ldap` method used to execute a query.
18+
* The execution of an `ldap` query.
1919
*
2020
* See https://www.python-ldap.org/en/python-ldap-3.3.0/reference/ldap.html#functions
2121
*/
22-
private string ldapQueryMethodName() {
23-
result in ["search", "search_s", "search_st", "search_ext", "search_ext_s"]
24-
}
25-
26-
/** The execution of an `ldap` query. */
2722
private class LdapQueryExecution extends DataFlow::CallCfgNode, LdapExecution::Range {
2823
LdapQueryExecution() {
2924
this =
3025
API::moduleImport("ldap")
3126
.getMember("initialize")
3227
.getReturn()
33-
.getMember(ldapQueryMethodName())
28+
.getMember(["search", "search_s", "search_st", "search_ext", "search_ext_s"])
3429
.getACall()
3530
}
3631

@@ -42,7 +37,7 @@ private module Ldap {
4237
}
4338

4439
/**
45-
* A class to find calls to `ldap.dn.escape_dn_chars`.
40+
* A call to `ldap.dn.escape_dn_chars`.
4641
*
4742
* See https://github.com/python-ldap/python-ldap/blob/7ce471e238cdd9a4dd8d17baccd1c9e05e6f894a/Lib/ldap/dn.py#L17
4843
*/
@@ -59,7 +54,7 @@ private module Ldap {
5954
}
6055

6156
/**
62-
* A class to find calls to `ldap.filter.escape_filter_chars`.
57+
* A call to `ldap.filter.escape_filter_chars`.
6358
*
6459
* See https://www.python-ldap.org/en/python-ldap-3.3.0/reference/ldap-filter.html#ldap.filter.escape_filter_chars
6560
*/

python/ql/lib/semmle/python/frameworks/Ldap3.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private module Ldap3 {
3535
}
3636

3737
/**
38-
* A class to find calls to `ldap3.utils.dn.escape_rdn`.
38+
* A call to `ldap3.utils.dn.escape_rdn`.
3939
*
4040
* See https://github.com/cannatag/ldap3/blob/4d33166f0869b929f59c6e6825a1b9505eb99967/ldap3/utils/dn.py#L390
4141
*/
@@ -57,7 +57,7 @@ private module Ldap3 {
5757
}
5858

5959
/**
60-
* A class to find calls to `ldap3.utils.conv.escape_filter_chars`.
60+
* A call to `ldap3.utils.conv.escape_filter_chars`.
6161
*
6262
* See https://github.com/cannatag/ldap3/blob/4d33166f0869b929f59c6e6825a1b9505eb99967/ldap3/utils/conv.py#L91
6363
*/

0 commit comments

Comments
 (0)