[csw-devel] SF.net SVN: gar:[20037] csw/mgar/gar/v2/lib/python
chninkel at users.sourceforge.net
chninkel at users.sourceforge.net
Sat Jan 5 16:35:33 CET 2013
Revision: 20037
http://gar.svn.sourceforge.net/gar/?rev=20037&view=rev
Author: chninkel
Date: 2013-01-05 15:35:32 +0000 (Sat, 05 Jan 2013)
Log Message:
-----------
gar/v2: re-added new checkpkg tests: soname-unused, no-direct-binding and forbidden-version-interface-dependencies
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/common_constants.py
csw/mgar/gar/v2/lib/python/database.py
csw/mgar/gar/v2/lib/python/dependency_checks.py
csw/mgar/gar/v2/lib/python/inspective_package.py
csw/mgar/gar/v2/lib/python/inspective_package_test.py
csw/mgar/gar/v2/lib/python/package.py
csw/mgar/gar/v2/lib/python/package_checks_test.py
csw/mgar/gar/v2/lib/python/package_stats.py
csw/mgar/gar/v2/lib/python/package_stats_test.py
csw/mgar/gar/v2/lib/python/testdata/apr_util_stats.py
csw/mgar/gar/v2/lib/python/testdata/bdb48_stats.py
csw/mgar/gar/v2/lib/python/testdata/checkpkg_test_data_CSWdjvulibrert.py
csw/mgar/gar/v2/lib/python/testdata/ivtools_stats.py
csw/mgar/gar/v2/lib/python/testdata/javasvn_stats.py
csw/mgar/gar/v2/lib/python/testdata/libnet_stats.py
csw/mgar/gar/v2/lib/python/testdata/mercurial_stats.py
csw/mgar/gar/v2/lib/python/testdata/neon_stats.py
csw/mgar/gar/v2/lib/python/testdata/rsync_pkg_stats.py
csw/mgar/gar/v2/lib/python/testdata/sudo_stats.py
csw/mgar/gar/v2/lib/python/testdata/tree_stats.py
Modified: csw/mgar/gar/v2/lib/python/common_constants.py
===================================================================
--- csw/mgar/gar/v2/lib/python/common_constants.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/common_constants.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -34,6 +34,7 @@
DEFAULT_INSTALL_CONTENTS_FILE = "/var/sadm/install/contents"
DUMP_BIN = "/usr/ccs/bin/dump"
+ELFDUMP_BIN = "/usr/ccs/bin/elfdump"
OWN_PKGNAME_PREFIXES = frozenset(["CSW"])
Modified: csw/mgar/gar/v2/lib/python/database.py
===================================================================
--- csw/mgar/gar/v2/lib/python/database.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/database.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -10,7 +10,7 @@
import system_pkgmap
CONFIG_DB_SCHEMA = "db_schema_version"
-DB_SCHEMA_VERSION = 7L
+DB_SCHEMA_VERSION = 9L
TABLES_THAT_NEED_UPDATES = (m.CswFile,)
TABLES = TABLES_THAT_NEED_UPDATES + (
m.Architecture,
@@ -159,8 +159,8 @@
except sqlobject.dberrors.OperationalError, e:
logging.error("Could not create table %r: %s", table, e)
raise
-
+
def InitialDataImport(self):
"""Imports initial data into the db.
@@ -289,7 +289,7 @@
logging.warning("Could not get file mtime: %s", e)
d_mtime = time.gmtime(int(d_mtime_epoch))
logging.debug("IsDatabaseUpToDate: f_mtime %s, d_time: %s", f_mtime, d_mtime)
- # Rounding up to integer seconds. There is a race condition:
+ # Rounding up to integer seconds. There is a race condition:
# pkgadd finishes at 100.1
# checkpkg reads /var/sadm/install/contents at 100.2
# new pkgadd runs and finishes at 100.3
Modified: csw/mgar/gar/v2/lib/python/dependency_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/dependency_checks.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/dependency_checks.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -39,6 +39,29 @@
PREFERRED_DIRECTORY_PROVIDERS = set([u"CSWcommon"])
+BASE_SOLARIS_LIBRARIES = (
+ "libsocket.so.1", "libnsl.so.1", "libdl.so.1", "librt.so.1",
+ "libresolv.so.2", "libpthread.so.1",
+ # linked by default with C++, see "Default C++ Libraries"
+ # in Solaris Studio C++ User's Guide
+ "libCstd.so.1", "libCrun.so.1", "libm.so.1", "libm.so.2",
+ "libw.so.1", "libcx.so.1", "libc.so.1", "libC.so.3", "libC.so.5",
+)
+
+ALLOWED_VERSION_DEPENDENCIES = {
+ "libc.so.1": ['SYSVABI_1.3', 'SUNWprivate_1.1', 'SUNW_1.22.6',
+ 'SUNW_1.22.5', 'SUNW_1.22.4', 'SUNW_1.22.3', 'SUNW_1.22.2',
+ 'SUNW_1.22.1', 'SUNW_1.22', 'SUNW_1.21.3', 'SUNW_1.21.2',
+ 'SUNW_1.21.1', 'SUNW_1.21', 'SUNW_1.20.4', 'SUNW_1.20.1',
+ 'SUNW_1.20', 'SUNW_1.19', 'SUNW_1.18.1', 'SUNW_1.18',
+ 'SUNW_1.17', 'SUNW_1.16', 'SUNW_1.15', 'SUNW_1.14',
+ 'SUNW_1.13', 'SUNW_1.12', 'SUNW_1.11', 'SUNW_1.10',
+ 'SUNW_1.9', 'SUNW_1.8', 'SUNW_1.7', 'SUNW_1.6', 'SUNW_1.5',
+ 'SUNW_1.4', 'SUNW_1.3', 'SUNW_1.2', 'SUNW_1.1', 'SUNW_0.9',
+ 'SUNW_0.8', 'SUNW_0.7', 'SISCD_2.3'],
+}
+
+
def ProcessSoname(
ldd_emulator,
soname, path_and_pkg_by_basename, binary_info, isalist, binary_path, logger,
@@ -147,6 +170,67 @@
error_mgr,
pkgname, messenger)
orphan_sonames.extend(orphan_sonames_tmp)
+
+ ldd_info = pkg_data['ldd_info'][binary_info["path"]]
+ for ldd_response in ldd_info:
+ if (ldd_response['state'] == 'soname-unused'
+ and ldd_response['soname'] not in BASE_SOLARIS_LIBRARIES):
+ messenger.Message(
+ "Binary %s links to library %s but doesn't seem to use any"
+ " of its symbols. It usually happens because superfluous"
+ " libraries were added to the linker options, either because"
+ " of the configure script itself or because of the"
+ " \"pkg-config --libs\" output of one the dependency."
+ % ("/" + binary_info["path"], ldd_response['soname']))
+ error_mgr.ReportError(
+ pkgname, "soname-unused",
+ "%s is needed by %s but never used"
+ % (ldd_response['soname'], "/" + binary_info["path"]))
+
+ # Even when direct binding is enabled, some symbols might not be
+ # directly bound because the library explicitely requested the symbol
+ # not to be drectly bound to.
+ # For example, libc.so.1 does it for symbol sigaction, free, malloc...
+ # So we consider that direct binding is enabled if at least one
+ # symbol is directly bound to because that definitely means that
+ # -B direct or -z direct was used.
+ binary_elf_info = pkg_data["binaries_elf_info"][binary_info["path"]]
+ db_libs = set()
+ for syminfo in binary_elf_info['symbol table']:
+ if (syminfo['shndx'] == 'UNDEF' and syminfo['flags']
+ and 'D' in syminfo['flags'] and 'B' in syminfo['flags']):
+ db_libs.add(syminfo['soname'])
+ no_db_libs = db_libs.symmetric_difference(binary_info["needed sonames"])
+
+ if no_db_libs:
+ messenger.Message(
+ "No symbol of binary %s is directly bound against the following"
+ " libraries: %s. Please make sure the binaries are compiled using"
+ " the \"-Bdirect\" linker option."
+ % ("/" + binary_info["path"], ", ".join(no_db_libs)))
+ for soname in no_db_libs:
+ error_mgr.ReportError(
+ pkgname, "no-direct-binding",
+ "%s is not directly bound to soname %s"
+ % ("/" + binary_info["path"], soname))
+
+
+ for version_dep in binary_elf_info['version needed']:
+ if (version_dep['soname'] in ALLOWED_VERSION_DEPENDENCIES and
+ not version_dep['version'] in
+ ALLOWED_VERSION_DEPENDENCIES[version_dep['soname']]):
+ messenger.Message(
+ "Binary %s requires interface version %s in library %s which is"
+ " only available in recent Solaris releases."
+ % ("/" + binary_info["path"], version_dep['version'],
+ version_dep['soname']))
+ error_mgr.ReportError(
+ pkgname, "forbidden-version-interface-dependencies",
+ "%s requires forbidden interface version %s in library %s"
+ % ("/" + binary_info["path"], version_dep['version'],
+ version_dep['soname']))
+
+
orphan_sonames = set(orphan_sonames)
for soname, binary_path in orphan_sonames:
if soname not in ALLOWED_ORPHAN_SONAMES:
Modified: csw/mgar/gar/v2/lib/python/inspective_package.py
===================================================================
--- csw/mgar/gar/v2/lib/python/inspective_package.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/inspective_package.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -10,6 +10,8 @@
import subprocess
import ldd_emul
import configuration as c
+import time
+import signal
"""This file isolates code dependent on hachoir parser.
@@ -76,7 +78,37 @@
"Error in hachoir_parser processing %s: %r", file_path, e)
return file_info
+class TimeoutExpired(Exception):
+ pass
+def TimeoutHandler(signum, frame):
+ raise TimeoutExpired
+
+def ShellCommand(args, env=None, timeout=None):
+ logging.debug("Running: %s", args)
+ proc = subprocess.Popen(args,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ env=env,
+ preexec_fn=os.setsid)
+ # Python 3.3 have the timeout option
+ # we have to roughly emulate it with python 2.x
+ if timeout:
+ signal.signal(signal.SIGALRM, TimeoutHandler)
+ signal.alarm(timeout)
+
+ try:
+ stdout, stderr = proc.communicate()
+ signal.alarm(0)
+ except TimeoutExpired:
+ os.kill(-proc.pid, signal.SIGKILL)
+ msg = "Process %s killed after timeout expiration" % args
+ raise TimeoutExpired(msg)
+
+ retcode = proc.wait()
+ return retcode, stdout, stderr
+
+
class InspectivePackage(package.DirectoryFormatPackage):
"""Extends DirectoryFormatPackage to allow package inspection."""
@@ -184,10 +216,7 @@
binary_abs_path = os.path.join(self.directory, self.GetFilesDir(), binary_in_tmp_dir)
binary_base_name = os.path.basename(binary_in_tmp_dir)
args = [common_constants.DUMP_BIN, "-Lv", binary_abs_path]
- logging.debug("Running: %s", args)
- dump_proc = subprocess.Popen(args, stdout=subprocess.PIPE, env=env)
- stdout, stderr = dump_proc.communicate()
- ret = dump_proc.wait()
+ retcode, stdout, stderr = ShellCommand(args, env)
binary_data = ldd_emul.ParseDumpOutput(stdout)
binary_data["path"] = binary
if basedir:
@@ -211,7 +240,7 @@
defined_symbols = {}
for binary in binaries:
- binary_abspath = os.path.join(self.directory, "root", binary)
+ binary_abspath = os.path.join(self.directory, self.GetFilesDir(), binary)
# Get parsable, ld.so.1 relevant SHT_DYNSYM symbol information
args = ["/usr/ccs/bin/nm", "-p", "-D", binary_abspath]
nm_proc = subprocess.Popen(
@@ -236,29 +265,152 @@
return defined_symbols
+ def GetBinaryElfInfo(self):
+ """Returns various informations symbol and versions present in elf header
+
+ To do this we parse output lines from elfdump -syv, it's the
+ only command that will give us all informations we need on
+ symbols and versions.
+
+ We will analyse 3 sections:
+ - version section: contains soname needed, version interface required
+ for each soname, and version definition
+ - symbol table section: contains list of symbol and soname/version
+ interface providing it
+ - syminfo section: contains special linking flags for each symbol
+ """
+ binaries = self.ListBinaries()
+ binaries_elf_info = {}
+
+ for binary in binaries:
+ binary_abspath = os.path.join(self.directory, self.GetFilesDir(), binary)
+ # elfdump is the only tool that give us all informations
+ args = [common_constants.ELFDUMP_BIN, "-svy", binary_abspath]
+ retcode, stdout, stderr = ShellCommand(args)
+ if retcode or stderr:
+ # we ignore for now these elfdump errors which can be catched
+ # later by check functions,
+ ignored_error_re = re.compile(
+ r"""[^:]+:(\s\.((SUNW_l)?dynsym|symtab):\s
+ (index\[\d+\]:\s
+ (suspicious\s(local|global)\ssymbol\sentry:\s[^:]+:\slies
+ \swithin\s(local|global)\ssymbol\srange\s\(index\s[<>=]+\s\d+\)
+
+ |bad\ssymbol\sentry:\s[^:]+:\ssection\[\d+\]\ssize:\s0(x[0-9a-f]+)?
+ :\ssymbol\s\(address\s0x[0-9a-f]+,\ssize\s0x[0-9a-f]+\)
+ \slies\soutside\sof\scontaining\ssection
+
+ |bad\ssymbol\sentry:\s:\sinvalid\sshndx:\s\d+)
+
+ |invalid\ssh_link:\s0)
+
+ |\smemory\soverlap\sbetween\ssection\[\d+\]:\s[^:]+:\s
+ [0-9a-f]+:[0-9a-f]+\sand\ssection\[\d+\]:\s[^:]+:
+ \s[0-9a-f]+:[0-9a-f]+)
+ \n""",
+ re.VERBOSE)
+
+ stderr = re.sub(ignored_error_re, "", stderr)
+ if stderr:
+ msg = "%s returned one or more errors: %s" % (args, stderr)
+ raise package.Error(msg)
+ elfdump_out = stdout.splitlines()
+
+ symbols = {}
+ binary_info = {'version definition': [],
+ 'version needed': []}
+
+ cur_section = None
+ for line in elfdump_out:
+
+ elf_info, cur_section = self._ParseElfdumpLine(line, cur_section)
+
+ # header or blank line contains no information
+ if not elf_info:
+ continue
+
+ # symbol table and syminfo section store various informations
+ # about the same symbols, so we merge them in a dict
+ if cur_section in ('symbol table', 'syminfo'):
+ symbols.setdefault(elf_info['symbol'], {}).update(elf_info)
+ else:
+ binary_info[cur_section].append(elf_info)
+
+ # elfdump doesn't repeat the name of the soname in the version section
+ # if it's the same on two contiguous line, e.g.:
+ # libc.so.1 SUNW_1.1
+ # SUNWprivate_1.1
+ # so we have to make sure the information is present in each entry
+ for i, version in enumerate(binary_info['version needed'][1:]):
+ if not version['soname']:
+ version['soname'] = binary_info['version needed'][i]['soname']
+
+ # soname version needed are usually displayed sorted by index ...
+ # but that's not always the case :( so we have to reorder
+ # the list by index if they are present
+ if any ( v['index'] for v in binary_info['version needed'] ):
+ binary_info['version needed'].sort(key=lambda m: int(m['index']))
+ for version in binary_info['version needed']:
+ del version['index']
+
+ # if it exists, the first "version definition" entry is the base soname
+ # we don't need this information
+ if binary_info['version definition']:
+ binary_info['version definition'].pop(0)
+
+ binary_info['symbol table'] = symbols.values()
+ binary_info['symbol table'].sort(key=lambda m: m['symbol'])
+ # To not rely of the section order output of elfdump, we resolve
+ # symbol version informations here after having parsed all output
+ self._ResolveSymbolsVersionInfo(binary_info)
+
+ binaries_elf_info[binary] = binary_info
+
+ return binaries_elf_info
+
def GetLddMinusRlines(self):
"""Returns ldd -r output."""
- dir_pkg = self.GetInspectivePkg()
- binaries = dir_pkg.ListBinaries()
+ binaries = self.ListBinaries()
ldd_output = {}
for binary in binaries:
- binary_abspath = os.path.join(dir_pkg.directory, "root", binary)
+ binary_abspath = os.path.join(self.directory, self.GetFilesDir(), binary)
# this could be potentially moved into the DirectoryFormatPackage class.
# ldd needs the binary to be executable
os.chmod(binary_abspath, 0755)
- args = ["ldd", "-r", binary_abspath]
- ldd_proc = subprocess.Popen(
- args,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- stdout, stderr = ldd_proc.communicate()
- retcode = ldd_proc.wait()
+ args = ["ldd", "-Ur", binary_abspath]
+ # ldd can be stuck while ran on a some binaries, so we define
+ # a timeout (problem encountered with uconv)
+ retcode, stdout, stderr = ShellCommand(args, timeout=10)
if retcode:
- logging.error("%s returned an error: %s", args, stderr)
+ # There three cases where we will ignore an ldd error
+ # - if we are trying to analyze a 64 bits binary on a Solaris 9 x86
+ # solaris 9 exists only in 32 bits, so we can't do this
+ # We ignore the error as it is likely that the ldd infos will be
+ # the same on the 32 bits binaries
+ # - if we are trying to analyze a binary from another architecture
+ # we ignore this error as it will be caught by another checkpkg test
+ # - if we are trying to analyze a statically linked binaries
+ # we care only about dynamic binary so we ignore the error
+ #
+ uname_info = os.uname()
+ if ((uname_info[2] == '5.9' and uname_info[4] == 'i86pc' and
+ '/amd64/' in binary_abspath and
+ 'has wrong class or data encoding' in stderr) or
+ re.search(r'ELF machine type: EM_\w+: '
+ r'is incompatible with system', stderr)
+ or 'file is not a dynamic executable or shared object' in stderr):
+ ldd_output[binary] = []
+ continue
+
+ raise package.Error("%s returned an error: %s" % (args, stderr))
+
ldd_info = []
for line in stdout.splitlines():
- ldd_info.append(self._ParseLddDashRline(line))
- ldd_output[binary] = ldd_info
+ result = self._ParseLddDashRline(line, binary_abspath)
+ if result:
+ ldd_info.append(result)
+ ldd_output[binary] = ldd_info
+
return ldd_output
def _ParseNmSymLine(self, line):
@@ -270,7 +422,111 @@
sym = { 'address': fields[0], 'type': fields[1], 'name': fields[2] }
return sym
- def _ParseLddDashRline(self, line):
+ def _ResolveSymbolsVersionInfo(self, binary_info):
+
+ version_info = (binary_info['version definition']
+ + binary_info['version needed'])
+
+ for sym_info in binary_info['symbol table']:
+ # sym_info version field is an 1-based index on the version
+ # information table
+ # we don't care about 0 and 1 values:
+ # 0 is for external symbol with no version information available
+ # 1 is for a symbol defined by the binary and not binded
+ # to a version interface
+ version_index = int(sym_info['version']) - 2
+ if version_index >= 0:
+ version = version_info[version_index]
+ sym_info['version'] = version['version']
+ if 'soname' in version:
+ sym_info['soname'] = version['soname']
+ else:
+ sym_info['version'] = None
+
+ # we make sure these fields are present
+ # even if the syminfo section is not
+ sym_info.setdefault('soname')
+ sym_info.setdefault('flags')
+
+ def _ParseElfdumpLine(self, line, section=None):
+
+ headers_re = (
+ r"""
+ (?P<section>Version\sNeeded|Symbol\sTable # Section header
+ |Version\sDefinition|Syminfo)
+ \sSection:
+ \s+(?:\.SUNW_version|\.gnu\.version_[rd]
+ |\.dynsym|\.SUNW_syminfo|.symtab)\s*$
+
+ |\s*(?:index\s+)?version\s+dependency\s*$ # Version needed header
+
+ |\s*(?:index\s+)?file\s+version\s*$ # Version definition header
+
+ |\s*index\s*value\s+size\s+type\s+bind # Symbol table header
+ \s+oth\s+ver\s+shndx\s+name\s*$
+
+ |\s*index\s+flags\s+bound\sto\s+symbol\s*$ # Syminfo header
+
+ |\s*$ # There is always a blank
+ # line before a new section
+ """)
+
+ re_by_section = {
+ 'version definition': (r"""
+ \s*(?:\[\d+\]\s+)? # index: might be not present if no
+ # version binding is enabled
+ (?P<version>\S+) # version
+ (?:\s+(?P<dependency>\S+))? # dependency
+ (?:\s+\[\s(?:BASE|WEAK)\s\])?\s*$
+ """),
+ 'version needed': (r"""
+ \s*(?:\[(?P<index>\d+)\]\s+)? # index: might be not present if no
+ # version binding is enabled
+ (?:(?P<soname>\S+)\s+ # file: can be absent if the same as
+ (?!\[\s(?:INFO|WEAK)\s\]))? # the previous line,
+ # we make sure there is no
+ # confusion with version
+ (?P<version>\S+) # version
+ (?:\s+\[\s(?:INFO|WEAK)\s\])?\s*$ #
+ """),
+ 'symbol table': (r"""
+ \s*\[\d+\] # index
+ \s+(?:0x[0-9a-f]+|REG_G\d+) # value
+ \s+(?:0x[0-9a-f]+) # size
+ \s+(?P<type>\S+) # type
+ \s+(?P<bind>\S+) # bind
+ \s+(?:\S+) # oth
+ \s+(?P<version>\S+) # ver
+ \s+(?P<shndx>\S+) # shndx
+ (?:\s+(?P<symbol>\S+))?\s*$ # name
+ """),
+ 'syminfo': (r"""
+ \s*(?:\[\d+\]) # index
+ \s+(?P<flags>[ABCDFILNPS]+) # flags
+
+ \s+(?:(?:\[\d+\] # bound to: contains either
+ \s+(?P<soname>\S+)|<self>)\s+)? # - library index and library name
+ # - <self> for non external symbols
+
+ (?P<symbol>\S+)\s* # symbol
+ """)}
+
+ elfdump_data = None
+ m = re.match(headers_re, line, re.VERBOSE)
+ if m:
+ if m.lastindex:
+ section = m.group('section').lower()
+ elif section:
+ m = re.match(re_by_section[section], line, re.VERBOSE)
+ if m:
+ elfdump_data = m.groupdict()
+
+ if not m:
+ raise package.StdoutSyntaxError("Could not parse %s" % (repr(line)))
+
+ return elfdump_data, section
+
+ def _ParseLddDashRline(self, line, binary=None):
found_re = r"^\t(?P<soname>\S+)\s+=>\s+(?P<path_found>\S+)"
symbol_not_found_re = (r"^\tsymbol not found:\s(?P<symbol>\S+)\s+"
r"\((?P<path_not_found>\S+)\)")
@@ -283,16 +539,35 @@
r'with STV_PROTECTED visibility$')
sizes_differ = (r'^\trelocation \S+ sizes differ: '
r'(?P<sizes_differ_symbol>\S+)$')
- sizes_info = (r'^\t\t\(file (?P<sizediff_file1>\S+) size=(?P<size1>0x\w+); '
+ sizes_info = (r'^\t\t\(file (?P<sizediff_file1>\S+)'
+ r' size=(?P<size1>0x\w+); '
r'file (?P<sizediff_file2>\S+) size=(?P<size2>0x\w+)\)$')
sizes_one_used = (r'^\t\t(?P<sizediffused_file>\S+) size used; '
r'possible insufficient data copied$')
- common_re = (r"(%s|%s|%s|%s|%s|%s|%s|%s)"
+ unreferenced_object = (r'^\s*unreferenced object=(?P<object>.*);'
+ r' unused dependency of (?P<binary>.*)$')
+ unused_object = (r'^\s*unused object=.*$')
+ unused_search_path = (r'^\s*unused search path=.*'
+ r' \(RUNPATH/RPATH from file .*\)$')
+ move_offset_error = (r'^\tmove (?P<move_index>\d+) offset invalid: '
+ r'\(unknown\): offset=(?P<move_offset>0x[0-9a-f]+) '
+ 'lies outside memory image; move discarded')
+ relocation_error = (r'relocation R_(386|AMD64|X86_64|SPARC)_\w+ '
+ r'sizes differ: (?P<reloc_symbol>.*)'
+ r'|\t\t\(file .* size=0(?:x[0-9a-f]+)?; file .*'
+ r'size=0x(?:[0-9a-f]+)?\)'
+ r'|\t.* size used; possible data truncation')
+ blank_line = (r'^\s*$')
+ common_re = (r"(%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s)"
% (found_re, symbol_not_found_re, only_so, version_so,
- stv_protected, sizes_differ, sizes_info, sizes_one_used))
+ stv_protected, sizes_differ, sizes_info,
+ sizes_one_used, unreferenced_object, unused_object,
+ unused_search_path, blank_line, move_offset_error,
+ relocation_error))
m = re.match(common_re, line)
- response = {}
+ response = None
if m:
+ response = {}
d = m.groupdict()
if "soname" in d and d["soname"]:
# it was found
@@ -305,6 +580,11 @@
response["soname"] = None
response["path"] = d["path_not_found"]
response["symbol"] = d["symbol"]
+ elif "binary" in d and d["binary"] and binary == d["binary"]:
+ response["state"] = "soname-unused"
+ response["soname"] = os.path.basename(d["object"])
+ response["path"] = None
+ response["symbol"] = None
elif d["path_only"]:
response["state"] = "OK"
response["soname"] = None
@@ -335,12 +615,23 @@
response["soname"] = None
response["path"] = "%s" % (d["sizediffused_file"])
response["symbol"] = None
- else:
- raise StdoutSyntaxError("Could not parse %s with %s"
- % (repr(line), common_re))
+ elif d["move_offset"]:
+ response["state"] = 'move-offset-error'
+ response["soname"] = None
+ response["path"] = None
+ response["symbol"] = None
+ response["move_offset"] = d['move_offset']
+ response["move_index"] = d['move_index']
+ elif d["reloc_symbol"]:
+ response["state"] = 'relocation-issue'
+ response["soname"] = None
+ response["path"] = None
+ response["symbol"] = d['reloc_symbol']
+
else:
- raise StdoutSyntaxError("Could not parse %s with %s"
- % (repr(line), common_re))
+ raise package.StdoutSyntaxError("Could not parse %s with %s"
+ % (repr(line), common_re))
+
return response
def GetDependencies(self):
Modified: csw/mgar/gar/v2/lib/python/inspective_package_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/inspective_package_test.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/inspective_package_test.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -6,6 +6,7 @@
import hachoir_parser
import magic
import os
+import common_constants
LDD_R_OUTPUT_1 = """\tlibc.so.1 => /lib/libc.so.1
\tsymbol not found: check_encoding_conversion_args (/opt/csw/lib/postgresql/8.4/utf8_and_gbk.so)
@@ -68,12 +69,132 @@
}
self.assertEqual([u'foo-file'], ip.ListBinaries())
+ def testGetBinaryElfInfo(self):
+ fake_binary = 'opt/csw/lib/libssl.so.1.0.0'
+ fake_package_path = '/fake/path/CSWfoo'
+ fake_elfdump_output = '''
+Version Definition Section: .SUNW_version
+ index version dependency
+ [1] libssl.so.1.0.0 [ BASE ]
+ [2] OPENSSL_1.0.0
+ [3] OPENSSL_1.0.1 OPENSSL_1.0.0
+Version Needed Section: .SUNW_version
+ index file version
+ [4] libcrypto.so.1.0.0 OPENSSL_1.0.0 [ INFO ]
+ [5] OPENSSL_1.0.1
+ [6] libnsl.so.1 SUNW_1.9.1
+
+Symbol Table Section: .dynsym
+ index value size type bind oth ver shndx name
+ [0] 0x00000000 0x00000000 NOTY LOCL D 0 UNDEF
+ [1] 0x00000000 0x00000000 FUNC GLOB D 4 UNDEF EVP_DigestSignFinal
+ [2] 0x0003ead4 0x000000dc FUNC GLOB P 2 .text SSL_get_shared_ciphers
+ [3] 0x0004f8f8 0x00000014 FUNC GLOB P 3 .text SSL_CTX_set_srp_client_pwd_callback
+ [4] 0x00000000 0x00000000 FUNC GLOB D 5 UNDEF SRP_Calc_client_key
+ [5] 0x000661a0 0x00000000 OBJT GLOB P 1 .got _GLOBAL_OFFSET_TABLE_
+
+Syminfo Section: .SUNW_syminfo
+ index flags bound to symbol
+ [1] DBL [1] libcrypto.so.1.0.0 EVP_DigestSignFinal
+ [2] DB <self> SSL_get_shared_ciphers
+ [3] DB <self> SSL_CTX_set_srp_client_pwd_callback
+ [4] DBL [1] libcrypto.so.1.0.0 SRP_Calc_client_key
+ [5] DB <self> _GLOBAL_OFFSET_TABLE_
+'''
+ fake_binary_elfinfo = {'opt/csw/lib/libssl.so.1.0.0': {
+ 'symbol table': [
+ {'shndx': 'UNDEF', 'soname': None, 'bind': 'LOCL',
+ 'symbol': None, 'version': None, 'flags': None, 'type': 'NOTY'},
+ {'shndx': 'UNDEF', 'soname': 'libcrypto.so.1.0.0', 'bind': 'GLOB',
+ 'symbol': 'EVP_DigestSignFinal', 'version': 'OPENSSL_1.0.0',
+ 'flags': 'DBL', 'type': 'FUNC'},
+ {'shndx': 'UNDEF', 'soname': 'libcrypto.so.1.0.0', 'bind': 'GLOB',
+ 'symbol': 'SRP_Calc_client_key', 'version': 'OPENSSL_1.0.1',
+ 'flags': 'DBL', 'type': 'FUNC'},
+ {'shndx': '.text', 'soname': None, 'bind': 'GLOB',
+ 'symbol': 'SSL_CTX_set_srp_client_pwd_callback',
+ 'version': 'OPENSSL_1.0.1', 'flags': 'DB', 'type': 'FUNC'},
+ {'shndx': '.text', 'soname': None, 'bind': 'GLOB',
+ 'symbol': 'SSL_get_shared_ciphers', 'version': 'OPENSSL_1.0.0',
+ 'flags': 'DB', 'type': 'FUNC'},
+ {'shndx': '.got', 'soname': None, 'bind': 'GLOB',
+ 'symbol': '_GLOBAL_OFFSET_TABLE_', 'version': None,
+ 'flags': 'DB', 'type': 'OBJT'},
+ ],
+ 'version definition': [
+ {'dependency': None, 'version': 'OPENSSL_1.0.0'},
+ {'dependency': 'OPENSSL_1.0.0', 'version': 'OPENSSL_1.0.1'},
+ ],
+ 'version needed': [
+ {'version': 'OPENSSL_1.0.0', 'soname': 'libcrypto.so.1.0.0'},
+ {'version': 'OPENSSL_1.0.1', 'soname': 'libcrypto.so.1.0.0'},
+ {'version': 'SUNW_1.9.1', 'soname': 'libnsl.so.1'},
+ ]
+ }
+ }
+
+ ip = inspective_package.InspectivePackage(fake_package_path)
+ self.mox.StubOutWithMock(ip, 'ListBinaries')
+ ip.ListBinaries().AndReturn([fake_binary])
+
+ self.mox.StubOutWithMock(inspective_package, 'ShellCommand')
+ args = [common_constants.ELFDUMP_BIN,
+ '-svy',
+ os.path.join(fake_package_path, "root", fake_binary)]
+ inspective_package.ShellCommand(args).AndReturn((0, fake_elfdump_output, ""))
+ self.mox.ReplayAll()
+
+ self.assertEqual(fake_binary_elfinfo, ip.GetBinaryElfInfo())
+
+
class PackageStatsUnitTest(unittest.TestCase):
def setUp(self):
self.ip = inspective_package.InspectivePackage("/fake/path/CSWfoo")
+ def test_ParseElfdumpLineSectionHeader(self):
+ line = 'Symbol Table Section: .dynsym'
+ self.assertEqual((None, "symbol table"), self.ip._ParseElfdumpLine(line, None))
+
+ def test_ParseElfdumpLineVersionNeeded(self):
+ line = '[13] SUNW_0.9 [ INFO ]'
+ expected = {
+ 'index': '13',
+ 'version': 'SUNW_0.9',
+ 'soname': None
+ }
+ self.assertEqual((expected, "version needed"), self.ip._ParseElfdumpLine(line, 'version needed'))
+
+ def test_ParseElfdumpLineSymbolTable(self):
+ line = ' [9] 0x000224b8 0x0000001c FUNC GLOB D 1 .text vsf_log_line'
+ expected = {
+ 'bind': 'GLOB',
+ 'shndx': '.text',
+ 'symbol': 'vsf_log_line',
+ 'version': '1',
+ 'type': 'FUNC',
+ }
+ self.assertEqual((expected, 'symbol table'), self.ip._ParseElfdumpLine(line, 'symbol table'))
+
+ def test_ParseElfdumpLineNeededSymbol(self):
+ line = ' [152] DB [4] libc.so.1 strlen'
+ expected = {
+ 'flags': 'DB',
+ 'soname': 'libc.so.1',
+ 'symbol': 'strlen',
+ }
+ self.assertEqual((expected, "syminfo"), self.ip._ParseElfdumpLine(line, "syminfo"))
+
+ def test_ParseElfdumpLineExportedSymbol(self):
+ line = ' [116] DB <self> environ'
+ expected = {
+ 'flags': 'DB',
+ 'soname': None,
+ 'symbol': 'environ',
+ }
+ self.assertEqual((expected, "syminfo"), self.ip._ParseElfdumpLine(line, "syminfo"))
+
def test_ParseNmSymLineGoodLine(self):
line = '0000097616 T aliases_lookup'
expected = {
Modified: csw/mgar/gar/v2/lib/python/package.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/package.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -42,6 +42,8 @@
class PackageError(Error):
pass
+class StdoutSyntaxError(Error):
+ pass
class CswSrv4File(shell.ShellMixin, object):
"""Represents a package in the srv4 format (pkg)."""
Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -25,6 +25,8 @@
from testdata.neon_stats import pkgstats as neon_stats
from testdata.bdb48_stats import pkgstat_objs as bdb48_stats
from testdata.mercurial_stats import pkgstat_objs as mercurial_stats
+from testdata.cadaver_stats import pkgstats as cadaver_stats
+from testdata.vsftpd_stats import pkgstats as vsftpd_stats
from testdata import stubs
DEFAULT_PKG_STATS = None
@@ -498,6 +500,13 @@
binaries_dump_info[0]["needed sonames"] = ["libdb-4.7.so"]
self.pkg_data["depends"] = (("CSWfoo", None),(u"CSWcommon", ""))
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["binaries_elf_info"]['opt/csw/bin/sparcv8/rsync'] = {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libdb-4.7.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libdb-4.7.so').AndReturn({
u'/opt/csw/lib': [u'CSWfoo'],
u'/opt/csw/lib/sparcv9': [u'CSWfoo'],
@@ -526,6 +535,13 @@
binaries_dump_info[0]["needed sonames"] = ["libdb-4.7.so"]
self.pkg_data["depends"] = (("CSWbad", None),(u"CSWcommon", ""))
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["binaries_elf_info"]['opt/csw/bin/sparcv8/rsync'] = {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libdb-4.7.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libdb-4.7.so').AndReturn({
u'/opt/csw/bdb47/lib': [u'CSWbad'],
u'/opt/csw/bdb47lib/sparcv9': [u'CSWbad'],
@@ -554,6 +570,15 @@
binaries_dump_info[0]["needed sonames"] = ["libdb-4.7.so"]
self.pkg_data["depends"] = (("CSWbad", None),(u"CSWcommon", ""))
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["binaries_elf_info"]['opt/csw/bin/sparcv8/rsync'] = {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [{ 'symbol': 'foo',
+ 'soname': 'libdb-4.7.so',
+ 'bind': 'GLOB',
+ 'shndx': 'UNDEF',
+ 'flags': 'DBL' }],
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libdb-4.7.so').AndReturn({
u'/opt/csw/bdb47/lib': [u'CSWbad'],
u'/opt/csw/bdb47lib/sparcv9': [u'CSWbad'],
@@ -591,6 +616,15 @@
binaries_dump_info[0]["needed sonames"] = ["libm.so.2"]
self.pkg_data["depends"] = ((u"CSWcommon", ""),)
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["binaries_elf_info"] = {
+ 'opt/csw/bin/sparcv8/rsync': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libm.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libm.so.2').AndReturn({
})
self.error_mgr_mock.GetPkgByPath(
@@ -634,6 +668,15 @@
}],
'depends': (('CSWlibfoo', None),),
'isalist': (),
+ 'ldd_info': { 'opt/csw/bin/bar': [] },
+ 'binaries_elf_info': { 'opt/csw/bin/bar': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libfoo.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ }
+ },
'pkgmap': [],
'files_metadata': [
{'endian': 'Little endian',
@@ -650,6 +693,7 @@
'binaries_dump_info': [],
'depends': [],
'isalist': (),
+ 'ldd_info': {},
'pkgmap': [],
}
@@ -687,6 +731,20 @@
# 'depends': (),
'depends': ((u"CSWcommon", ""),),
'isalist': ('foo'),
+ 'ldd_info': { 'opt/csw/bin/bar': [], 'opt/csw/lib/libfoo.so.1': []},
+ 'binaries_elf_info': { 'opt/csw/bin/bar': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libfoo.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ },
+ 'opt/csw/lib/libfoo.so.1': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [],
+ }
+ },
'pkgmap': [
{ 'path': '/opt/csw/lib/libfoo.so.1', },
{ 'path': '/opt/csw/bin/bar', },
@@ -712,6 +770,16 @@
binaries_dump_info[0]["path"] = 'opt/csw/lib/python/site-packages/foo.so'
self.pkg_data["depends"] = ((u"CSWcommon", "This one provides directories"),)
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["ldd_info"] = { 'opt/csw/lib/python/site-packages/foo.so': [] }
+ self.pkg_data["binaries_elf_info"] = {
+ 'opt/csw/lib/python/site-packages/foo.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libbar.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libbar.so').AndReturn({
u'/opt/csw/lib': [u'CSWlibbar'],
u'/opt/csw/lib/sparcv9': [u'CSWlibbar'],
@@ -738,6 +806,16 @@
binaries_dump_info[0]["path"] = 'opt/csw/lib/foo.so'
self.pkg_data["depends"] = ((u"CSWcommon","This is needed"),)
self.pkg_data["binaries_dump_info"] = binaries_dump_info[0:1]
+ self.pkg_data["ldd_info"] = { 'opt/csw/lib/foo.so': [] }
+ self.pkg_data["binaries_elf_info"] = {
+ 'opt/csw/lib/foo.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libnotfound.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' }
+ ]
+ }
+ }
self.error_mgr_mock.GetPathsAndPkgnamesByBasename(
'libnotfound.so').AndReturn({})
self.error_mgr_mock.GetPkgByPath(
@@ -1333,7 +1411,174 @@
self.error_mgr_mock.NeedFile(
mox.IsA(str), mox.IsA(unicode), mox.IsA(str))
+class TestCheckUnusedSoname(CheckTestHelper, unittest.TestCase):
+ FUNCTION_NAME = 'SetCheckLibraries'
+ def testUnusedSoname(self):
+ self.pkg_data = cadaver_stats
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libc.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libcrypto.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libcurses.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libdl.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libexpat.so.1').AndReturn({
+ "/opt/csw/lib": [u'CSWexpat'], u'/opt/csw/lib/sparcv9': [u'CSWexpat']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libiconv.so.2').AndReturn({
+ "/opt/csw/lib": [u'CSWlibiconv2'], u'/opt/csw/lib/sparcv9': [u'CSWlibiconv2']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libintl.so.8').AndReturn({
+ "/opt/csw/lib": (u"CSWggettextrt",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libm.so.2').AndReturn(
+ {'/lib': [u'SUNWlibmsr'],
+ '/lib/sparcv9': [u'SUNWlibmsr'],
+ '/usr/lib': [u'SUNWlibms'],
+ '/usr/lib/sparcv9': [u'SUNWlibms']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libmd.so.1').AndReturn(
+ {'/lib': [u'SUNWclsr'],
+ '/lib/sparcv9': [u'SUNWclsr'],
+ '/usr/lib': [u'SUNWcls'],
+ '/usr/lib/sparcv9': [u'SUNWcls']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libmp.so.2').AndReturn(
+ {'/lib': [u'SUNWclsr'],
+ '/lib/sparcv9': [u'SUNWclsr'],
+ '/usr/lib': [u'SUNWcls'],
+ '/usr/lib/sparcv9': [u'SUNWcls']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libncurses.so.5').AndReturn({
+ "/opt/csw/lib": [u'CSWlibncurses5'], u'/opt/csw/lib/sparcv9': [u'CSWlibncurses5']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libneon.so.27').AndReturn({
+ "/opt/csw/lib": [u'CSWlibneon27'], u'/opt/csw/lib/sparcv9': [u'CSWlibneon27']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libnsl.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libreadline.so.6').AndReturn({
+ "/opt/csw/lib": [u'CSWlibreadline6'], u'/opt/csw/lib/sparcv9': [u'CSWlibreadline6']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsocket.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libssl.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libz.so.1').AndReturn({
+ "/opt/csw/lib": (u"CSWlibz1",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibz1",),
+ "/usr/lib": (u"SUNWzlib")})
+
+
+ for common_path in ["/opt/csw/share/locale/it/LC_MESSAGES", "/opt/csw/bin",
+ "/opt/csw/share/locale/en at quot/LC_MESSAGES", "/opt/csw/share/man",
+ "/opt/csw/share/doc", "/opt/csw/share/locale/es/LC_MESSAGES"]:
+ self.error_mgr_mock.GetPkgByPath(common_path).AndReturn([u"CSWcommon"])
+
+ for i in range(21):
+ self.error_mgr_mock.NeedFile(
+ mox.IsA(str), mox.IsA(str), mox.IsA(str))
+
+ for soname in [ 'libcurses.so.1', 'libz.so.1', 'libssl.so.1.0.0',
+ 'libcrypto.so.1.0.0', 'libexpat.so.1' ]:
+ self.error_mgr_mock.ReportError(
+ 'CSWcadaver', 'soname-unused',
+ soname + ' is needed by /opt/csw/bin/cadaver but never used')
+
+class TestCheckDirectBinding(CheckTestHelper, unittest.TestCase):
+ FUNCTION_NAME = 'SetCheckLibraries'
+ def testDirectBinding(self):
+ self.pkg_data = vsftpd_stats
+
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libc.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libcrypto.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libnsl.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libpam.so.1').AndReturn({
+ "/usr/dt/lib": (u"SUNWdtbas",),
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),
+ })
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('librt.so.1').AndReturn({
+ '/usr/lib': [u'SUNWcsl'],
+ '/usr/lib/sparcv9': [u'SUNWcslx']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsendfile.so.1').AndReturn({
+ '/usr/lib': [u'SUNWcsl'],
+ '/usr/lib/sparcv9': [u'SUNWcslx']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsocket.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libssl.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+
+ for common_path in ["/opt/csw/share/man", "/var/opt/csw", "/opt/csw/sbin",
+ "/opt/csw/share/doc", "/etc/opt/csw"]:
+ self.error_mgr_mock.GetPkgByPath(common_path).AndReturn([u"CSWcommon"])
+
+ for soname in [ 'libnsl.so.1', 'libpam.so.1', 'libsocket.so.1', 'librt.so.1',
+ 'libsendfile.so.1', 'libssl.so.1.0.0', 'libcrypto.so.1.0.0',
+ 'libc.so.1' ]:
+ self.error_mgr_mock.NeedFile(
+ mox.IsA(str), mox.IsA(str), mox.IsA(str))
+
+ self.error_mgr_mock.ReportError(
+ 'CSWvsftpd',
+ 'no-direct-binding',
+ '/opt/csw/sbin/vsftpd is not directly bound to soname ' + soname)
+
+ def testDirectBindingNoSyminfo(self):
+ self.pkg_data = vsftpd_stats
+ self.pkg_data[0]['binaries_elf_info']['opt/csw/sbin/vsftpd'] = {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] }
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libc.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libcrypto.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libnsl.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libpam.so.1').AndReturn({
+ "/usr/dt/lib": (u"SUNWdtbas",),
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),
+ })
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('librt.so.1').AndReturn({
+ '/usr/lib': [u'SUNWcsl'],
+ '/usr/lib/sparcv9': [u'SUNWcslx']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsendfile.so.1').AndReturn({
+ '/usr/lib': [u'SUNWcsl'],
+ '/usr/lib/sparcv9': [u'SUNWcslx']})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libsocket.so.1').AndReturn({
+ "/usr/lib": (u"SUNWcsl",),
+ "/usr/lib/sparcv9": (u"SUNWcslx"),})
+ self.error_mgr_mock.GetPathsAndPkgnamesByBasename('libssl.so.1.0.0').AndReturn({
+ "/opt/csw/lib": (u"CSWlibssl1-0-0",),
+ "/opt/csw/lib/sparcv9": (u"CSWlibssl1-0-0",)})
+
+ for common_path in ["/opt/csw/share/man", "/var/opt/csw", "/opt/csw/sbin",
+ "/opt/csw/share/doc", "/etc/opt/csw"]:
+ self.error_mgr_mock.GetPkgByPath(common_path).AndReturn([u"CSWcommon"])
+
+ for soname in [ 'libnsl.so.1', 'libpam.so.1', 'libsocket.so.1', 'librt.so.1',
+ 'libsendfile.so.1', 'libssl.so.1.0.0', 'libcrypto.so.1.0.0',
+ 'libc.so.1' ]:
+ self.error_mgr_mock.NeedFile(
+ mox.IsA(str), mox.IsA(str), mox.IsA(str))
+
+ for soname in [ 'libpam.so.1', 'libnsl.so.1', 'libcrypto.so.1.0.0',
+ 'librt.so.1', 'libsendfile.so.1', 'libssl.so.1.0.0',
+ 'libsocket.so.1', 'libc.so.1' ]:
+ self.error_mgr_mock.ReportError(
+ 'CSWvsftpd',
+ 'no-direct-binding',
+ '/opt/csw/sbin/vsftpd is not directly bound to soname ' + soname)
+
+
class TestCheckWrongArchitecture(CheckTestHelper, unittest.TestCase):
FUNCTION_NAME = 'CheckWrongArchitecture'
def testSparcBinariesInIntelPackage(self):
Modified: csw/mgar/gar/v2/lib/python/package_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/package_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -208,6 +208,8 @@
"basic_stats": basic_stats,
"files_metadata": dir_pkg.GetFilesMetadata(),
"mtime": self.GetMtime(),
+ "ldd_info": dir_pkg.GetLddMinusRlines(),
+ "binaries_elf_info": dir_pkg.GetBinaryElfInfo(),
}
self.SaveStats(pkg_stats)
logging.debug("Statistics of %s have been collected.", repr(dir_pkg.pkgname))
@@ -379,7 +381,12 @@
line_u = pkgmap_entry["line"].decode("latin1")
f_path, basename = os.path.split(
pkgmap_entry["path"].decode('latin1'))
+ except UnicodeEncodeError, e:
+ # the line was already in unicode
+ line_u = pkgmap_entry['line']
+ f_path, basename = os.path.split(pkgmap_entry["path"])
# If this fails too, code change will be needed.
+
f = m.CswFile(
basename=basename,
path=f_path,
Modified: csw/mgar/gar/v2/lib/python/package_stats_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_stats_test.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/package_stats_test.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -60,6 +60,8 @@
mock_dirpkg.GetFilesContaining(mox.IsA(tuple)).AndReturn([])
mock_dirpkg.GetFilesMetadata().AndReturn([])
mock_srv4.GetMtime().AndReturn(datetime.datetime(2010, 12, 8, 7, 52, 54))
+ mock_dirpkg.GetLddMinusRlines().AndReturn({})
+ mock_dirpkg.GetBinaryElfInfo().AndReturn({})
pkgstats = package_stats.PackageStats(mock_srv4)
self.mox.ReplayAll()
data_structure = pkgstats._CollectStats(True)
Modified: csw/mgar/gar/v2/lib/python/testdata/apr_util_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/apr_util_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/apr_util_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -207,6 +207,40 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/lib/apr-util-1/apr_dbd_odbc-1.so': [],
+ 'opt/csw/lib/apr-util-1/apr_dbd_sqlite3-1.so': [],
+ 'opt/csw/lib/apr-util-1/apr_dbm_db-1.so': [],
+ 'opt/csw/lib/apr-util-1/apr_ldap-1.so': [],
+ 'opt/csw/lib/libaprutil-1.so.0.3.9': []},
+ 'binaries_elf_info': {'opt/csw/lib/apr-util-1/apr_dbd_odbc-1.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/apr-util-1/apr_dbd_sqlite3-1.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/apr-util-1/apr_dbm_db-1.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/apr-util-1/apr_ldap-1.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/libaprutil-1.so.0.3.9': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ },
+ 'binaries_dump_info': [{'RPATH set': True,
+ 'RUNPATH RPATH the same': True,
+ 'RUNPATH set': True,
+ 'base_name': 'apr_dbd_odbc-1.so',
+ 'needed sonames': ('libodbc.so.1', 'libc.so.1'),
+ 'path': 'opt/csw/lib/apr-util-1/apr_dbd_odbc-1.so',
+ 'runpath': ('/opt/csw/bdb47/lib', '/opt/csw/lib'),
+ 'soname': 'apr_dbd_odbc-1.so'},
'mtime': datetime.datetime(2010, 8, 27, 11, 0, 10),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/bdb48_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/bdb48_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/bdb48_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -745,6 +745,68 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/bdb48/bin/db_archive': [],
+ 'opt/csw/bdb48/bin/db_checkpoint': [],
+ 'opt/csw/bdb48/bin/db_deadlock': [],
+ 'opt/csw/bdb48/bin/db_dump': [],
+ 'opt/csw/bdb48/bin/db_hotbackup': [],
+ 'opt/csw/bdb48/bin/db_load': [],
+ 'opt/csw/bdb48/bin/db_printlog': [],
+ 'opt/csw/bdb48/bin/db_recover': [],
+ 'opt/csw/bdb48/bin/db_sql': [],
+ 'opt/csw/bdb48/bin/db_stat': [],
+ 'opt/csw/bdb48/bin/db_upgrade': [],
+ 'opt/csw/bdb48/bin/db_verify': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_archive': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_checkpoint': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_deadlock': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_dump': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_hotbackup': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_load': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_printlog': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_recover': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_sql': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_stat': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_upgrade': [],
+ 'opt/csw/bdb48/bin/sparcv9/db_verify': [],
+ 'opt/csw/bdb48/lib/libdb-4.8.so': [],
+ 'opt/csw/bdb48/lib/libdb_cxx-4.8.so': [],
+ 'opt/csw/bdb48/lib/libdb_java-4.8.so': [],
+ 'opt/csw/bdb48/lib/libdb_tcl-4.8.so': [],
+ 'opt/csw/bdb48/lib/sparcv9/libdb-4.8.so': [],
+ 'opt/csw/bdb48/lib/sparcv9/libdb_cxx-4.8.so': [],
+ 'opt/csw/bdb48/lib/sparcv9/libdb_java-4.8.so': []},
+ 'ldd_info': {'opt/csw/bdb48/bin/db_archive': {},
+ 'opt/csw/bdb48/bin/db_checkpoint': {},
+ 'opt/csw/bdb48/bin/db_deadlock': {},
+ 'opt/csw/bdb48/bin/db_dump': {},
+ 'opt/csw/bdb48/bin/db_hotbackup': {},
+ 'opt/csw/bdb48/bin/db_load': {},
+ 'opt/csw/bdb48/bin/db_printlog': {},
+ 'opt/csw/bdb48/bin/db_recover': {},
+ 'opt/csw/bdb48/bin/db_sql': {},
+ 'opt/csw/bdb48/bin/db_stat': {},
+ 'opt/csw/bdb48/bin/db_upgrade': {},
+ 'opt/csw/bdb48/bin/db_verify': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_archive': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_checkpoint': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_deadlock': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_dump': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_hotbackup': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_load': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_printlog': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_recover': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_sql': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_stat': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_upgrade': {},
+ 'opt/csw/bdb48/bin/sparcv9/db_verify': {},
+ 'opt/csw/bdb48/lib/libdb-4.8.so': {},
+ 'opt/csw/bdb48/lib/libdb_cxx-4.8.so': {},
+ 'opt/csw/bdb48/lib/libdb_java-4.8.so': {},
+ 'opt/csw/bdb48/lib/libdb_tcl-4.8.so': {},
+ 'opt/csw/bdb48/lib/sparcv9/libdb-4.8.so': {},
+ 'opt/csw/bdb48/lib/sparcv9/libdb_cxx-4.8.so': {},
+ 'opt/csw/bdb48/lib/sparcv9/libdb_java-4.8.so': {}},
'mtime': datetime.datetime(2010, 3, 2, 18, 9, 30),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/checkpkg_test_data_CSWdjvulibrert.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/checkpkg_test_data_CSWdjvulibrert.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/checkpkg_test_data_CSWdjvulibrert.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -111,6 +111,48 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/lib/libdjvulibre.so.15': [],
+ 'opt/csw/lib/sparcv9/libdjvulibre.so.21.1.0': [],
+ 'opt/csw/lib/libdjvulibre.so.21.1.0': [] },
+ 'binaries_elf_info': {
+ 'opt/csw/lib/libdjvulibre.so.15': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libjpeg.so.62', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libpthread.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libiconv.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libm.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCstd.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCrun.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ],
+ },
+ 'opt/csw/lib/sparcv9/libdjvulibre.so.21.1.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libjpeg.so.7', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libpthread.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libm.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCstd.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCrun.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ],
+ },
+ 'opt/csw/lib/libdjvulibre.so.21.1.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libjpeg.so.7', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libpthread.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libm.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCstd.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCrun.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ],
+ },
+ },
'overrides': [],
'pkginfo': {'ARCH': 'sparc',
'CATEGORY': 'application',
Modified: csw/mgar/gar/v2/lib/python/testdata/ivtools_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/ivtools_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/ivtools_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -56,6 +56,21 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/bin/comdraw': [],
+ 'opt/csw/lib/libComUnidraw.so.1.1.3': []},
+ 'binaries_elf_info': {'opt/csw/bin/comdraw': {
+ 'version definition': [],
+ 'version needed' : [],
+ 'symbol table': [
+ { 'soname': 'libComUnidraw.so', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' } ,
+ ],
+ },
+ 'opt/csw/lib/libComUnidraw.so.1.1.3': {
+ 'version definition': [],
+ 'version needed' : [],
+ 'symbol table': []
+ }
+ },
'overrides': [],
'pkgchk': {'return_code': 0,
'stderr_lines': ['rm: Cannot remove any directory in the path of the current working directory',
Modified: csw/mgar/gar/v2/lib/python/testdata/javasvn_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/javasvn_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/javasvn_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -86,6 +86,41 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/lib/svn/libsvnjavahl-1.so.0.0.0': []},
+ 'binaries_elf_info': {
+ 'opt/csw/lib/svn/libsvnjavahl-1.so.0.0.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libintl.so.8', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_repos-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_client-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_wc-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_ra-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_delta-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_diff-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_subr-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsvn_fs-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libaprutil-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libldap-2.4.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'liblber-2.4.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libexpat.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libiconv.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libapr-1.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libuuid.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsendfile.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'librt.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libpthread.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libdl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libneon.so.27', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCstd.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libCrun.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ }
+ },
'mtime': datetime.datetime(2010, 7, 12, 19, 6, 15),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/libnet_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/libnet_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/libnet_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -31,6 +31,8 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {},
+ 'binaries_elf_info': {},
'mtime': datetime.datetime(2008, 8, 20, 10, 26, 15),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/mercurial_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/mercurial_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/mercurial_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -703,6 +703,41 @@
'sparcv9',
'sparcv9+vis',
'sparcv9+vis2']),
+ 'ldd_info': {
+ 'opt/csw/lib/python/site-packages/mercurial/base85.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/bdiff.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/diffhelpers.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/mpatch.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/osutil.so': [],
+ 'opt/csw/lib/python/site-packages/mercurial/parsers.so': [],},
+ 'binaries_elf_info': { 'opt/csw/lib/python/site-packages/mercurial/base85.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/python/site-packages/mercurial/bdiff.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': []
+ },
+ 'opt/csw/lib/python/site-packages/mercurial/diffhelpers.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/python/site-packages/mercurial/mpatch.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [] },
+ 'opt/csw/lib/python/site-packages/mercurial/osutil.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': []
+ },
+ 'opt/csw/lib/python/site-packages/mercurial/parsers.so': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': []
+ },
+ },
'mtime': datetime.datetime(2011, 2, 15, 7, 46, 49),
'overrides': [{'pkgname': 'CSWmercurial',
'tag_info': None,
Modified: csw/mgar/gar/v2/lib/python/testdata/neon_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/neon_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/neon_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -163,6 +163,34 @@
'pentium+mmx',
'pentium_pro',
'pentium_pro+mmx']),
+ 'ldd_info': {
+ 'opt/csw/lib/libneon.so.26.0.4': [],
+ 'opt/csw/lib/libneon.so.27.2.0': [],
+ 'opt/csw/lib/sparcv9/libneon.so.26.0.4': [],
+ 'opt/csw/lib/sparcv9/libneon.so.27.2.0': [],
+ },
+ 'binaries_elf_info': {
+ 'opt/csw/lib/libneon.so.26.0.4': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [],
+ },
+ 'opt/csw/lib/libneon.so.27.2.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [],
+ },
+ 'opt/csw/lib/sparcv9/libneon.so.26.0.4': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [],
+ },
+ 'opt/csw/lib/sparcv9/libneon.so.27.2.0': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [],
+ },
+ },
'mtime': datetime.datetime(2009, 9, 23, 20, 21, 14),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/rsync_pkg_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/rsync_pkg_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/rsync_pkg_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -74,6 +74,36 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {
+ 'opt/csw/bin/sparcv8/rsync': [],
+ 'opt/csw/bin/sparcv9/rsync': [],
+ },
+ 'binaries_elf_info': {
+ 'opt/csw/bin/sparcv8/rsync': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libpopt.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsec.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libiconv.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ },
+ 'opt/csw/bin/sparcv9/rsync': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libpopt.so.0', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsec.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libiconv.so.2', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ }
+ },
'overrides': [],
'pkgchk': {'return_code': 0,
'stderr_lines': ['rm: Cannot remove any directory in the path of the current working directory',
Modified: csw/mgar/gar/v2/lib/python/testdata/sudo_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/sudo_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/sudo_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -71,6 +71,27 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {
+ 'opt/csw/libexec/sudo_noexec.so': [],
+ 'opt/csw/sbin/visudo': [],
+ },
+ 'binaries_elf_info': {'opt/csw/libexec/sudo_noexec.so': {
+ 'version needed': [],
+ 'version definition': [],
+ 'symbol table': [
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' } ],
+ },
+ 'opt/csw/sbin/visudo': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libintl.so.8', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ],
+ }
+ },
'mtime': datetime.datetime(2010, 3, 2, 22, 34, 40),
'overrides': [],
'pkgchk': {'return_code': 0,
@@ -292,6 +313,21 @@
'sparcv8-fsmuld',
'sparcv7',
'sparc'),
+ 'ldd_info': {'opt/csw/bin/sudo.minimal': []},
+ 'binaries_elf_info': {
+ 'opt/csw/bin/sudo.minimal': {
+ 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [
+ { 'soname': 'libpam.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libdl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libintl.so.8', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libsocket.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libnsl.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ { 'soname': 'libc.so.1', 'symbol': 'foo', 'flags': 'DBL', 'shndx': 'UNDEF', 'bind': 'GLOB' },
+ ]
+ }
+ },
'mtime': datetime.datetime(2010, 3, 2, 22, 34, 39),
'overrides': [],
'pkgchk': {'return_code': 0,
Modified: csw/mgar/gar/v2/lib/python/testdata/tree_stats.py
===================================================================
--- csw/mgar/gar/v2/lib/python/testdata/tree_stats.py 2013-01-05 14:21:58 UTC (rev 20036)
+++ csw/mgar/gar/v2/lib/python/testdata/tree_stats.py 2013-01-05 15:35:32 UTC (rev 20037)
@@ -47,6 +47,17 @@
'sparcv9',
'sparcv9+vis',
'sparcv9+vis2']),
+ 'ldd_info': {'opt/csw/bin/tree': [] },
+ 'binaries_elf_info': { 'opt/csw/bin/tree': { 'version definition': [],
+ 'version needed': [],
+ 'symbol table': [ { 'flags': 'DBL',
+ 'soname': 'libc.so.1',
+ 'symbol': 'environ',
+ 'shndx': 'UNDEF',
+ 'version': None
+ } ]
+ }
+ },
'mtime': datetime.datetime(2010, 7, 5, 23, 48, 10),
'overrides': [],
'pkgchk': {'return_code': 0,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list