diff --git a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/exercise4.ql b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/exercise4.ql index 993265105d5..09c01b953e3 100644 --- a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/exercise4.ql +++ b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/exercise4.ql @@ -2,7 +2,7 @@ import cpp import semmle.code.cpp.dataflow.new.DataFlow class GetenvSource extends DataFlow::Node { - GetenvSource() { this.asIndirectExpr(1).(FunctionCall).getTarget().hasQualifiedName("getenv") } + GetenvSource() { this.asIndirectExpr(1).(FunctionCall).getTarget().hasGlobalName("getenv") } } class GetenvToGethostbynameConfiguration extends DataFlow::Configuration { diff --git a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-expr.ql b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-expr.ql index d85f68e27b9..9f552574972 100644 --- a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-expr.ql +++ b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-expr.ql @@ -3,7 +3,7 @@ import semmle.code.cpp.dataflow.new.DataFlow from Function fopen, FunctionCall fc, Expr src, DataFlow::Node source, DataFlow::Node sink where - fopen.hasQualifiedName("fopen") and + fopen.hasGlobalName("fopen") and fc.getTarget() = fopen and source.asIndirectExpr(1) = src and sink.asIndirectExpr(1) = fc.getArgument(0) and diff --git a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-getenv.ql b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-getenv.ql index 34038df7a65..d21ae4ae52e 100644 --- a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-getenv.ql +++ b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-getenv.ql @@ -7,14 +7,14 @@ class EnvironmentToFileConfiguration extends DataFlow::Configuration { override predicate isSource(DataFlow::Node source) { exists(Function getenv | source.asIndirectExpr(1).(FunctionCall).getTarget() = getenv and - getenv.hasQualifiedName("getenv") + getenv.hasGlobalName("getenv") ) } override predicate isSink(DataFlow::Node sink) { exists(FunctionCall fc | sink.asIndirectExpr(1) = fc.getArgument(0) and - fc.getTarget().hasQualifiedName("fopen") + fc.getTarget().hasGlobalName("fopen") ) } } diff --git a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-param.ql b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-param.ql index d24d65cd288..423645ae0a9 100644 --- a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-param.ql +++ b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-flow-from-param.ql @@ -3,7 +3,7 @@ import semmle.code.cpp.dataflow.new.DataFlow from Function fopen, FunctionCall fc, Parameter p, DataFlow::Node source, DataFlow::Node sink where - fopen.hasQualifiedName("fopen") and + fopen.hasGlobalName("fopen") and fc.getTarget() = fopen and source.asParameter(1) = p and sink.asIndirectExpr(1) = fc.getArgument(0) and diff --git a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-no-flow.ql b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-no-flow.ql index 0bcacf403d8..48c124352b7 100644 --- a/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-no-flow.ql +++ b/cpp/ql/test/examples/docs-examples/analyzing-data-flow-in-cpp/fopen-no-flow.ql @@ -2,6 +2,6 @@ import cpp from Function fopen, FunctionCall fc where - fopen.hasQualifiedName("fopen") and + fopen.hasGlobalName("fopen") and fc.getTarget() = fopen select fc.getArgument(0) diff --git a/docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp-new.rst b/docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp-new.rst index d3938f1b5dc..0b823d701df 100644 --- a/docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp-new.rst +++ b/docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp-new.rst @@ -97,7 +97,7 @@ The following query finds the filename passed to ``fopen``. from Function fopen, FunctionCall fc where - fopen.hasQualifiedName("fopen") and + fopen.hasGlobalName("fopen") and fc.getTarget() = fopen select fc.getArgument(0) @@ -110,7 +110,7 @@ Unfortunately, this will only give the expression in the argument, not the value from Function fopen, FunctionCall fc, Expr src, DataFlow::Node source, DataFlow::Node sink where - fopen.hasQualifiedName("fopen") and + fopen.hasGlobalName("fopen") and fc.getTarget() = fopen and source.asIndirectExpr(1) = src and sink.asIndirectExpr(1) = fc.getArgument(0) and @@ -126,7 +126,7 @@ Then we can vary the source and, for example, use the parameter of a function. T from Function fopen, FunctionCall fc, Parameter p, DataFlow::Node source, DataFlow::Node sink where - fopen.hasQualifiedName("fopen") and + fopen.hasGlobalName("fopen") and fc.getTarget() = fopen and source.asParameter(1) = p and sink.asIndirectExpr(1) = fc.getArgument(0) and @@ -253,14 +253,14 @@ The following data flow configuration tracks data flow from environment variable override predicate isSource(DataFlow::Node source) { exists(Function getenv | source.asIndirectExpr(1).(FunctionCall).getTarget() = getenv and - getenv.hasQualifiedName("getenv") + getenv.hasGlobalName("getenv") ) } override predicate isSink(DataFlow::Node sink) { exists(FunctionCall fc | sink.asIndirectExpr(1) = fc.getArgument(0) and - fc.getTarget().hasQualifiedName("fopen") + fc.getTarget().hasGlobalName("fopen") ) } } @@ -386,7 +386,7 @@ Exercise 3 import semmle.code.cpp.dataflow.new.DataFlow class GetenvSource extends DataFlow::Node { - GetenvSource() { this.asIndirectExpr(1).(FunctionCall).getTarget().hasQualifiedName("getenv") } + GetenvSource() { this.asIndirectExpr(1).(FunctionCall).getTarget().hasGlobalName("getenv") } } Exercise 4 @@ -398,7 +398,7 @@ Exercise 4 import semmle.code.cpp.dataflow.new.DataFlow class GetenvSource extends DataFlow::Node { - GetenvSource() { this.asIndirectExpr(1).(FunctionCall).getTarget().hasQualifiedName("getenv") } + GetenvSource() { this.asIndirectExpr(1).(FunctionCall).getTarget().hasGlobalName("getenv") } } class GetenvToGethostbynameConfiguration extends DataFlow::Configuration { diff --git a/docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp.rst b/docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp.rst index 4ed16f23abe..e91f6222da4 100644 --- a/docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp.rst +++ b/docs/codeql/codeql-language-guides/analyzing-data-flow-in-cpp.rst @@ -88,7 +88,7 @@ The following query finds the filename passed to ``fopen``. import cpp from Function fopen, FunctionCall fc - where fopen.hasQualifiedName("fopen") + where fopen.hasGlobalName("fopen") and fc.getTarget() = fopen select fc.getArgument(0) @@ -100,7 +100,7 @@ Unfortunately, this will only give the expression in the argument, not the value import semmle.code.cpp.dataflow.DataFlow from Function fopen, FunctionCall fc, Expr src - where fopen.hasQualifiedName("fopen") + where fopen.hasGlobalName("fopen") and fc.getTarget() = fopen and DataFlow::localFlow(DataFlow::exprNode(src), DataFlow::exprNode(fc.getArgument(0))) select src @@ -113,7 +113,7 @@ Then we can vary the source and, for example, use the parameter of a function. T import semmle.code.cpp.dataflow.DataFlow from Function fopen, FunctionCall fc, Parameter p - where fopen.hasQualifiedName("fopen") + where fopen.hasGlobalName("fopen") and fc.getTarget() = fopen and DataFlow::localFlow(DataFlow::parameterNode(p), DataFlow::exprNode(fc.getArgument(0))) select p @@ -236,14 +236,14 @@ The following data flow configuration tracks data flow from environment variable override predicate isSource(DataFlow::Node source) { exists (Function getenv | source.asExpr().(FunctionCall).getTarget() = getenv and - getenv.hasQualifiedName("getenv") + getenv.hasGlobalName("getenv") ) } override predicate isSink(DataFlow::Node sink) { exists (FunctionCall fc | sink.asExpr() = fc.getArgument(0) and - fc.getTarget().hasQualifiedName("fopen") + fc.getTarget().hasGlobalName("fopen") ) } } @@ -356,7 +356,7 @@ Exercise 3 class GetenvSource extends FunctionCall { GetenvSource() { - this.getTarget().hasQualifiedName("getenv") + this.getTarget().hasGlobalName("getenv") } } @@ -369,7 +369,7 @@ Exercise 4 class GetenvSource extends DataFlow::Node { GetenvSource() { - this.asExpr().(FunctionCall).getTarget().hasQualifiedName("getenv") + this.asExpr().(FunctionCall).getTarget().hasGlobalName("getenv") } }