mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
python: Inline expectation should have space after $
This was a regex-find-replace from `# \$(?! )` (using a negative lookahead) to `# $ `.
This commit is contained in:
@@ -5,15 +5,15 @@ See http://docs.fabfile.org/en/1.14/tutorial.html
|
||||
|
||||
from fabric.api import run, local, sudo
|
||||
|
||||
local("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
sudo("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
local("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
sudo("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
local(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
run(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
sudo(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
local(command="cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
run(command="cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
sudo(command="cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
from fabric import operations
|
||||
|
||||
operations.local("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
operations.local(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
operations.local("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
operations.local(command="cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
@@ -9,41 +9,41 @@ from fabric import connection, Connection, group, SerialGroup, ThreadingGroup, t
|
||||
# Connection
|
||||
################################################################################
|
||||
c = Connection("web1")
|
||||
c.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c.local("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c.sudo("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c.run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
c.local("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
c.sudo("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
c.local(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c.run(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c.sudo(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c.local(command="cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
c.run(command="cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
c.sudo(command="cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
# fully qualified usage
|
||||
c2 = connection.Connection("web2")
|
||||
c2.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c2.run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
# ssh proxy_command command injection with gateway parameter,
|
||||
# we need to call some of the following functions to run the proxy command
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c.run(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.run(command="cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.get("afs")
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c.sudo(command="cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.sudo(command="cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.open_gateway()
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.open()
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.create_session()
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.forward_local("80")
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.forward_remote("80")
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.put(local="local")
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.shell()
|
||||
c = Connection("web1", gateway="cmd") # $getCommand="cmd"
|
||||
c = Connection("web1", gateway="cmd") # $ getCommand="cmd"
|
||||
c.sftp()
|
||||
# no call to desired methods so it is safe
|
||||
c = Connection("web1", gateway="cmd")
|
||||
@@ -51,26 +51,26 @@ c = Connection("web1", gateway="cmd")
|
||||
################################################################################
|
||||
# SerialGroup
|
||||
################################################################################
|
||||
results = SerialGroup("web1", "web2", "mac1").run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
results = SerialGroup("web1", "web2", "mac1").run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
pool = SerialGroup("web1", "web2", "web3")
|
||||
pool.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
pool.sudo("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
pool.run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
pool.sudo("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
# fully qualified usage
|
||||
group.SerialGroup("web1", "web2", "mac1").run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
group.SerialGroup("web1", "web2", "mac1").run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
################################################################################
|
||||
# ThreadingGroup
|
||||
################################################################################
|
||||
results = ThreadingGroup("web1", "web2", "mac1").run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
results = ThreadingGroup("web1", "web2", "mac1").run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
pool = ThreadingGroup("web1", "web2", "web3")
|
||||
pool.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
pool.sudo("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
pool.run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
pool.sudo("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
# fully qualified usage
|
||||
group.ThreadingGroup("web1", "web2", "mac1").run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
group.ThreadingGroup("web1", "web2", "mac1").run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
|
||||
################################################################################
|
||||
@@ -81,11 +81,11 @@ group.ThreadingGroup("web1", "web2", "mac1").run("cmd1; cmd2") # $getCommand="c
|
||||
@task
|
||||
def foo(c):
|
||||
# 'c' is a fabric.connection.Connection
|
||||
c.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c.run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
|
||||
# fully qualified usage
|
||||
@tasks.task
|
||||
def bar(c):
|
||||
# 'c' is a fabric.connection.Connection
|
||||
c.run("cmd1; cmd2") # $getCommand="cmd1; cmd2"
|
||||
c.run("cmd1; cmd2") # $ getCommand="cmd1; cmd2"
|
||||
|
||||
Reference in New Issue
Block a user