Update docs

This commit is contained in:
Owen Mansel-Chan
2021-04-21 16:12:21 +01:00
parent e448dcb725
commit 4b8d4f5bbd
3 changed files with 11 additions and 5 deletions

View File

@@ -178,7 +178,7 @@ class TypeFile extends Class {
// --- Standard methods ---
/**
* Any of the methods named `command` on class `java.lang.ProcessBuilder`.
* Any constructor of class `java.lang.ProcessBuilder`.
*/
class ProcessBuilderConstructor extends Constructor, ExecCallable {
ProcessBuilderConstructor() { this.getDeclaringType() instanceof TypeProcessBuilder }

View File

@@ -2,11 +2,13 @@
import semmle.code.java.Type
import semmle.code.java.security.ExternalProcess
library class TypeCommandLine extends Class {
/** The class `org.apache.commons.exec.CommandLine`. */
private class TypeCommandLine extends Class {
TypeCommandLine() { hasQualifiedName("org.apache.commons.exec", "CommandLine") }
}
library class MethodCommandLineParse extends Method, ExecCallable {
/** The `parse()` method of the class `org.apache.commons.exec.CommandLine`. */
private class MethodCommandLineParse extends Method, ExecCallable {
MethodCommandLineParse() {
getDeclaringType() instanceof TypeCommandLine and
hasName("parse")
@@ -15,7 +17,8 @@ library class MethodCommandLineParse extends Method, ExecCallable {
override int getAnExecutedArgument() { result = 0 }
}
library class MethodCommandLineAddArguments extends Method, ExecCallable {
/** The `addArguments()` method of the class `org.apache.commons.exec.CommandLine`. */
private class MethodCommandLineAddArguments extends Method, ExecCallable {
MethodCommandLineAddArguments() {
getDeclaringType() instanceof TypeCommandLine and
hasName("addArguments")

View File

@@ -4,9 +4,12 @@ import semmle.code.java.JDK
import semmle.code.java.frameworks.apache.Exec
/**
* A method that executes a command.
* A callable that executes a command.
*/
abstract class ExecCallable extends Callable {
/**
* Gets the index of an argument that will be part of the command that is executed.
*/
abstract int getAnExecutedArgument();
}