The following issues were found

src/third_party/mozjs-60/extract/js/src/jit/x86-shared/Disassembler-x86-shared.cpp
32 issues
access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 162 Column: 72 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              #define Pack3ByteOpcode(op1, op2) PackOpcode(OP_2BYTE_ESCAPE, op1, op2)

uint8_t*
js::jit::Disassembler::DisassembleHeapAccess(uint8_t* ptr, HeapAccess* access)
{
    VexOperandType type = VEX_PS;
    uint32_t opcode = OP_HLT;
    uint8_t modrm = 0;
    uint8_t sib = 0;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 522 Column: 57 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
#ifdef DEBUG
void
js::jit::Disassembler::DumpHeapAccess(const HeapAccess& access)
{
    switch (access.kind()) {
      case HeapAccess::Store:      fprintf(stderr, "store"); break;
      case HeapAccess::Load:       fprintf(stderr, "load"); break;
      case HeapAccess::LoadSext32: fprintf(stderr, "loadSext32"); break;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 524 Column: 13 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              void
js::jit::Disassembler::DumpHeapAccess(const HeapAccess& access)
{
    switch (access.kind()) {
      case HeapAccess::Store:      fprintf(stderr, "store"); break;
      case HeapAccess::Load:       fprintf(stderr, "load"); break;
      case HeapAccess::LoadSext32: fprintf(stderr, "loadSext32"); break;
      case HeapAccess::LoadSext64: fprintf(stderr, "loadSext64"); break;
      default:                     fprintf(stderr, "unknown"); break;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 531 Column: 37 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                    case HeapAccess::LoadSext64: fprintf(stderr, "loadSext64"); break;
      default:                     fprintf(stderr, "unknown"); break;
    }
    fprintf(stderr, "%u ", unsigned(access.size()));

    switch (access.otherOperand().kind()) {
      case OtherOperand::Imm:
        fprintf(stderr, "imm %d", access.otherOperand().imm());
        break;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 533 Column: 13 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  }
    fprintf(stderr, "%u ", unsigned(access.size()));

    switch (access.otherOperand().kind()) {
      case OtherOperand::Imm:
        fprintf(stderr, "imm %d", access.otherOperand().imm());
        break;
      case OtherOperand::GPR:
        fprintf(stderr, "gpr %s", X86Encoding::GPRegName(access.otherOperand().gpr()));

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 535 Column: 35 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    switch (access.otherOperand().kind()) {
      case OtherOperand::Imm:
        fprintf(stderr, "imm %d", access.otherOperand().imm());
        break;
      case OtherOperand::GPR:
        fprintf(stderr, "gpr %s", X86Encoding::GPRegName(access.otherOperand().gpr()));
        break;
      case OtherOperand::FPR:

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 538 Column: 58 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      fprintf(stderr, "imm %d", access.otherOperand().imm());
        break;
      case OtherOperand::GPR:
        fprintf(stderr, "gpr %s", X86Encoding::GPRegName(access.otherOperand().gpr()));
        break;
      case OtherOperand::FPR:
        fprintf(stderr, "fpr %s", X86Encoding::XMMRegName(access.otherOperand().fpr()));
        break;
      default: fprintf(stderr, "unknown");

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 541 Column: 59 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      fprintf(stderr, "gpr %s", X86Encoding::GPRegName(access.otherOperand().gpr()));
        break;
      case OtherOperand::FPR:
        fprintf(stderr, "fpr %s", X86Encoding::XMMRegName(access.otherOperand().fpr()));
        break;
      default: fprintf(stderr, "unknown");
    }

    fprintf(stderr, " @ ");

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 548 Column: 9 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    fprintf(stderr, " @ ");

    if (access.address().isPCRelative()) {
        fprintf(stderr, MEM_o32r " ", ADDR_o32r(access.address().disp()));
    } else if (access.address().hasIndex()) {
        if (access.address().hasBase()) {
            fprintf(stderr, MEM_obs " ",
                    ADDR_obs(access.address().disp(), access.address().base(),

            

Reported by FlawFinder.

fprintf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 549 Column: 9 CWE codes: 134
Suggestion: Use a constant for the format specification

                  fprintf(stderr, " @ ");

    if (access.address().isPCRelative()) {
        fprintf(stderr, MEM_o32r " ", ADDR_o32r(access.address().disp()));
    } else if (access.address().hasIndex()) {
        if (access.address().hasBase()) {
            fprintf(stderr, MEM_obs " ",
                    ADDR_obs(access.address().disp(), access.address().base(),
                             access.address().index(), access.address().scale()));

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_rollback_to_stable25.py
32 issues
Unable to import 'wiredtiger'
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wtscenario import make_scenarios, filter_scenarios

# test_rollback_to_stable25.py
# Check various scenarios relating to RLE cells in column-store.
#

            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 119 Column: 5

                      ('roll25', dict(rollback_time=25)),
    ]

    def is_meaningful(name, vals):
        # The last write at evict time should be uniform, to get an RLE cell.
        if vals['evict_time'] == 10 and vals['write_10'] != 'u':
            return False
        if vals['evict_time'] == 20 and vals['write_20'] != 'u':
            return False

            

Reported by Pylint.

Redefining built-in 'format'
Error

Line: 231 Column: 9

                  def test_rollback_to_stable25(self):
        # Create a table without logging.
        uri = "table:rollback_to_stable25"
        format = 'key_format=r,value_format=S'
        self.session.create(uri, format + ', log=(enabled=false)')

        # Pin oldest timestamp to 5.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(5))


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wtscenario import make_scenarios, filter_scenarios

# test_rollback_to_stable25.py
# Check various scenarios relating to RLE cells in column-store.
#

            

Reported by Pylint.

Constant name "my_rle_size" doesn't conform to UPPER_CASE naming style
Error

Line: 54 Column: 1

              # Put these bits outside the class definition so they can be referred to both in class
# instances and in the scenario setup logic, which doesn't have a class instance yet.

my_rle_size = 5

def keys_of_write(write):
    if write == 'u' or write == 'h':
        return range(2, 2 + my_rle_size)
    elif write == 'f':

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 56 Column: 1

              
my_rle_size = 5

def keys_of_write(write):
    if write == 'u' or write == 'h':
        return range(2, 2 + my_rle_size)
    elif write == 'f':
        return [2]
    elif write == 'm':

            

Reported by Pylint.

Unnecessary "elif" after "return"
Error

Line: 57 Column: 5

              my_rle_size = 5

def keys_of_write(write):
    if write == 'u' or write == 'h':
        return range(2, 2 + my_rle_size)
    elif write == 'f':
        return [2]
    elif write == 'm':
        return [2 + my_rle_size // 2]

            

Reported by Pylint.

Consider merging these comparisons with "in" to "write in ('u', 'h')"
Error

Line: 57 Column: 8

              my_rle_size = 5

def keys_of_write(write):
    if write == 'u' or write == 'h':
        return range(2, 2 + my_rle_size)
    elif write == 'f':
        return [2]
    elif write == 'm':
        return [2 + my_rle_size // 2]

            

Reported by Pylint.

Missing class docstring
Error

Line: 66 Column: 1

                  else:
        return [2 + my_rle_size - 1]

class test_rollback_to_stable25(wttest.WiredTigerTestCase):
    session_config = 'isolation=snapshot'
    conn_config = 'in_memory=false'

    write_10_values = [
        ('10u', dict(write_10='u')),

            

Reported by Pylint.

site_scons/site_tools/dagger/dagger.py
31 issues
subprocess call with shell=True identified, security issue.
Security injection

Line: 116
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b602_subprocess_popen_with_shell_equals_true.html

                      elif task == "defined":
            cmd = "nm -jU " + object_file + " | c++filt"

    p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
    uses = p.communicate()[0].decode()

    if platform == "linux":
        return list_process([use[19:] for use in uses.split("\n") if use != ""])
    elif platform == "darwin":

            

Reported by Bandit.

Unable to import 'SCons'
Error

Line: 63 Column: 1

              import subprocess
import sys

import SCons

from . import graph
from . import graph_consts



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 65 Column: 1

              
import SCons

from . import graph
from . import graph_consts


LIB_DB = []  # Stores every SCons library nodes
OBJ_DB = []  # Stores every SCons object file node

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 66 Column: 1

              import SCons

from . import graph
from . import graph_consts


LIB_DB = []  # Stores every SCons library nodes
OBJ_DB = []  # Stores every SCons object file node
EXE_DB = (

            

Reported by Pylint.

Unused import logging
Error

Line: 59 Column: 1

              #     See the License for the specific language governing permissions and
#     limitations under the License.

import logging
import subprocess
import sys

import SCons


            

Reported by Pylint.

Unused import SCons
Error

Line: 63 Column: 1

              import subprocess
import sys

import SCons

from . import graph
from . import graph_consts



            

Reported by Pylint.

TODO: Use the python library to read elf files,
Error

Line: 97 Column: 3

                  return r


# TODO: Use the python library to read elf files,
# so we know the file exists at this point
def get_symbol_worker(object_file, task):
    """From WIL, launches a worker subprocess which collects either symbols defined
    or symbols required by an object file"""


            

Reported by Pylint.

Unused argument 'env'
Error

Line: 125 Column: 39

                      return list_process([use.strip() for use in uses.split("\n") if use != ""])


def emit_obj_db_entry(target, source, env):
    """Emitter for object files. We add each object file
    built into a global variable for later use"""

    for t in target:
        if str(t) is None:

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 136 Column: 40

                  return target, source


def emit_prog_db_entry(target, source, env):
    for t in target:
        if str(t) is None:
            continue
        EXE_DB[t] = [str(s) for s in source]


            

Reported by Pylint.

Unused argument 'env'
Error

Line: 145 Column: 39

                  return target, source


def emit_lib_db_entry(target, source, env):
    """Emitter for libraries. We add each library
    into our global variable"""
    for t in target:
        if str(t) is None:
            continue

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/Alias.py
31 issues
Unused argument 'kw'
Error

Line: 52 Column: 1

                          self[name] = a
        return a

    def lookup(self, name, **kw):
        try:
            return self[name]
        except KeyError:
            return None


            

Reported by Pylint.

TODO check or discard version
Error

Line: 90 Column: 3

                      """
        Restore the attributes from a pickled state.
        """
        # TODO check or discard version
        del state['_version_id']
        for key, value in state.items():
            if key not in ('__weakref__',):
                setattr(self, key, value)
          

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 124 Column: 24

                  really_build = SCons.Node.Node.build
    is_up_to_date = SCons.Node.Node.children_are_up_to_date

    def is_under(self, dir):
        # Make Alias nodes get built regardless of
        # what directory scons was run from. Alias nodes
        # are outside the filesystem:
        return 1


            

Reported by Pylint.

Unused argument 'dir'
Error

Line: 124 Column: 24

                  really_build = SCons.Node.Node.build
    is_up_to_date = SCons.Node.Node.children_are_up_to_date

    def is_under(self, dir):
        # Make Alias nodes get built regardless of
        # what directory scons was run from. Alias nodes
        # are outside the filesystem:
        return 1


            

Reported by Pylint.

Unnecessary pass statement
Error

Line: 138 Column: 9

              
    def sconsign(self):
        """An Alias is not recorded in .sconsign files"""
        pass

    #
    #
    #


            

Reported by Pylint.

Parameters differ from overridden 'build' method
Error

Line: 144 Column: 5

                  #
    #

    def build(self):
        """A "builder" for aliases."""
        pass

    def convert(self):
        try: del self.builder

            

Reported by Pylint.

Unnecessary pass statement
Error

Line: 146 Column: 9

              
    def build(self):
        """A "builder" for aliases."""
        pass

    def convert(self):
        try: del self.builder
        except AttributeError: pass
        self.reset_executor()

            

Reported by Pylint.

Module name "Alias" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              
"""scons.Node.Alias

Alias nodes.

This creates a hash of global Aliases (dummy targets).

"""


            

Reported by Pylint.

Line too long (116/100)
Error

Line: 33 Column: 1

              # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

__revision__ = "src/engine/SCons/Node/Alias.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"

import collections

import SCons.Errors
import SCons.Node

            

Reported by Pylint.

Missing class docstring
Error

Line: 41 Column: 1

              import SCons.Node
import SCons.Util

class AliasNameSpace(collections.UserDict):
    def Alias(self, name, **kw):
        if isinstance(name, SCons.Node.Alias.Alias):
            return name
        try:
            a = self[name]

            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/matchers/_dict.py
31 issues
Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

                  'KeysEqual',
    ]

from ..helpers import (
    dict_subtract,
    filter_values,
    map_values,
    )
from ._higherorder import (

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

                  filter_values,
    map_values,
    )
from ._higherorder import (
    AnnotatedMismatch,
    PrefixedMismatch,
    MismatchesAll,
    )
from ._impl import Matcher, Mismatch

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

                  PrefixedMismatch,
    MismatchesAll,
    )
from ._impl import Matcher, Mismatch


def LabelledMismatches(mismatches, details=None):
    """A collection of mismatches, each labelled."""
    return MismatchesAll(

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 252 Column: 9

                      return "KeysEqual(%s)" % ', '.join(map(repr, self.expected))

    def match(self, matchee):
        from ._basic import _BinaryMismatch, Equals
        expected = sorted(self.expected)
        matched = Equals(expected).match(sorted(matchee.keys()))
        if matched:
            return AnnotatedMismatch(
                'Keys not equal',

            

Reported by Pylint.

Unused argument 'details'
Error

Line: 20 Column: 36

              from ._impl import Matcher, Mismatch


def LabelledMismatches(mismatches, details=None):
    """A collection of mismatches, each labelled."""
    return MismatchesAll(
        (PrefixedMismatch(k, v) for (k, v) in sorted(mismatches.items())),
        wrap=False)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Copyright (c) 2009-2012 testtools developers. See LICENSE for details.

__all__ = [
    'KeysEqual',
    ]

from ..helpers import (
    dict_subtract,
    filter_values,

            

Reported by Pylint.

Function name "LabelledMismatches" doesn't conform to snake_case naming style
Error

Line: 20 Column: 1

              from ._impl import Matcher, Mismatch


def LabelledMismatches(mismatches, details=None):
    """A collection of mismatches, each labelled."""
    return MismatchesAll(
        (PrefixedMismatch(k, v) for (k, v) in sorted(mismatches.items())),
        wrap=False)


            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 35 Column: 9

                  """

    def __init__(self, matchers):
        super(MatchesAllDict, self).__init__()
        self.matchers = matchers

    def __str__(self):
        return 'MatchesAllDict(%s)' % (_format_matcher_dict(self.matchers),)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 41 Column: 5

                  def __str__(self):
        return 'MatchesAllDict(%s)' % (_format_matcher_dict(self.matchers),)

    def match(self, observed):
        mismatches = {}
        for label in self.matchers:
            mismatches[label] = self.matchers[label].match(observed)
        return _dict_to_mismatch(
            mismatches, result_mismatch=LabelledMismatches)

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 49 Column: 1

                          mismatches, result_mismatch=LabelledMismatches)


class DictMismatches(Mismatch):
    """A mismatch with a dict of child mismatches."""

    def __init__(self, mismatches, details=None):
        super(DictMismatches, self).__init__(None, details=details)
        self.mismatches = mismatches

            

Reported by Pylint.

src/third_party/boost/boost/iostreams/device/file_descriptor.hpp
31 issues
open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 95 Column: 9 CWE codes: 362

                                                BOOST_IOS::in | BOOST_IOS::out )
    { 
        init();
        open(detail::path(path), mode); 
    }

    // Copy constructor
    file_descriptor(const file_descriptor& other);


            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 102 Column: 10 CWE codes: 362

                  file_descriptor(const file_descriptor& other);

    // open overloads taking file descriptors
    void open(handle_type fd, file_descriptor_flags);
#ifdef BOOST_IOSTREAMS_WINDOWS
    void open(int fd, file_descriptor_flags);
#endif

#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 104 Column: 10 CWE codes: 362

                  // open overloads taking file descriptors
    void open(handle_type fd, file_descriptor_flags);
#ifdef BOOST_IOSTREAMS_WINDOWS
    void open(int fd, file_descriptor_flags);
#endif

#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
    // open overloads taking file descriptors
    void open(handle_type fd, bool close_on_exit = false);

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 109 Column: 10 CWE codes: 362

              
#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
    // open overloads taking file descriptors
    void open(handle_type fd, bool close_on_exit = false);
#ifdef BOOST_IOSTREAMS_WINDOWS
    void open(int fd, bool close_on_exit = false);
#endif
#endif


            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 111 Column: 10 CWE codes: 362

                  // open overloads taking file descriptors
    void open(handle_type fd, bool close_on_exit = false);
#ifdef BOOST_IOSTREAMS_WINDOWS
    void open(int fd, bool close_on_exit = false);
#endif
#endif

    // open overload taking a std::string
    void open( const std::string& path,

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 116 Column: 10 CWE codes: 362

              #endif

    // open overload taking a std::string
    void open( const std::string& path,
               BOOST_IOS::openmode mode =
                   BOOST_IOS::in | BOOST_IOS::out );

    // open overload taking C-style string
    void open( const char* path,

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 121 Column: 10 CWE codes: 362

                                 BOOST_IOS::in | BOOST_IOS::out );

    // open overload taking C-style string
    void open( const char* path,
               BOOST_IOS::openmode mode =
                   BOOST_IOS::in | BOOST_IOS::out );

    // open overload taking a Boost.Filesystem path
    template<typename Path>

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 127 Column: 10 CWE codes: 362

              
    // open overload taking a Boost.Filesystem path
    template<typename Path>
    void open( const Path& path,
               BOOST_IOS::openmode mode =
                   BOOST_IOS::in | BOOST_IOS::out )
    { open(detail::path(path), mode); }

    bool is_open() const;

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 130 Column: 7 CWE codes: 362

                  void open( const Path& path,
               BOOST_IOS::openmode mode =
                   BOOST_IOS::in | BOOST_IOS::out )
    { open(detail::path(path), mode); }

    bool is_open() const;
    void close();
    std::streamsize read(char_type* s, std::streamsize n);
    std::streamsize write(const char_type* s, std::streamsize n);

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 142 Column: 10 CWE codes: 362

                  void init();

    // open overload taking a detail::path
    void open( const detail::path& path, 
               BOOST_IOS::openmode, 
               BOOST_IOS::openmode = BOOST_IOS::openmode(0) );

    typedef detail::file_descriptor_impl impl_type;
    shared_ptr<impl_type> pimpl_;

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_timestamp04.py
31 issues
Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              #

from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wiredtiger import stat
from wtscenario import make_scenarios

class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
    table_ts_log     = 'table:ts04_ts_logged'

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 35 Column: 1

              
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wiredtiger import stat
from wtscenario import make_scenarios

class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
    table_ts_log     = 'table:ts04_ts_logged'
    table_ts_nolog   = 'table:ts04_ts_nologged'

            

Reported by Pylint.

Unused argument 'prn'
Error

Line: 69 Column: 78

              
    # Check that a cursor (optionally started in a new transaction), sees the
    # expected values.
    def check(self, session, txn_config, tablename, expected, missing=False, prn=False):
        if txn_config:
            session.begin_transaction(txn_config)
        cur = session.open_cursor(tablename, None)
        if missing == False:
            actual = dict((k, v) for k, v in cur if v != 0)

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 98 Column: 35

              
    # This test varies the cache size and so needs to set up its own connection.
    # Override the standard methods.
    def setUpConnectionOpen(self, dir):
        return None

    def setUpSessionOpen(self, conn):
        return None


            

Reported by Pylint.

Unused argument 'dir'
Error

Line: 98 Column: 35

              
    # This test varies the cache size and so needs to set up its own connection.
    # Override the standard methods.
    def setUpConnectionOpen(self, dir):
        return None

    def setUpSessionOpen(self, conn):
        return None


            

Reported by Pylint.

Parameters differ from overridden 'setUpConnectionOpen' method
Error

Line: 98 Column: 5

              
    # This test varies the cache size and so needs to set up its own connection.
    # Override the standard methods.
    def setUpConnectionOpen(self, dir):
        return None

    def setUpSessionOpen(self, conn):
        return None


            

Reported by Pylint.

Attribute 'home' defined outside __init__
Error

Line: 105 Column: 9

                      return None

    def ConnectionOpen(self, cacheSize):
        self.home = '.'
        conn_params = 'create,statistics=(fast),' + \
            cacheSize + ',error_prefix="%s" %s' % (self.shortid(), self.conn_config)
        try:
            self.conn = wiredtiger.wiredtiger_open(self.home, conn_params)
        except wiredtiger.WiredTigerError as e:

            

Reported by Pylint.

Unused variable 'e'
Error

Line: 110 Column: 9

                          cacheSize + ',error_prefix="%s" %s' % (self.shortid(), self.conn_config)
        try:
            self.conn = wiredtiger.wiredtiger_open(self.home, conn_params)
        except wiredtiger.WiredTigerError as e:
            print("Failed conn at '%s' with config '%s'" % (dir, conn_params))
        self.session = wttest.WiredTigerTestCase.setUpSessionOpen(self, self.conn)

    def test_rollback_to_stable(self):
        self.ConnectionOpen(self.cacheSize)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

third party import "import wiredtiger, wttest" should be placed before "from suite_subprocess import suite_subprocess"
Error

Line: 34 Column: 1

              #

from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wiredtiger import stat
from wtscenario import make_scenarios

class test_timestamp04(wttest.WiredTigerTestCase, suite_subprocess):
    table_ts_log     = 'table:ts04_ts_logged'

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/jit/MIR.h
31 issues
access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14263 Column: 54 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              {
    wasm::MemoryAccessDesc access_;

    explicit MWasmLoad(const wasm::MemoryAccessDesc& access, MIRType resultType)
      : MVariadicInstruction(classOpcode),
        access_(access)
    {
        setGuard();
        setResultType(resultType);

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14265 Column: 17 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    explicit MWasmLoad(const wasm::MemoryAccessDesc& access, MIRType resultType)
      : MVariadicInstruction(classOpcode),
        access_(access)
    {
        setGuard();
        setResultType(resultType);
    }


            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14278 Column: 57 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  static MWasmLoad* New(TempAllocator& alloc,
                          MDefinition* memoryBase,
                          MDefinition* base,
                          const wasm::MemoryAccessDesc& access,
                          MIRType resultType)
    {
        MWasmLoad* load = new(alloc) MWasmLoad(access, resultType);
        if (!load->init(alloc, 1 + !!memoryBase))
            return nullptr;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14281 Column: 48 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                        const wasm::MemoryAccessDesc& access,
                          MIRType resultType)
    {
        MWasmLoad* load = new(alloc) MWasmLoad(access, resultType);
        if (!load->init(alloc, 1 + !!memoryBase))
            return nullptr;

        load->initOperand(0, base);
        if (memoryBase)

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14292 Column: 35 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      return load;
    }

    const wasm::MemoryAccessDesc& access() const {
        return access_;
    }

    AliasSet getAliasSet() const override {
        // When a barrier is needed, make the instruction effectful by giving

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14311 Column: 55 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              {
    wasm::MemoryAccessDesc access_;

    explicit MWasmStore(const wasm::MemoryAccessDesc& access)
      : MVariadicInstruction(classOpcode),
        access_(access)
    {
        setGuard();
    }

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14313 Column: 17 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    explicit MWasmStore(const wasm::MemoryAccessDesc& access)
      : MVariadicInstruction(classOpcode),
        access_(access)
    {
        setGuard();
    }

  public:

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14325 Column: 58 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  static MWasmStore* New(TempAllocator& alloc,
                           MDefinition* memoryBase,
                           MDefinition* base,
                           const wasm::MemoryAccessDesc& access,
                           MDefinition* value)
    {
        MWasmStore* store = new(alloc) MWasmStore(access);
        if (!store->init(alloc, 2 + !!memoryBase))
            return nullptr;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14328 Column: 51 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                         const wasm::MemoryAccessDesc& access,
                           MDefinition* value)
    {
        MWasmStore* store = new(alloc) MWasmStore(access);
        if (!store->init(alloc, 2 + !!memoryBase))
            return nullptr;

        store->initOperand(0, base);
        store->initOperand(1, value);

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 14340 Column: 35 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      return store;
    }

    const wasm::MemoryAccessDesc& access() const {
        return access_;
    }

    AliasSet getAliasSet() const override {
        return AliasSet::Store(AliasSet::WasmHeap);

            

Reported by FlawFinder.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/swig.py
31 issues
Unused argument 's'
Error

Line: 128 Column: 32

                          if outdir:
                 java_files = [os.path.join(outdir, j) for j in java_files]
            java_files = list(map(env.fs.File, java_files))
            def t_from_s(t, p, s, x):
                return t.dir
            tsm = SCons.Node._target_from_source_map
            tkey = len(tsm)
            tsm[tkey] = t_from_s
            for jf in java_files:

            

Reported by Pylint.

Unused argument 'p'
Error

Line: 128 Column: 29

                          if outdir:
                 java_files = [os.path.join(outdir, j) for j in java_files]
            java_files = list(map(env.fs.File, java_files))
            def t_from_s(t, p, s, x):
                return t.dir
            tsm = SCons.Node._target_from_source_map
            tkey = len(tsm)
            tsm[tkey] = t_from_s
            for jf in java_files:

            

Reported by Pylint.

Unused argument 'x'
Error

Line: 128 Column: 35

                          if outdir:
                 java_files = [os.path.join(outdir, j) for j in java_files]
            java_files = list(map(env.fs.File, java_files))
            def t_from_s(t, p, s, x):
                return t.dir
            tsm = SCons.Node._target_from_source_map
            tkey = len(tsm)
            tsm[tkey] = t_from_s
            for jf in java_files:

            

Reported by Pylint.

Access to a protected member _target_from_source_map of a client class
Error

Line: 130 Column: 19

                          java_files = list(map(env.fs.File, java_files))
            def t_from_s(t, p, s, x):
                return t.dir
            tsm = SCons.Node._target_from_source_map
            tkey = len(tsm)
            tsm[tkey] = t_from_s
            for jf in java_files:
                jf._func_target_from_source = tkey
            target.extend(java_files)

            

Reported by Pylint.

Access to a protected member _func_target_from_source of a client class
Error

Line: 134 Column: 17

                          tkey = len(tsm)
            tsm[tkey] = t_from_s
            for jf in java_files:
                jf._func_target_from_source = tkey
            target.extend(java_files)
    return (target, source)

def _get_swig_version(env, swig):
    """Run the SWIG command line tool to get and return the version number"""

            

Reported by Pylint.

Access to a protected member _subproc of a client class
Error

Line: 144 Column: 12

                  swig = env.subst(swig)
    if not swig:
        return version
    pipe = SCons.Action._subproc(env, SCons.Util.CLVar(swig) + ['-version'],
                                 stdin = 'devnull',
                                 stderr = 'devnull',
                                 stdout = subprocess.PIPE)
    if pipe.wait() != 0:
        return version

            

Reported by Pylint.

Line too long (115/100)
Error

Line: 35 Column: 1

              # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

__revision__ = "src/engine/SCons/Tool/swig.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"

import os.path
import sys
import re
import subprocess

            

Reported by Pylint.

Consider possible security implications associated with subprocess module.
Security blacklist

Line: 40
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess

              import os.path
import sys
import re
import subprocess

import SCons.Action
import SCons.Defaults
import SCons.Tool
import SCons.Util

            

Reported by Bandit.

Constant name "verbose" doesn't conform to UPPER_CASE naming style
Error

Line: 48 Column: 1

              import SCons.Util
import SCons.Node

verbose = False

swigs = [ 'swig', 'swig3.0', 'swig2.0' ]

SwigAction = SCons.Action.Action('$SWIGCOM', '$SWIGCOMSTR')


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 54 Column: 1

              
SwigAction = SCons.Action.Action('$SWIGCOM', '$SWIGCOMSTR')

def swigSuffixEmitter(env, source):
    if '-c++' in SCons.Util.CLVar(env.subst("$SWIGFLAGS", source=source)):
        return '$SWIGCXXFILESUFFIX'
    else:
        return '$SWIGCFILESUFFIX'


            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/tests/matchers/test_exception.py
31 issues
Method has no argument
Error

Line: 111 Column: 5

              class TestRaisesInterface(TestCase, TestMatchersInterface):

    matches_matcher = Raises()
    def boom():
        raise Exception('foo')
    matches_matches = [boom]
    matches_mismatches = [lambda:None]

    # Tricky to get function objects to render constantly, and the interfaces

            

Reported by Pylint.

Method has no argument
Error

Line: 127 Column: 5

              
    matches_matcher = Raises(
        exception_matcher=MatchesException(Exception('foo')))
    def boom_bar():
        raise Exception('bar')
    def boom_foo():
        raise Exception('foo')
    matches_matches = [boom_foo]
    matches_mismatches = [lambda:None, boom_bar]

            

Reported by Pylint.

Method has no argument
Error

Line: 129 Column: 5

                      exception_matcher=MatchesException(Exception('foo')))
    def boom_bar():
        raise Exception('bar')
    def boom_foo():
        raise Exception('foo')
    matches_matches = [boom_foo]
    matches_mismatches = [lambda:None, boom_bar]

    # Tricky to get function objects to render constantly, and the interfaces

            

Reported by Pylint.

Redefining built-in 'type'
Error

Line: 19 Column: 16

              from testtools.tests.matchers.helpers import TestMatchersInterface


def make_error(type, *args, **kwargs):
    try:
        raise type(*args, **kwargs)
    except type:
        return sys.exc_info()


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Copyright (c) 2008-2012 testtools developers. See LICENSE for details.

import sys

from testtools import TestCase
from testtools.matchers import (
    AfterPreprocessing,
    Equals,
    )

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 19 Column: 1

              from testtools.tests.matchers.helpers import TestMatchersInterface


def make_error(type, *args, **kwargs):
    try:
        raise type(*args, **kwargs)
    except type:
        return sys.exc_info()


            

Reported by Pylint.

Either all return statements in a function should return an expression, or none of them should.
Error

Line: 19 Column: 1

              from testtools.tests.matchers.helpers import TestMatchersInterface


def make_error(type, *args, **kwargs):
    try:
        raise type(*args, **kwargs)
    except type:
        return sys.exc_info()


            

Reported by Pylint.

Missing class docstring
Error

Line: 26 Column: 1

                      return sys.exc_info()


class TestMatchesExceptionInstanceInterface(TestCase, TestMatchersInterface):

    matches_matcher = MatchesException(ValueError("foo"))
    error_foo = make_error(ValueError, 'foo')
    error_bar = make_error(ValueError, 'bar')
    error_base_foo = make_error(Exception, 'foo')

            

Reported by Pylint.

Missing class docstring
Error

Line: 49 Column: 1

                      ]


class TestMatchesExceptionTypeInterface(TestCase, TestMatchersInterface):

    matches_matcher = MatchesException(ValueError)
    error_foo = make_error(ValueError, 'foo')
    error_sub = make_error(UnicodeError, 'bar')
    error_base_foo = make_error(Exception, 'foo')

            

Reported by Pylint.

Missing class docstring
Error

Line: 69 Column: 1

                      ]


class TestMatchesExceptionTypeReInterface(TestCase, TestMatchersInterface):

    matches_matcher = MatchesException(ValueError, 'fo.')
    error_foo = make_error(ValueError, 'foo')
    error_sub = make_error(UnicodeError, 'foo')
    error_bar = make_error(ValueError, 'bar')

            

Reported by Pylint.