Skip to content

Commit 1ecfa2e

Browse files
authored
Merge pull request github#3278 from tausbn/python-fix-warnings
Python: Fix remaining deprecation warnings.
2 parents 1b88c97 + 2fad5e8 commit 1ecfa2e

File tree

2 files changed

+6
-47
lines changed

2 files changed

+6
-47
lines changed

python/ql/src/Resources/FileOpen.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ predicate def_is_open(EssaDefinition def, ControlFlowNode open) {
7979
passes_open_files(refinement)
8080
)
8181
or
82-
exists(PyNodeRefinement refinement | refinement = def |
82+
exists(EssaNodeRefinement refinement | refinement = def |
8383
not closes_file(def) and
8484
not wraps_file(refinement.getDefiningNode(), refinement.getInput()) and
8585
var_is_open(refinement.getInput(), open)

python/ql/src/semmle/python/dataflow/TaintTracking.qll

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,6 @@ abstract class TaintKind extends string {
131131
edgeLabel = "custom taint flow step for " + this
132132
}
133133

134-
/**
135-
* DEPRECATED -- Use `TaintFlow.additionalFlowStepVar(EssaVariable fromvar, EssaVariable tovar, TaintKind kind)` instead.
136-
*
137-
* Holds if this kind of taint passes from variable `fromvar` to variable `tovar`
138-
* This predicate is present for completeness. It is unlikely that any `TaintKind`
139-
* implementation will ever need to override it.
140-
*/
141-
deprecated predicate additionalFlowStepVar(EssaVariable fromvar, EssaVariable tovar) { none() }
142-
143134
/**
144135
* Holds if this kind of taint "taints" `expr`.
145136
*/
@@ -155,7 +146,7 @@ abstract class TaintKind extends string {
155146
* For example, if this were a kind of string taint
156147
* the `result` would be `theStrType()`.
157148
*/
158-
ClassValue getType() { result.(ClassObjectInternal).getSource() = this.getClass() }
149+
ClassValue getType() { none() }
159150

160151
/**
161152
* Gets the boolean values (may be one, neither, or both) that
@@ -180,7 +171,10 @@ abstract class TaintKind extends string {
180171
TaintKind getTaintForIteration() { none() }
181172

182173
predicate flowStep(DataFlow::Node fromnode, DataFlow::Node tonode, string edgeLabel) {
183-
this.additionalFlowStepVar(fromnode.asVariable(), tonode.asVariable()) and
174+
exists(DataFlowExtension::DataFlowVariable v |
175+
v = fromnode.asVariable() and
176+
v.getASuccessorVariable() = tonode.asVariable()
177+
) and
184178
edgeLabel = "custom taint variable step"
185179
}
186180
}
@@ -355,41 +349,6 @@ abstract class Sanitizer extends string {
355349
predicate sanitizingDefinition(TaintKind taint, EssaDefinition def) { none() }
356350
}
357351

358-
/**
359-
* DEPRECATED -- Use DataFlowExtension instead.
360-
* An extension to taint-flow. For adding library or framework specific flows.
361-
* Examples include flow from a request to untrusted part of that request or
362-
* from a socket to data from that socket.
363-
*/
364-
abstract deprecated class TaintFlow extends string {
365-
bindingset[this]
366-
TaintFlow() { any() }
367-
368-
/**
369-
* Holds if `fromnode` being tainted with `fromkind` will result in `tonode` being tainted with `tokind`.
370-
* Extensions to `TaintFlow` should override this to provide additional taint steps.
371-
*/
372-
predicate additionalFlowStep(
373-
ControlFlowNode fromnode, TaintKind fromkind, ControlFlowNode tonode, TaintKind tokind
374-
) {
375-
none()
376-
}
377-
378-
/**
379-
* Holds if the given `kind` of taint passes from variable `fromvar` to variable `tovar`.
380-
* This predicate is present for completeness. Most `TaintFlow` implementations will not need to override it.
381-
*/
382-
predicate additionalFlowStepVar(EssaVariable fromvar, EssaVariable tovar, TaintKind kind) {
383-
none()
384-
}
385-
386-
/**
387-
* Holds if the given `kind` of taint cannot pass from variable `fromvar` to variable `tovar`.
388-
* This predicate is present for completeness. Most `TaintFlow` implementations will not need to override it.
389-
*/
390-
predicate prunedFlowStepVar(EssaVariable fromvar, EssaVariable tovar, TaintKind kind) { none() }
391-
}
392-
393352
/**
394353
* A source of taintedness.
395354
* Users of the taint tracking library should override this

0 commit comments

Comments
 (0)