Class: Zoom::SecurityProfile::UnsafePython

Inherits:
Zoom::SecurityProfile show all
Defined in:
lib/zoom/profile/unsafe_python.rb

Instance Method Summary collapse

Constructor Details

#initialize(n = nil, o = nil, f = nil, b = nil, a = nil) ⇒ UnsafePython

Returns a new instance of UnsafePython.



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/zoom/profile/unsafe_python.rb', line 2

def initialize(n = nil, o = nil, f = nil, b = nil, a = nil)
    case Zoom::ProfileManager.default_profile
    when /^ack(-grep)?$/
        f ||= "--smart-case --python"
    when "ag", "pt"
        f ||= "-S -G \"\\.py$\""
    when "grep"
        f ||= "-i --include=\"*.py\""
    end

    super(n, nil, f, b, a)
    @pattern = [
        "(^|[^\\nA-Za-z_])",
        "(",
        [
            "c?[Pp]ickle\\.loads?",
            "eval",
            "exec",
            "os\\.(popen|system)",
            "subprocess\\.call",
            "yaml\\.load"
        ].join("|"),
        ")",
        "\\("
    ].join
    @taggable = true
end