summaryrefslogtreecommitdiffstats
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Add thread-local storage support for ARM to rtld-elfgonzo2012-02-143-11/+83
| | | | | Reviewed by: cognet Obtained from: NetBSD
* Add missed EOL when die() was converted to use rtld_fdputstr() insteadkib2012-02-131-0/+1
| | | | | | | | of errx(). Reported by: amdmi3 PR: bin/165075 MFC after: 3 days
* Add handlers for TLS-related relocation entriesgonzo2012-02-112-3/+87
|
* Remove debug outputgonzo2012-02-101-2/+0
|
* Switch MIPS TLS implementation to Variant Igonzo2012-02-103-9/+44
|
* Fix debug output for MIPS part of rtldgonzo2012-02-101-12/+13
|
* Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessordim2012-02-071-1/+1
| | | | | | set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp. MFC after: 1 week
* Add support for GNU RELRO.kib2012-01-303-0/+28
| | | | | Submitted by: John Marino <draco marino st> MFC after: 2 weeks
* Remove unneeded dtv variable.ed2012-01-172-6/+0
| | | | | | | It is only assigned and not used at all. The object files stay identical when the variables are removed. Approved by: kib
* Fix warning when compiling with gcc46:eadler2012-01-101-2/+0
| | | | | | | error: variable 'bp' set but not use Approved by: dim MFC After: 3 days
* Spelling fixes for libexec/uqs2012-01-0719-30/+30
|
* Implement fdlopen(3), an rtld interface to load shared object by filekib2012-01-072-32/+82
| | | | | | | | descriptor. Requested and tested by: des (previous version) Reviewed by: des, kan (previous version) MFC after: 2 weeks
* Postpone the resolution of IRELATIVE relocations and IFUNC-targetedkib2012-01-041-4/+5
| | | | | | | | | | relocations until tls is initialized and stacks permissions correctly set. This allows the ifunc to call malloc(3) and some other heavy services. Add debug banner. MFC after: 3 days
* Replace index() and rindex() calls with strchr() and strrchr().ed2012-01-032-4/+5
| | | | | | | | | | The index() and rindex() functions were marked LEGACY in the 2001 revision of POSIX and were subsequently removed from the 2008 revision. The strchr() and strrchr() functions are part of the C standard. This makes the source code a lot more consistent, as most of these C files also call into other str*() routines. In fact, about a dozen already perform strchr() calls.
* Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]cperciva2011-12-232-0/+4
| | | | | | | | | | | | | | | | | | | | Add an API for alerting internal libc routines to the presence of "unsafe" paths post-chroot, and use it in ftpd. [11:07] Fix a buffer overflow in telnetd. [11:08] Make pam_ssh ignore unpassphrased keys unless the "nullok" option is specified. [11:09] Add sanity checking of service names in pam_start. [11:10] Approved by: so (cperciva) Approved by: re (bz) Security: FreeBSD-SA-11:06.bind Security: FreeBSD-SA-11:07.chroot Security: FreeBSD-SA-11:08.telnetd Security: FreeBSD-SA-11:09.pam_ssh Security: FreeBSD-SA-11:10.pam
* Additional icache paranoia: non-PLT relocations can modify the text segment.nwhitehorn2011-12-172-2/+9
| | | | | | | It is then important to make sure the icache is synchronized again to prevent (rare) random seg faults and illegal instructions. MFC after: 3 days
* Fix RTLD on PowerPC after r228435. Changing the order of init_pltgot()nwhitehorn2011-12-171-4/+11
| | | | | caused the icache to be invalidated at the wrong time, resulting in an icache full of nonsense in the PLT section.
* Fix the incompatible enum conversions in libexec/ypxfr in another, moredim2011-12-163-22/+24
| | | | | | | | messy way, so as to not disrupt other yp programs: just add casts to convert the incompatible enums, as the numerical values are the same (either by accident, design, or the phase of the moon at that time). MFC after: 1 week
* Revert r228592, as the non-messy way of fixing ypxfr breaks other ypdim2011-12-164-7/+8
| | | | | | | programs (e.g. usr.sbin/rpc.yppasswdd). Spotted by: np MFC after: 1 week
* Attempt to fix the numerous incompatible enum conversions indim2011-12-164-8/+7
| | | | | | libexec/ypxfr in the least disruptive way. MFC after: 1 week
* Fix typos in the comments about clang warnings in severaldim2011-12-162-2/+2
| | | | | | | sendmail-related Makefiles. Spotted by: arundel MFC after: 1 week
* Unfortunately, clang gives warnings about sendmail code that cannot bedim2011-12-161-0/+7
| | | | | | | turned off yet. Since this is contrib code, and we don't really care about the warnings, just turn make them non-fatal for now. MFC after: 1 week
* In libexec/rbootd/utils.c, use the correct printf length modifiers fordim2011-12-161-3/+3
| | | | | | u_int32_t and size_t. MFC after: 1 week
* In libexec/pppoed/pppoed.c, use the correct printf length modifier for adim2011-12-161-2/+2
| | | | | | size_t. MFC after: 1 week
* Unfortunately, clang gives warnings about sendmail code that cannot bedim2011-12-161-0/+7
| | | | | | | turned off yet. Since this is contrib code, and we don't really care about the warnings, just turn make them non-fatal for now. MFC after: 1 week
* In libexec/bootpd/tools/bootptest/print-bootp.c, use the correct printfdim2011-12-161-1/+1
| | | | | | length modifier for the difference between two pointers. MFC after: 1 week
* In libexec/getty/chat.c, replace && with & in chat_send(). The intentdim2011-12-161-1/+1
| | | | | | is to test if the CHATDEBUG_SEND bit is set in the chat_debug global. MFC after: 1 week
* In libexec/bootpd/bootpgw/bootpgw.c, add a cast for the remainingdim2011-12-161-1/+1
| | | | | | | minutes of activity, to avoid a warning on platforms where time_t is a 32-bit integer. MFC after: 1 week
* _rtld_bind() read-locks the bind lock, and possible plt resolutionkib2011-12-143-23/+86
| | | | | | | | | | | | | | | | | | | | | | from the dispatcher would also acquire bind lock in read mode, which is the supported operation. plt is explicitely designed to allow safe multithreaded updates, so the shared lock do not cause problems. The error in r228435 is that it allows read lock acquisition after the write lock for the bind block. If we dlopened the shared object that contains IRELATIVE or jump slot which target is STT_GNU_IFUNC, then possible recursive plt resolve from the dispatcher would cause it. Postpone the resolution for irelative/ifunc right before initializers are called, and drop bind lock around calls to dispatcher. Use initlist to iterate over the objects instead of the ->next, due to drop of the bind lock in iteration. For i386/reloc.c:reloc_iresolve(), fix calculation of the dispatch function address for dso, by taking into account possible non-zero relocbase. MFC after: 3 weeks
* Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions tokib2011-12-1210-36/+335
| | | | | | | | | | | | | | | | | rtld on 386 and amd64. This adds runtime bits neccessary for the use of the dispatch functions from the dynamically-linked executables and shared libraries. To allow use of external references from the dispatch function, resolution of the R_MACHINE_IRESOLVE relocations in PLT is postponed until GOT entries for PLT are prepared, and normal resolution of the GOT entries is finished. Similar to how it is done by GNU, IRELATIVE relocations are resolved in advance, instead of normal lazy handling for PLT. Move the init_pltgot() call before the relocations for the object are processed. MFC after: 3 weeks
* Make comsat(8) approximately 15% smaller.ed2011-12-101-10/+10
| | | | | This program only consists of a single C file, so simply mark everything except main() static.
* Typo.kib2011-12-091-1/+1
| | | | MFC after: 3 days
* Fix fd leak.kib2011-11-181-0/+1
| | | | | Reported by: slonoman2011 yandex ru MFC after: 1 week
* Fix a misplaced parenthesis.brueffer2011-10-301-1/+1
| | | | | | PR: 162164 Submitted by: Henning Petersen <henning.petersen@t-online.de> MFC after: 1 week
* - change "is is" to "is" or "it is"eadler2011-10-162-2/+2
| | | | | | | | - change "the the" to "the" Approved by: lstewart Approved by: sahil (mentor) MFC after: 3 days
* Handle the R_386_TLS_TPOFF32 relocation, which is similar to R_386_TLS_TPOFF,kib2011-10-081-2/+7
| | | | | | | | but with negative relocation value. Found by: mpfr test suite, pointed to by ale Reviewed by: kan MFC after: 1 week
* Setting up TLS block for the main thread must be done after thekib2011-10-081-3/+14
| | | | | | | | | | | | relocations are processed, since tls initialization section might be itself subject for relocations. Only set up of the block is postponed, the tls block offsets are allocated before relocation processing, since TLS-related relocations may need offsets ready. Reported by: ale PR: threads/161344 Reviewed by: kan MFC after: 1 week
* Restore the writing of the .bss sections of the dsos (not the mainkib2011-09-201-2/+3
| | | | | | | | | | | | | | executable) after r190885. The whole region for the dso is mmaped with MAP_NOCORE flag, doing only mprotect(2) over .bss prevented it from writing .bss to core files. Revert the optimization of using mprotect(2) to establish .bss, overlap the section with mmap(2). Reported by: attilio Reviewed by: attilio, emaste Approved by: re (bz) MFC after: 2 weeks
* Use the proper dynamic tls block to calculate the tls variable addresskib2011-09-151-1/+1
| | | | | | | | | | in case tls data generation was updated. PR: misc/160721 Submitted by: "Thinker K.F. Li" <thinker codemud net> Tested by: flo Approved by: re (bz) MFC after: 1 week
* Do not use the function pointers for the internal operation of rtld_printf()kib2011-09-061-21/+26
| | | | | | | | | functions. The _rtld_error() function might be called early during the rtld bootstrap, in which case function pointers are not yet functional on ia64 due to required relocations not yet performed. Reported, reviewed and tested by: marcel Approved by: re (bz)
* When libexec/rtld-elf/rtld.c is compiled with clang, the r_debug_state()dim2011-09-031-1/+9
| | | | | | | | | | | | | function (a hook necessary for gdb support), is inlined, but since the function contains no code, no calls to it are generated. When gdb is debugging a dynamically linked program, this causes backtraces to be corrupted. Fix it by marking the function __noinline, and inserting an empty asm statement, that pretends to clobber memory. This forces the compiler to emit calls to r_debug_state() throughout rtld.c. Approved by: re (kib)
* Rtld links with the specially built pic static libc library to get somekib2011-08-249-54/+573
| | | | | | | | | | | | | | | | | C runtime services, like printf(). Unfortunately, the multithread-safeness measures in the libc do not work in rtld environment. Rip the kernel printf() implementation and use it in the rtld instead of libc version. This printf does not require any shared global data and thus is mt-safe. Systematically use rtld_printf() and related functions, remove the calls to err(3). Note that stdio is still pulled from libc due to libmap implementaion using fopen(). This is safe but unoptimal, and can be changed later. Reported and tested by: pgj Diagnosed and reviewed by: kan (previous version) Approved by: re (bz)
* Pull in some wording to the tftpd.8 man pagerodrigc2011-07-311-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | from NetBSD, with some slight changes: ========================================================================================= http://cvsweb.netbsd.org/bsdweb.cgi/src/libexec/tftpd/tftpd.8?only_with_tag=MAIN#rev1.22 Revision 1.22 or diffs], Fri Jan 8 21:05:14 2010 UTC (18 months, 2 weeks ago) by christos Patrick Welche <prlw1@cam.ac.uk> - add -p pathsep option - make wrap to zero work, but produce a warning While here: - fix gcc warnings, in particular variable clobbered warnings (compiling with fewer warnings does not really fix the problem) ========================================================================================= These wording changes clarify the default rollover behavior as a "kludge". Also, the block numbers and octet counts for 65535 blocks and 32767 blocks are more accurate than the existing documented numbers. Requested by: Pawan Gupta <pawang at juniper dot net> Obtained from: Juniper Networks Approved by: re (kib)
* In the old TFTP server, there was an undocumented behavior whererodrigc2011-07-311-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | the block counter would rollover to 0 if a file larger than 65535 blocks was transferred. With the default block size of 512 octets per block, this is a file size of approximately 32 megabytes. The new TFTP server code would report an error and stop transferring the file if a file was larger than 65535 blocks. This patch restores the old TFTP server's behavior to the new TFTP server code. If a TFTP client transfers a file larger than 65535 blocks, and does *not* specify the "rollover" option, then automatically rollover the block counter to 0 every time we reach 65535 blocks. This restores interoperability with the FreeBSD 6 TFTP client. Without this change, if a FreeBSD 6 TFTP client tried to retrieve a file larger than 65535 blocks from a FreeBSD 9 TFTP server , the transfer would fail. The same file could be retrieved successfully if the same FreeBSD 6 TFTP client was used against a FreeBSD 6 TFTP server. Approved by: re (kib) Tested by: Pawan Gupta <pawang at juniper dot net>, Obtained from: Juniper Networks
* Acknowledge Edwin Groothuis for the major rewrite herodrigc2011-06-241-0/+6
| | | | did of the tftpd and tftp code to support TFTP blocksize.
* Bring back synchnet() implementation from olderrodrigc2011-06-241-3/+30
| | | | | | | | | | | | | | | | | tftp implementation. The synchnet() function was converted to a no-op when the new TFTP implementation was committed to FreeBSD. However, this function, as it was in the older code, is needed in order to synchronize between the tftpd server and tftp clients, which may be buggy. Specifically, we had a buggy TFTP client which would send TFTP ACK packets for non-TFTP packets, which would cause the count of packets to get out of whack, causing transfers to fail with the new TFTPD implementation. Obtained from: Juniper Networks Submitted by: Santhanakrishnan Balraj <sbalraj at juniper dot net>
* Update references to RFC's that the newer TFTP implementation supports.rodrigc2011-06-221-3/+25
|
* Fix typo.rodrigc2011-06-221-1/+1
| | | | Reported by: Nick Mann <njm at njm dot me dot uk>
* Clarify tftpd's -d flag in the new TFTP implementation.rodrigc2011-06-221-3/+21
| | | | Bump date.
* Add LOGIN_SETCPUMASK and LOGIN_SETLOGINCLASS to the setusercontext(3)trasz2011-06-221-6/+5
| | | | calls in ftpd(8).
OpenPOWER on IntegriCloud