aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* MFC r250075:Konstantin Belousov2013-05-021-1/+2
| | | | | | | Properly terminate the result string for intermediate results. Notes: svn path=/stable/9/; revision=250170
* MFC r249525:Konstantin Belousov2013-04-291-73/+75
| | | | | | | | Rewrite origin_subst_one() to get rid of the wrong limit on the length of the resulting string. Notes: svn path=/stable/9/; revision=250040
* MFC r247396:Tijl Coosemans2013-03-051-1/+1
| | | | | | | | | | | | Map libraries linked with -Ttext-segment=base_addr at base_addr. Normal libraries have base address 0 and are unaffected by this change. PR: 176216 Submitted by: Damjan Jovanovic <damjan.jov@gmail.com> Reviewed by: kib Notes: svn path=/stable/9/; revision=247846
* MFC: r235857Marius Strobl2013-03-021-8/+4
| | | | | | | mdoc: Only use macros inside a reference block. Notes: svn path=/stable/9/; revision=247650
* MFC: r246106, r246139Marius Strobl2013-03-024-16/+18
| | | | | | | Mark tftp_log() as __printflike() and deal with the fallout. Notes: svn path=/stable/9/; revision=247644
* MFC: r229780 (partial)Marius Strobl2013-03-022-4/+4
| | | | | | | Spelling fixes for libexec/ Notes: svn path=/stable/9/; revision=247641
* MFC: r241720 (partial)Marius Strobl2013-03-023-5/+5
| | | | | | | Fix warnings found by -Wmising-variable-declarations. Notes: svn path=/stable/9/; revision=247638
* MFC: r235643Marius Strobl2013-03-021-1/+3
| | | | | | | Properly use LDADD & DPADD to link against libwrap. Notes: svn path=/stable/9/; revision=247637
* MFC r246880:Dimitry Andric2013-02-262-10/+0
| | | | | | | | | Since clang 3.2 now has an option to suppress warnings about implicitly promoted K&R parameters, remove the workarounds added for sendmail components in r228558. Notes: svn path=/stable/9/; revision=247333
* MFC r244686 to stable/9:Antoine Brodin2013-02-021-2/+1
| | | | | | | | | | | Use correct size in snprintf. Remove unused buffer. PR: 174631 Submitted by: Henning Petersen Notes: svn path=/stable/9/; revision=246253
* MFC r242372:Mateusz Guzik2012-11-132-2/+21
| | | | | | | | | | | | atrun(8): scale default load average limit with the number of CPUs Previously atrun refused to run jobs if load average was not below fixed limit of 1.5. PR: 173175 Approved by: trasz (mentor) Notes: svn path=/stable/9/; revision=242990
* MFC r241848:Eitan Adler2012-10-271-1/+4
| | | | | | | | | | | | Check the return error of set[e][ug]id. While this can never fail in the current version of FreeBSD, this isn't guarenteed by the API. Custom security modules, or future implementations of the setuid and setgid may fail. Approved by: cperciva (implicit) Notes: svn path=/stable/9/; revision=242166
* MFC r240974: atrun: Do not assume that MAXLOGNAME <= 100.Jilles Tjoelker2012-10-051-1/+1
| | | | | | | | | | | The reserved space for fmt was exactly sufficient for a two-digit value of MAXLOGNAME - 1. PR: bin/171815 Submitted by: Jeremy Huddleston Sequoia Notes: svn path=/stable/9/; revision=241226
* MFC r240090:Doug Barton2012-10-041-28/+26
| | | | | | | Improve file rotation Notes: svn path=/stable/9/; revision=241205
* MFC r240686:Konstantin Belousov2012-09-221-4/+4
| | | | | | | | | | Do not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOAD for a non-absolute path. PR: bin/171604 Notes: svn path=/stable/9/; revision=240801
* MFC r240506:Eitan Adler2012-09-172-2/+2
| | | | | | | | | | Bump date missed in r202756 PR: docs/171624 Approved by: cperciva (implicit) Notes: svn path=/stable/9/; revision=240582
* MFC r238471:Konstantin Belousov2012-09-103-72/+276
| | | | | | | | | | | Implement DT_RUNPATH and -z nodefaultlib. MFC note: The ld_library_path_rpath default value was flipped to true, effectively reverting rtld back to the pre-patch behaviour, unless LD_LIBRARY_PATH_RPATH environment variable is set and its value is 0/N/n. Notes: svn path=/stable/9/; revision=240308
* MFC r239470: Do not call process_nodelete with NULL object pointer.Alexander Kabaev2012-08-201-1/+2
| | | | | | | | | | | The place where the function is called can be reached if object loading and relocation fails too, in which case obj pointer will be NULL. Do not call process_nodelete then, or crash will follow. Pointy hat to: kan Notes: svn path=/stable/9/; revision=239471
* MFC r239253: Pospone the DF_1_NODELETE processing until object DAG isAlexander Kabaev2012-08-201-7/+27
| | | | | | | | | | fully loaded. Trying to up the reference from the load loop risks missing dependencies that have not been loaded yet. Notes: svn path=/stable/9/; revision=239439
* MFC r239019: Parse notes only after object structure had been allocated.Alexander Kabaev2012-08-201-2/+2
| | | | Notes: svn path=/stable/9/; revision=239435
* MFC r231973: Avoid error log for transfer stop w/o error code.Ed Maste2012-08-201-1/+2
| | | | | | | | | | | | | A number of tftp clients, including the one in Intel's pxe boot loader, may intentionally stop a transfer using error code 0 (i.e., EUNDEF). These are not real errors. Avoid spamming log files with these by logging them at level LOG_DEBUG instead. Discussed on -hackers with an initial patch proposal; this change is an improved approach suggested by kan@. Notes: svn path=/stable/9/; revision=239432
* MFH r236751: document sha256 / sha512 supportDag-Erling Smørgrav2012-07-151-1/+0
| | | | | | | | | | | MFH r236892: remove mention of auth.conf from programs that don't use it MFH r236963: remove dead code relating to auth.conf MFH r236965 r236966 r236967 r237005 r237006 r237011: retire auth.conf Approved by: re Notes: svn path=/stable/9/; revision=238481
* MFC r237659:Konstantin Belousov2012-07-051-40/+84
| | | | | | | | | | Ensure that for the object which is a dependency for some filtee, relocations are performed before the object's initializer is called. Approved by: re (kensmith) Notes: svn path=/stable/9/; revision=238133
* MFC r237058:Konstantin Belousov2012-06-281-62/+70
| | | | | | | | | | | | | | | Eliminate the static buffer used to read the first page of the mapped object, and eliminate the pread(2) call as well. Mmap the first page of the object temporaly, and unmap it on error or last use. Potentially, this leaves one-page gap between succeeding dlopen(3), but there are other mmap(2) consumers as well. Fix several cases were the whole mapping of the object leaked on error. Use MAP_PREFAULT_READ for mmap(2) calls which map real object pages Notes: svn path=/stable/9/; revision=237712
* MFC: r231618, r233231 (partial)Marius Strobl2012-06-213-10/+83
| | | | | | | | | | Add thread-local storage support for ARM to rtld-elf Reviewed by: cognet Obtained from: NetBSD Notes: svn path=/stable/9/; revision=237394
* MFC r233648:Eitan Adler2012-06-181-3/+3
| | | | | | | | | Remove trailing whitespace per mdoc lint warning Approved by: cperciva (implicit) Notes: svn path=/stable/9/; revision=237216
* MFC: 234851, 235059Baptiste Daroussin2012-06-031-30/+132
| | | | | | | | | | | | | | | | | Add two special directives to libmap.conf: include <file>: Parse the contents of file before continuing with the current file. includedir <dir>: Parse the contents of every file in dir that ends in .conf before continuing with the current file. Any file or directory encountered while processing include or includedir directives will be parsed exactly once, even if it is encountered multiple times. Approved by: des (mentor) Notes: svn path=/stable/9/; revision=236523
* MFC r234840:Konstantin Belousov2012-05-139-113/+280
| | | | | | | | | | | | | | | | | Split the symlook_obj1 into a loop iterating over the ELF object symbol hash elements, and a helper matched_symbol() which match the given hash entry and request, performing needed type and version checks. MFC r234841: Add GNU hash support for rtld. MFC r235054: Work around a situation where symlook_obj() could be called for the object for which digest_dynamic1() was not done yet. Just return EINVAL and do not try to dereference NULL buckets hash array. Notes: svn path=/stable/9/; revision=235396
* MFC r234170:Konstantin Belousov2012-04-191-16/+23
| | | | | | | | | | Propagate the current state of rtld_bind_lock to dlopen_object() calls through the filter loading call chain. This fixes attempts to write-lock the already locked rtld_bind_lock when filter loading is initiated by relocation of dlopening dso. Notes: svn path=/stable/9/; revision=234454
* MFC r233927:Konstantin Belousov2012-04-081-1/+2
| | | | | | | Properly handle absent AT_CANARY aux entry. Notes: svn path=/stable/9/; revision=234012
* MFC r233431:Konstantin Belousov2012-04-072-1/+2
| | | | | | | | Remove libssp_nonshared from the rtld linking set. The only use for the library was definition for the weak alias of __stack_chk_fail. Notes: svn path=/stable/9/; revision=233987
* MFC r233430:Konstantin Belousov2012-04-071-0/+11
| | | | | | | Provide short-circuit exit(3) implementation for rtld. Notes: svn path=/stable/9/; revision=233986
* MFC r233361:Konstantin Belousov2012-04-061-10/+10
| | | | | | | Remove superfluous extern keywords. Notes: svn path=/stable/9/; revision=233935
* MFC r233360:Konstantin Belousov2012-04-061-2/+3
| | | | | | | Centralize the calculation of the top source directory. Notes: svn path=/stable/9/; revision=233934
* MFC r233357:Konstantin Belousov2012-04-061-7/+8
| | | | | | | | Implement xstrdup() using strlen()/xmalloc()/memcpy() already presented in rtld, instead of pulling in libc strdup(). Notes: svn path=/stable/9/; revision=233933
* MFC r233307:Konstantin Belousov2012-04-055-19/+20
| | | | | | | | | | | | | | | Use xmalloc() instead of malloc() in the places where malloc() calls are assumed to not fail. Make the xcalloc() calling conventions follow the calloc(3) calling conventions and replace unchecked calls to calloc() with calls to xcalloc(). Remove redundand declarations from xmalloc.c, which are already present in rtld.h. Notes: svn path=/stable/9/; revision=233922
* MFC r233306:Konstantin Belousov2012-04-051-18/+0
| | | | | | | Remove the fragments which are not needed on FreeBSD. Notes: svn path=/stable/9/; revision=233921
* MFC r233655:Konstantin Belousov2012-04-031-1/+12
| | | | | | | | | | Add a special case in do_dlsym() for TLS stored symbols. MFC r233674: Fix ia64 build after r233655. Notes: svn path=/stable/9/; revision=233833
* MFC r233546:Konstantin Belousov2012-04-032-0/+5
| | | | | | | | Prevent rtld_verify_object_versions() from being called several times for the same object. Notes: svn path=/stable/9/; revision=233832
* MFC r233231:Konstantin Belousov2012-04-0310-113/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix several problems with our ELF filters implementation. Do not relocate twice an object which happens to be needed by loaded binary (or dso) and some filtee opened due to symbol resolution when relocating need objects. Record the state of the relocation processing in Obj_Entry and short-circuit relocate_objects() if current object already processed. Do not call constructors for filtees loaded during the early relocation processing before image is initialized enough to run user-provided code. Filtees are loaded using dlopen_object(), which normally performs relocation and initialization. If filtee is lazy-loaded during the relocation of dso needed by the main object, dlopen_object() runs too earlier, when most runtime services are not yet ready. Postpone the constructors call to the time when main binary and depended libraries constructors are run, passing the new flag RTLD_LO_EARLY to dlopen_object(). Symbol lookups callers inform symlook_* functions about early stage of initialization with SYMLOOK_EARLY. Pass flags through all functions participating in object relocation. Use the opportunity and fix flags argument to find_symdef() in arch-specific reloc.c to use proper name SYMLOOK_IN_PLT instead of true, which happen to have the same numeric value. MFC r233777 (by kan): Do not try to adjust stacks if dlopen_object is called too early. MFC r233778 (by kan): Remove extra blank line from revious commit. MFC note: the ARM and MIPS TLS support is not merged back, so the chunks from r233231 which fix misuse of flags in calls to find_symdef() in the corresponding relocation type handlers were not applied. When TLS support is merged, the rest of r233231 should be applied too. Notes: svn path=/stable/9/; revision=233831
* MFC r232974:Konstantin Belousov2012-03-304-11/+22
| | | | | | | | | Stop using strerror(3) in rtld, which brings in msgcat and stdio. Directly access sys_errlist array of errno messages with private rtld_strerror() function. Notes: svn path=/stable/9/; revision=233697
* MFC r232862:Konstantin Belousov2012-03-301-72/+76
| | | | | | | | Do not use stdio for libmap.conf read. Directly map the file and parse lines from the mappings. Notes: svn path=/stable/9/; revision=233696
* MFC r232861:Konstantin Belousov2012-03-301-0/+40
| | | | | | | | | Provide rtld-private implementations of __stack_chk_guard, __stack_chk_fail() and __chk_fail() symbols, to be used by functions linked from libc_pic.a. Notes: svn path=/stable/9/; revision=233695
* MFC r232831:Konstantin Belousov2012-03-3013-14/+233
| | | | | | | | | | | | | | | | | | | | | Add support for preinit, init and fini arrays to rtld. Only binaries marked with proper ABI note gets array ctr/dtrs called. MFC r232856: When iterating over the dso program headers, the object is not initialized yet, and object segments are not yet mapped. Only parse the notes that appear in the first page of the dso (as it should be anyway), and use the preloaded page content. MFC r232857 (by dim): Fix a warning/error with clang. MFC r232859 (by dim): Amend r232857, now dropping the casts entirely, as they were not necessary at all. Notes: svn path=/stable/9/; revision=233694
* MFC r233041:Konstantin Belousov2012-03-191-2/+0
| | | | | | | Remove write-only variable. Notes: svn path=/stable/9/; revision=233170
* MFC r232777:Konstantin Belousov2012-03-171-9/+22
| | | | | | | Optimize tls_get_addr_common(). Notes: svn path=/stable/9/; revision=233063
* MFC r232729:Konstantin Belousov2012-03-161-5/+7
| | | | | | | Remove the use of toupper() from rtld_printf.c. Notes: svn path=/stable/9/; revision=233029
* MFC r232263:Dimitry Andric2012-03-132-6/+2
| | | | | | | | | | | | | | | | | | | | | | | Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to get rid of testing explicitly for clang (using ${CC:T:Mclang}) in individual Makefiles. Instead, use the following extra macros, for use with clang: - NO_WERROR.clang (disables -Werror) - NO_WCAST_ALIGN.clang (disables -Wcast-align) - NO_WFORMAT.clang (disables -Wformat and friends) - CLANG_NO_IAS (disables integrated assembler) - CLANG_OPT_SMALL (adds flags for extra small size optimizations) As a side effect, this enables setting CC/CXX/CPP in src.conf instead of make.conf! For clang, use the following: CC=clang CXX=clang++ CPP=clang-cpp Notes: svn path=/stable/9/; revision=232930
* MFC r232572:Konstantin Belousov2012-03-121-10/+15
| | | | | | | | | | | Use hand-made isspace1() macro which is enough to detect spaces in libmap.conf. MFC r232590 (by pluknet): Rename isspace1() macro to the more appropriate rtld_isspace(). Notes: svn path=/stable/9/; revision=232863
* MFC r231582:Konstantin Belousov2012-02-161-0/+1
| | | | | | | | | | Add missed EOL when die() was converted to use rtld_fdputstr() instead of errx(). PR: bin/165075 Notes: svn path=/stable/9/; revision=231820