Commit graph

180 commits

Author SHA1 Message Date
khorben
b6f9200eca Also check for RELRO in shared libraries 2017-07-05 15:49:00 +00:00
khorben
b6e04d7b1c Only check ELF binaries for RELRO 2017-07-05 15:24:22 +00:00
khorben
ca2b8ac385 Implement a check for RELRO
This is only performed if PKG_DEVELOPER and RELRO are in use.

After a suggestion during my talk at BSDCan 2017; thanks!
Also, submitted on tech-pkg@ for review mid-June.

As a next step, it seems this can be extended to libraries, just like the
check for SHLIBS does (from which this is inspired).
2017-07-04 18:29:24 +00:00
prlw1
5c827f6f0e Essentially from OBATA Akio in private mail, June 2015:
Introduce Icon Theme cache handling framework

Icon Theme cache files are used by GTK+ and maintained with the
gtk-update-icon-cache tool.  Each Icon Theme package duplicates
its own maintainance scripts: only the specified icon theme directory
differs.  With this framework, if packages have ICON_THEMES=yes,
associated icon themes will be detected and their cache files will
be maintained automatically.

Change cache handling behaviour as follows:
* Icon theme caches will be updated if either gtk2+ or gtk3+
  gtk-update-icon-cache tool is available.
* With installation of gtk2+ package, not only hicolor icon theme but
  also any other icon theme cache files will be updated.
* Prevent removal of icon caches at deinstall, gtk3+ may be installed and
  using them.
* Ditto with gtk3+, gtk2+ may not be installed now, so caches must be
  maintained by gtk3+.
2017-06-14 16:23:09 +00:00
jlam
0a676f1f26 Provide switch to activate new frameworks to replace "pkginstall".
If ${_USE_NEW_PKGINSTALL} is "yes", then use the new "pkgtasks",
"init", and "pkgformat/pkg"-scripts frameworks instead of the
existing "pkginstall" framework.
2017-06-01 02:15:10 +00:00
jlam
d8e9bb513c Check that some variables have the correct number of words.
Assert MAKE_DIRS_PERMS and OWN_DIRS_PERMS have the right number of
words before using a multivariable .for loop over those variables.
This prevents errors in parsing the makefiles.
2017-05-31 22:56:22 +00:00
jperkin
1421ba461a Introduce CHECK_SHLIBS_BLACKLIST which allows users to specify a list of
regexps that will cause the checks to fail if they match resolved RPATHs.
2017-05-03 13:46:53 +00:00
jperkin
c4f4067d45 Only perform the CHECK_WRKREF_EXTRA_DIRS check on the resolved path rather
than on all of the rpaths.  We can't always exclude the rpath being added,
for example when the compiler adds its own behind our back, so this avoids
false positives.
2017-04-26 11:19:16 +00:00
rillig
e120f955f9 Fixed typo. 2017-04-01 20:55:39 +00:00
adam
99864d3ee3 Fix for otool from Xcode 8.0 2016-08-20 18:52:42 +00:00
joerg
639d5b402f Remove support for USE_DESTDIR=no. 2016-04-10 15:58:02 +00:00
dholland
69936c6955 Explicitly skip directories. PR 50955. 2016-03-11 21:11:47 +00:00
jperkin
640104b74c Reset 'found' variable for each library check. Previously, all subsequent
tests would pass after the first successful check.  Exposes library issues
in a number of packages.
2016-03-10 15:56:24 +00:00
jklos
85563e4143 Fix issue with VAX when awk's split is called with empty string. 2016-02-24 08:54:23 +00:00
jperkin
f946849744 Add an additional check to ensure that library REQUIRES are not relative
paths.  These would previously pass the checks as the files would exist
when checking from within the DESTDIR, but were not resolvable at runtime.
2016-02-19 15:10:23 +00:00
jperkin
454f6fae69 Perform interpreter sed(1) check with LC_ALL=C, avoids failures on newer
Darwin releases with "sed: RE error: illegal byte sequence".
2015-11-27 12:45:04 +00:00
jperkin
266de5d44b Do the "defined && !empty" dance for NetBSD 5 make. 2015-11-24 09:41:20 +00:00
jperkin
c2fe79eceb Add support for CHECK_WRKREF_EXTRA_DIRS to check-shlibs. If "extra" is
listed in CHECK_WRKREF then these directories will added to the checks
for rpath references.
2015-11-16 17:53:29 +00:00
jperkin
f648dfa7c3 Introduce support for checking Mach-O dynamic libraries.
This works in a similar way to the ELF checks, but uses otool(1) to list the
library name and its dependencies, and the checks fail if there are WRKDIR
references or if the -install_name of the library does not match $PREFIX, as
well as ensuring that any libraries from pkgsrc are correctly registered as
full dependencies.

Removes support for the user to set USE_CHECK_SHLIBS_ELF, but there were no
reasonable reasons for doing so in the past anyway, and it may be masking
issues in platform files we should fix.
2015-08-17 17:35:23 +00:00
jperkin
6652f12ad9 Fix check-shlibs regular expression to match .dylib/.sl the same as .so 2015-08-17 16:39:13 +00:00
jperkin
9bf217a5cb Fix typo in local variable name. 2015-08-10 15:11:47 +00:00
jperkin
7ef3ff730f Use a single egrep and regexp instead of iterating over the list of files to
check and calling grep on each of them.  Idea for using ":ts|" from Joerg.

Reduces the test runtime by around 50%, depending on platform and package.
2015-04-29 13:39:43 +00:00
jperkin
bb4c5026e6 Only check executable files for valid interpreters. By the time this check is
performed all installed files should have their correct mode set, and there are
no INSTALL scripts that currently change file modes under PREFIX after
installation (nor should they ever).

This change considerably speeds up the test.  For example in www/firefox-l10n
the time to run the test reduces from 181 seconds (135 seconds of system time)
down to 10 seconds (6 seconds system time) on my SmartOS build systems.
2015-04-29 13:05:28 +00:00
jperkin
d460a8ce9f Remove obsolete bulk build variables. 2015-02-16 10:42:00 +00:00
obache
d1dc7d256d Revert "Drop obsolated old bulk build related variable settings."
proposed/discussed is required for such changes.
2015-02-01 11:42:59 +00:00
obache
da209eba3e Drop obsolated old bulk build related variable settings. 2014-11-21 10:46:36 +00:00
joerg
c6e1b83d1b Simplify PKG_DEVELOPER checks. 2014-10-12 23:39:17 +00:00
jperkin
5d44125c9b Cache the results of getline and system() calls. Testing with
x11/kde-workspace4 shows a 25x performance improvement, reducing the
runtime of _check-shlibs from 7m55s to just 18s.
2014-10-03 19:12:16 +00:00
jperkin
d72afedf87 Fix the readelf environment variable. 2014-10-01 08:59:33 +00:00
jperkin
47e3447cf5 Set nrpath correctly in the case where there is no RPATH at all. Fixes
issues seen on NetBSD.
2014-09-07 21:53:41 +00:00
jperkin
800bdaa968 Ensure we iterate over the RPATH in search order, rather than relying on
awk array iteration which could result in the wrong library being chosen.

Fixes issue seen with GCC 4.9 where the libgcc from the main GCC package
was found first and caused errors, even though the RPATH correctly had
the gcc49-libs version listed first.
2014-09-06 16:57:51 +00:00
jperkin
a4e43767b4 Add a 'wrappers' option for CHECK_WRKREF which, if enabled, will check for
references to ${WRAPPER_DIR}.

Update the error message when an invalid CHECK_WRKREF option is used.
2014-09-04 16:09:33 +00:00
richard
8a4981f558 use configured in check-perms 2014-05-09 11:59:27 +00:00
ryoon
370bb25b4d Revert rev. 1.5 2014-03-11 23:27:40 +00:00
ryoon
88465f1339 Revert rev. 1.5 and 1.6
The change introduced in rev. 1.5 disables portability check.
2014-03-11 23:23:01 +00:00
ryoon
5b659c4f2a Fix "illegal reference to local variable word" error with lang/nawk
under Debian GNU/Linux 7.4.
lang/nawk's length(array) does not work as expected. So length(array) make
array as usual variable.
2014-03-11 21:32:11 +00:00
obache
e98bbce8cb Imprement CHECK_SHLIBS_SKIP, same as other CHECK_*_SKIP. 2014-03-02 05:43:16 +00:00
jklos
3e9df3ec81 Fixes floating point exceptions on VAX. 2014-03-01 17:57:01 +00:00
obache
0e0d049625 Prevent _CHECK_FILES_{PRE,POST} to include check-files-{pre,post}-message
target, it is unwanted in check-files-clean target.
2014-02-20 09:15:15 +00:00
joerg
71bda04a66 Some Linux systems now use DT_RUNPATH, so match it here as well. 2013-10-25 14:11:13 +00:00
obache
add5c36964 drop `file' command from default USE_TOOLS list.
It is used in limited case, and does not exist by default on some platforms.
proposed at over 30 months ago, and no negative feedback (only one request).
2013-05-12 06:17:50 +00:00
riastradh
9e0c502480 Split BUILD_DEPENDS into TOOL_DEPENDS and BUILD_DEPENDS in mk/.
Build depends are target packages that are needed at build-time for,
e.g., static libraries to link against, header files to include, &c.
Tool depends are native packages that are needed at build-time for,
e.g., compilers/linkers/&c. to run.

ok agc
2013-05-09 23:37:25 +00:00
wiz
3ca0214c05 Add DESTDIR to error message in case of PLIST mismatch.
Noted by Edgar Fuß.
2013-03-08 15:32:52 +00:00
obache
354965a339 skip symbolic link for shlibs check, it may point to absolute path and currently
installed old version's file.
2013-02-20 06:00:51 +00:00
jperkin
568e518ff4 Don't print the /bin/sh warning on SunOS-5.11, where /bin/sh is ksh93. 2013-01-04 10:51:57 +00:00
joerg
86a1f7d707 Expand the list of full dependencies, so that the shared library check
can work without further calls for indirect full dependencies.
2012-07-02 14:53:13 +00:00
obache
746a40d55d Revert last change.
Honor dicision of the copyright holder.
2012-06-16 11:58:07 +00:00
obache
36a4eb2941 allow DSO in not only non-full dependency packages but also indirect full dependency. 2012-06-15 14:46:53 +00:00
joerg
bd737b69e2 Extend shared library check to all files that match *.so. 2012-05-29 21:53:55 +00:00
marino
9220ff46a6 mk/check/check-files.mk: Skip locale.alias
On DragonFly, packages like devel/doc++ and net/wap-utils were failing the
file check during installation due to a present locale.alias file.  Treat
it the same as charset.alias.
2012-05-22 07:59:31 +00:00