aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Don't save entropy inside jails.Xin LI2014-07-221-0/+2
| | | | | | | | | | | | | As of r126744, we no longer feed the entropy device in jails upon start, and collecting them is no longer useful. PR: conf/126744 Submitted by: Eugene Grosbein <eugen grosbein net> (with minor changes) MFC after: 1 week Approved by: so (des) Notes: svn path=/head/; revision=268979
* Replace all uses of libncurses and libtermcap with their wide characterBrooks Davis2014-07-171-2/+2
| | | | | | | | | | | | | variants. This allows usable file system images (i.e. those with both a shell and an editor) to be created with only one copy of the curses library. Exp-run: antoine PR: 189842 Discussed with: bapt Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=268804
* libpythagoras needs libm.Julio Merino2014-07-161-0/+3
| | | | | | | | This fixes "make tinderbox" failures on various architectures when WITH_TESTS=yes is enabled. Problem introduced in r267679. Notes: svn path=/head/; revision=268770
* Fix atf-sh's integration_testJulio Merino2014-07-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | With the move of atf-sh into /usr/libexec in r267181, some of the tests in the integration_test program broke because they could not execute atf-sh from the path any longer. This slipped through because I do have a local atf installation in my home directory that appears in my path, hence the tests could still execute my own version. Fix this by forcing /usr/libexec to appear at the beginning of the path when attempting to execute atf-sh. To make upgrading easy (and to avoid an unnecessary entry in UPDATING), make integration_test depend on the Makefile so that a rebuild of the shell script is triggered. This requires a hack in the *.test.mk files to ensure the Makefile is not treated as a source to the generated program. Ugly, I know, but I don't have a better way of doing this at the moment. Will think of one once I address the TODO in the *.test.mk files that suggests generalizing the file generation functionality. PR: 191052 Reviewed by: Garrett Cooper Notes: svn path=/head/; revision=268445
* Remove ia64.Marcel Moolenaar2014-07-075-997/+3
| | | | | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan Notes: svn path=/head/; revision=268351
* Align the stack in _rtld_bind_start. Normally this is called with theAndrew Turner2014-07-061-2/+5
| | | | | | | | | | | | | | | | | | | | | | correct stack alignment, however when we have a leaf function that uses thread local storage it calls __aeabi_read_tp to get the thread pointer. Neither GCC or clang see this as a function call so will align the stack to a 4-byte boundary. This may be a problem as _rtld_bind expects to be on an 8-byte boundary. The solution is to store a copy of the stack pointer and force the alignment before calling _rtld_bind. This fixes a problem with armeb where applications would crash in odd ways. It should also remove the need for a local patch to clang to force the stack alignment to an 8-byte boundary, even for leaf functions. Further testing will be needed before reverting this local change to clang as we may rely on it in other places. Reviewed by: jmg@ Notes: svn path=/head/; revision=268310
* Fix r264346 for ia64. We need to allocate memory for the functionMarcel Moolenaar2014-07-022-0/+9
| | | | | | | | | | | | descriptors in order to relocate RTLD itself. To allocate memory, we need the pagesizes array initialized, but that happens after RTLD is relocated. This ordering is important for amd64, but it's opposite of what ia64 needs. Handle this conflict with the define called RTLD_INIT_PAGESIZES_EARLY. When defined, obtain the page sizes before relocating rtld, otherwise do it after. Notes: svn path=/head/; revision=268182
* mdoc: remove superfluous paragraph macros.Joel Dahl2014-06-231-1/+0
| | | | Notes: svn path=/head/; revision=267803
* Test RTLD's new LD_LIBRARY_PATH_FDS variable.Jonathan Anderson2014-06-208-0/+373
| | | | | | | | | | | | | | | Test LD_LIBRARY_PATH_FDS by linking a binary that requires a shared library that isn't in any of the usual search paths. Ensure this fails when we don't supply LD_LIBRARY_PATH_FDS or we pass invalid information in it. Ensure it works when we pass the correct directory in various places in the variable. Approved by: rwatson (mentor) MFC after: 3 weeks Sponsored by: DARPA/AFRL Notes: svn path=/head/; revision=267679
* Add the LD_LIBRARY_PATH_FDS environmental variable.Jonathan Anderson2014-06-204-16/+148
| | | | | | | | | | | | | | | | | This variable allows the loading of shared libraries via directory descriptors rather than via library paths. If LD_LIBRARY_PATH_FDS=3:4:12, the directories represented by file descriptors 3, 4 and 12 will searched for shared libraries before the normal path-based mechanisms are used. This allows us to execute unprivileged binaries from within a Capsicum sandbox even if they require shared libraries. Approved by: rwatson (mentor) Reviewed by: kib MFC after: 3 weeks Sponsored by: DARPA/AFRL Notes: svn path=/head/; revision=267678
* use .Mt to mark up email addresses consistently (part2)Baptiste Daroussin2014-06-207-14/+14
| | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco@lastsummer.de> Notes: svn path=/head/; revision=267668
* In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.Bryan Drewery2014-06-084-0/+8
| | | | | | | | | | | | | | | | | | | This is currently an opt-in build flag. Once ASLR support is ready and stable it should changed to opt-out and be enabled by default along with ASLR. Each application Makefile uses opt-out to ensure that ASLR will be enabled by default in new directories when the system is compiled with PIE/ASLR. [2] Mark known build failures as NO_PIE for now. The only known runtime failure was rtld. [1] http://www.bsdcan.org/2014/schedule/events/452.en.html Submitted by: Shawn Webb <lattera@gmail.com> Discussed between: des@ and Shawn Webb [2] Notes: svn path=/head/; revision=267233
* Move atf-sh from /usr/bin/ to /usr/libexec/Julio Merino2014-06-065-2/+86
| | | | | | | | | | | | | | | | In r266650, we made libatf-c and libatf-c++ private libraries so that no components outside of the source tree could unintendedly depend on them. This change does the same for the "atf-sh library" by moving the atf-sh interpreter from its public location in /usr/bin/ to the private location in /usr/libexec/. Our build system will ensure that our own test programs use the right binary, but users won't be able to depend on atf-sh by "mistake". Committing this now to ride the UPDATING notice added with r267172 today. Notes: svn path=/head/; revision=267181
* When building picobsd, define WITHOUT_OPENSSL and WITHOUT_KERBEROS andWarner Losh2014-06-061-3/+0
| | | | | | | | | | | | remove the now-redundant checks for RELEASE_CRUNCH. This originally was defined for building smaller sysinstall images, but was later also used by picobsd builds for a similar purpose. Now that we've moved away from sysinstall, picobsd is the only remaining consumer of this interface. Adding these two options reduces the RELEASE_CRUNCH special cases in the tree by half. Notes: svn path=/head/; revision=267147
* Change libatf-c and libatf-c++ to be private libraries.Julio Merino2014-05-251-2/+2
| | | | | | | | | | | | | | | | | We should not be leaking these interfaces to the outside world given that it's much easier for third-party components to use the devel/atf package from ports. As a side-effect, we can also drop the ATF pkgconfig and aclocal files from the base system. Nothing in the base system needs these, and it was quite ugly to have to get them installed only so that a few ports could build. The offending ports have been fixed to depend on devel/atf explicitly. Reviewed by: bapt Notes: svn path=/head/; revision=266650
* Right now, the rtld prefork hook locks the rtld bind lock in the readKonstantin Belousov2014-05-241-1/+15
| | | | | | | | | | | | | | | | | | | | | mode. This allows the binder to be functional in the child after the fork (assuming no lazy loading of a filter is needed), but other rtld services which require write lock on rtld_bind_lock cause deadlock, if called by child. Change the _rtld_atfork() to lock the bind lock in write mode, making the rtld fully functional after the fork. Pre-resolve the symbols which are called by the libthr' fork() interposer, since dynamic resolution causes deadlock due to the rtld_bind_lock already owned in the write mode. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=266609
* Fix LD_LIBMAP.Konstantin Belousov2014-05-181-3/+3
| | | | | | | | | | The r232862 passed the pointer to end of string to lmc_parse() and free(). Submitted by: Wolfgang Jenkner <wjenkner@inode.at> MFC after: 1 week Notes: svn path=/head/; revision=266411
* - Export the function added in r265456 rather than the non-existentMark Johnston2014-05-072-3/+3
| | | | | | | | | | | | | | _rtld_debug_postinit(). [1] - Use __compiler_membar() instead of inline asm in _r_debug_state() and _r_debug_postinit(). [2] Pointy hat to: markj [1] Reported by: attilio [2] Discussed with: kib X-MFC-With: r265456 Notes: svn path=/head/; revision=265578
* Add a postinit debugger hook to rtld. This will be used by dtrace(1) to haltMark Johnston2014-05-062-0/+16
| | | | | | | | | | | | | the victim process before its entry point is called, at which point probes and DOF data are registered with the kernel. The r_debug_state hook cannot be used for this purpose, as it is called before the program's init routines are invoked and in particular before DOF data is registered (via drti.o). Reviewed by: kib MFC after: 2 weeks Notes: svn path=/head/; revision=265456
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-067-6/+7
| | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* Fix releasing the lock in the parent atrun process after the queueGuy Helmer2014-04-171-0/+6
| | | | | | | | directory has been processed. Otherwise, a long-running child process caused other atrun invocations to stall unnecessarily. Notes: svn path=/head/; revision=264617
* Add dwarf annotations to the amd64 _rtld_bind_start to allow debuggersKonstantin Belousov2014-04-141-0/+43
| | | | | | | | | | to unwind around the calls from PLT to binder. Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=264481
* NO_MAN= has been deprecated in favor of MAN= for some time, go aheadWarner Losh2014-04-138-8/+8
| | | | | | | | | and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit. Notes: svn path=/head/; revision=264400
* Before calling mmap() on a shared library's text and data sections, rtldAlan Cox2014-04-114-25/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | first calls mmap() with the arguments PROT_NONE and MAP_ANON to reserve a single, contiguous range of virtual addresses for the entire shared library. Later, rtld calls mmap() with the the shared library's file descriptor and the argument MAP_FIXED to place the text and data sections within the reserved range. The rationale for mapping shared libraries in this way is explained in the commit message for Revision 190885. However, this approach does have an unintended, negative consequence. Since the first call to mmap() specifies MAP_ANON and not the shared library's file descriptor, the kernel has no idea what alignment the vm object backing the file prefers. As a result, the reserved range's alignment is unlikely to be the same as the vm object's, and so mapping with superpages becomes impossible. To address this problem, this revision adds the argument MAP_ALIGNED_SUPER to the first call to mmap() if the text section is larger than the smallest superpage size. To determine if the text section is larger than the smallest superpage size, rtld must always fetch the page size information. As a result, the private code for fetching the base page size in rtld's builtin malloc is redundant. Eliminate it. Requested by: kib Tested by: zbb (on arm) Reviewed by: kib (an earlier version) Discussed with: jhb Notes: svn path=/head/; revision=264346
* Make bsd.test.mk the only public mk fragment for the building of tests.Julio Merino2014-03-141-1/+1
| | | | | | | | | | | | | | | | | Change {atf,plain,tap}.test.mk to be internal implementation details of bsd.test.mk. Makefiles that build tests should now only include bsd.test.mk and declaratively specify what they want to build, without worrying about the internal implementation of the mk files. The reason for this change is to permit building test programs of different interfaces from a single directory, which is something I had a need for while porting tests over from src/tools/regression/. Additionally, this change makes it possible to perform some other requested changes to bsd.test.mk in an easier manner. Coming soon. Notes: svn path=/head/; revision=263161
* Remove lukemftpd. It was disconnected from the build in 2009.Dag-Erling Smørgrav2014-03-145-431/+0
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=263160
* Re-format the license to conform to our BSD license template as muchChristian Brueffer2014-03-131-13/+12
| | | | | | | | | | | | | | | as possible. This does not change the wording in any way. Remove the 3rd clause ("advertising clause") of the BSD license as permitted by the University of Berkeley on July 22, 1999. While the clause itself mentions Lawrence Berkeley Laboratory, UCB is the sole copyright holder of this file. Reviewed by: imp, emaste, eadler MFC after: 2 weeks Notes: svn path=/head/; revision=263121
* ttys(5): Pseudo-terminals are not listed and the network keyword is obsolete.Jilles Tjoelker2014-03-091-6/+5
| | | | Notes: svn path=/head/; revision=262963
* Rename WITHOUT_DMA into WITHOUT_DMAGENT to avoid confusionBaptiste Daroussin2014-02-221-1/+1
| | | | | | | Requested by: ian Notes: svn path=/head/; revision=262335
* Increase alignment to size of pointer if the alignment is too small.David Xu2014-02-221-4/+2
| | | | | | | | | | Some modules do not align data at least to size of pointer, they uses a smaller alignment, but our pointer should be aligned to its native boundary, otherwise on some platforms, hardware alignment checking will cause bus error. Notes: svn path=/head/; revision=262334
* Lower warning level when built with gccBaptiste Daroussin2014-02-211-0/+6
| | | | Notes: svn path=/head/; revision=262297
* Enforce mail user and groupBaptiste Daroussin2014-02-211-1/+3
| | | | Notes: svn path=/head/; revision=262293
* Add dma-mbox-create forgotten in the previous commitBaptiste Daroussin2014-02-211-0/+18
| | | | Notes: svn path=/head/; revision=262290
* Import Dragonfly Mail Agent into base systemBaptiste Daroussin2014-02-212-0/+39
| | | | | | | | | | | | | | | It is a small and lightweight Mail Transport Agent. It accepts mails from locally installed Mail User Agents (MUA) and delivers the mails either locally or to a remote destination. Remote delivery includes several features like TLS/SSL support, SMTP authentication and NULLCLIENT. Make dma conditional to new WITHOUT_DMA option and make it respect WITHOUT_MAIL Reviewed by: peter Discussed with: emaste, bz, peter Notes: svn path=/head/; revision=262282
* malloc_aligned() may not leave enough space for pointer to allocated memory,David Xu2014-02-211-7/+7
| | | | | | | | | | | | saving the pointer will overwrite bytes belongs to another memory block unexpectly, to fix the problem, use (allocated address + sizeof(void *)) as initial value, and slip to next aligned address, so maximum extra bytes is sizeof(void *) + align - 1. Tested by: Andre Albsmeier < mail at ma17 dot ata dot myota dot orgndre > Notes: svn path=/head/; revision=262277
* Remove the 3rd clause ("advertising clause") of the BSD license asChristian Brueffer2014-02-1755-275/+55
| | | | | | | | | | permitted by the University of Berkeley on July 22, 1999. Reviewed by: imp MFC after: 1 week Notes: svn path=/head/; revision=262136
* Add $FreeBSD$.Christian Brueffer2014-02-174-0/+8
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=262135
* In sgetpwnam(), save and free pw_class like all other char membersChristian Brueffer2014-02-141-0/+2
| | | | | | | | | | | | of struct passwd. This fixes spurious "login_getclass: unknown class" errors. PR: 186439 Submitted by: UEMURA Tetsuya <t_uemura at macome.co.jp> MFC after: 1 week Notes: svn path=/head/; revision=261885
* Add a new flag to /etc/ttys: onifconsole. This is equivalent to "on" if theNathan Whitehorn2014-01-201-2/+5
| | | | | | | | | | | | device is an active kernel console and "off" otherwise. This is designed to allow serial-booting x86 systems to provide a login prompt on the serial line by default without providing one on all systems by default. Comments and suggestions by: grehan, dteske, jilles MFC after: 1 month Notes: svn path=/head/; revision=260913
* Replace LIBGCC by LIBCOMPILER_RT.Ed Schouten2014-01-181-5/+6
| | | | | | | | We now use libcompiler_rt on all platforms now. Instead of referring directly to -lgcc and LIBGCC, use -lcompiler_rt and LIBCOMPILER_RT. Notes: svn path=/head/; revision=260849
* Cast Elf_Addr to void * to match the free_aligned() argument type.Konstantin Belousov2013-12-071-2/+2
| | | | | | | | | Found by: gcc Sponsored by: The FreeBSD Foundation MFC after: 6 days Notes: svn path=/head/; revision=259072
* For variant II static TLS, properly align tls segments. Pre-calculateKonstantin Belousov2013-12-061-15/+20
| | | | | | | | | | | | | | the max required alignment for the static tls segments, and honor it when carving the pieces for next module, from the static space. Use aligned allocator to get properly-aligned dynamic blocks. Reported by: dt71@gmx.com Reviewed by: kan Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=259044
* Build an allocator for the aligned memory on top of the rtld-privateKonstantin Belousov2013-12-062-0/+32
| | | | | | | | | | | malloc. Reviewed by: kan Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=259043
* Please welcome casperd daemon. It (and its services) will be responsible forPawel Jakub Dawidek2013-12-0212-0/+1694
| | | | | | | | | | | | | | | | | | | | | | giving access to functionality that is not available in capability mode sandbox. The functionality can be precisely restricted. Start with the following services: - system.dns - provides API compatible to: - gethostbyname(3), - gethostbyname2(3), - gethostbyaddr(3), - getaddrinfo(3), - getnameinfo(3), - system.grp - provides getgrent(3)-compatible API, - system.pwd - provides getpwent(3)-compatible API, - system.random - allows to obtain entropy from /dev/random, - system.sysctl - provides sysctlbyname(3-compatible API. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=258838
* Build and install the atf tests.Julio Merino2013-11-088-3/+43
| | | | | | | | Reviewed by: freebsd-testing Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=257853
* Subsume the functionality of MK_ATF into MK_TESTS.Julio Merino2013-11-081-4/+4
| | | | | | | | | | | | | There is no reason to keep the two knobs separate: if tests are enabled, the ATF libraries are required; and if tests are disabled, the ATF libraries are not necessary. Keeping the two just serves to complicate the build. Reviewed by: freebsd-testing Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=257850
* Include rtld itself when iterating over loaded ELF objects inMark Johnston2013-11-071-0/+5
| | | | | | | | | dl_iterate_phdr(3). Reviewed by: kib Notes: svn path=/head/; revision=257811
* Drop support for historic ioctls and also undefine them, so that codeGleb Smirnoff2013-11-051-8/+0
| | | | | | | | | that checks their presence via ifdef, won't use them. Bump __FreeBSD_version as safety measure. Notes: svn path=/head/; revision=257696
* By popular demand, move freebsd-version(1) from /libexec to /bin.Dag-Erling Smørgrav2013-10-094-272/+0
| | | | | | | Approved by: re (gjb) Notes: svn path=/head/; revision=256241
* Explicitly pass the full path to the input file to sed. This unbreaksDag-Erling Smørgrav2013-10-091-1/+1
| | | | | | | | | the WITHOUT_BMAKE build. Approved by: re (gjb) Notes: svn path=/head/; revision=256232