summaryrefslogtreecommitdiffstats
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Fix several typos in macros or macro misusage.uqs2010-03-121-1/+1
| | | | | | Found by: make manlint Reviewed by: ru Approved by: philip (mentor)
* Updated rtld for n32 support.imp2010-03-042-153/+315
| | | | | Submitted by: jmallet@ Obtained from: NetBSD
* Fixed static linkage.ru2010-02-262-4/+4
|
* Support the extended PLT format used when objects have more than 8192nwhitehorn2010-02-223-25/+67
| | | | PLT relocations on PPC32.
* The NetBSD Foundation has granted permission to remove clauses 3 and 4.imp2010-02-161-7/+0
| | | | Obtained from: NetBSD
* Improve TLS variant I:marcel2010-02-161-11/+8
| | | | | | o Use obj->tlsinitsize to determine whether there's initialized data. o If obj->tlssize > obj->tlsinitsize, then bzero uninitialized data. o Don't exclude variant I from the work-around in free_tls_offset().
* Set ut_line to "ftpd" for ftpd.ed2010-02-091-0/+1
| | | | | | | | This makes it a little easier to figure out which application was responsible for this log entry. Ideally we should add an ut_process or something similar. Suggested by: Vincent Poy <vincepoy gmail com>
* Remove stale references to utmp(5) and its corresponding filenames.ed2010-01-212-3/+2
| | | | I removed utmp and its manpage, but not other manpages referring to it.
* Really disable wtmp logging when chrooting.ed2010-01-182-6/+9
| | | | | | | | Also perform a small cleanup to ftpd_logwtmp(). Just use a NULL parameter for the username to indicate a logout, instead of an empty string. Reported by: Alexey Shuvaev <shuvaev physik uni-wuerzburg de>
* Phase out ttyslot(3).ed2010-01-141-1/+0
| | | | | | | | The ttyslot() function was originally part for SUSv1, marked LEGACY in SUSv2 and removed later on. This function only makes sense when using utmp(5), because it was used to determine the offset of the record for the controlling TTY. It makes little sense to keep it here, because the new utmpx file format doesn't index based on TTY slots.
* Port all apps in libexec/ from libulog to utmpx.ed2010-01-134-10/+4
|
* Port ftpd to utmpx.ed2010-01-132-52/+38
| | | | | | | | Unfortunately I have to partially wreck its functionality, though. ftpd used to keep a file descriptor to the wtmp, which allowed it to work from within a chroot. The current utmpx implementation doesn't offer a way to do this. Maybe we can address this in the future, if it turns out to be a real issue.
* Port comsat to utmpx.ed2010-01-131-64/+21
| | | | | | | | It seems comsat stats the utmpx database each 15 seconds to see whether it has been changed. I am changing this behaviour to look at the utmpx database upon processing. I don't want to allow direct interference with the database files. I also wonder whether this optimization has any measurable performance benefit nowadays.
* Remove `dead code' from rlogind.ed2010-01-131-12/+1
| | | | | | | - It shouldn't call logwtmp(). Applications like login(1) already make sure both login and logout entries are written to the storage. - There's no need to restore permissions on the pseudo-terminal, since it should be garbage collected by the kernel.
* Make WARNS=6 the default for libexec/.ed2010-01-0226-10/+41
| | | | | | | | | | | | | | | Just like bin/ and sbin/, I think setting WARNS to the highest value possible will make it more attractive for people to fix warnings. - The WARNS variable is set in the Makefile in the directory of the application itself, making it more likely that it will be removed out of curiosity to see what happens. - New applications will most likely build with WARNS=6 out of the box, because the author would more likely fix the warnings during development than lower WARNS. Unfortunately almost all apps in libexec require a lowered value of WARNS.
* Fix several warnings.ed2010-01-021-10/+10
| | | | | | - Add __unused keywords. - Don't shadow a global variable called cr. - Make the global cr variable const.
* ANSIfy ldconfig and the aout bits it still uses from rtld-aout.ed2009-12-292-28/+10
| | | | (Why is aout support still there?)
* Make rpc.ruserd work with utmpx/libulog.ed2009-12-293-92/+35
| | | | | | | Because strings are now null-terminated, I've decided to just use an array of utmpx structures, instead of the separated strings. This means we just copy the entire utmpx structure and point to the strings within the structures directly.
* Perform cleanups to rpc.rusersd:ed2009-12-283-198/+204
| | | | | - Perform whitespace fixes. Use tabs instead of 8 spaces. - Make it build at WARNS=6.
* Modify the sources to make WARNS=6 work.ed2009-12-262-3/+4
|
* Unbreak the build.ed2009-12-261-2/+1
| | | | | | | I increased the WARNS, but it looks like it breaks certain architectures with more strict alignment requirements (mips, sparc64, ia64). Pointy hat to: me
* Let talkd use utmpx instead of utmp.ed2009-12-252-20/+17
| | | | | Because strings are null terminated now, there is no need to copy ut_line into a separate buffer first. Also enable WARNS.
* Don't use UT_NAMESIZE here to determine the maximum username length.ed2009-12-251-9/+2
|
* Repair breakage to last-minute API change.ed2009-12-031-4/+2
| | | | | | | I changed ulog_log{in,out} to return a void, but forgot to change ulog-helper as well. Reported by: stefanf
* Add a new library: libulog.ed2009-12-033-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the things I really want to do, is to get rid of the limitations of our current utmp(5) mechanism: - It only allows 8 byte TTY device names. - The hostname only allows 16 bytes of storage. I'm not a big fan of <utmpx.h>, but I think we should at least try to add parts of it. Unfortunately we cannot implement <utmpx.h>, because we miss various fields, such as ut_id, ut_pid, etc. The API provided by libulog shares some similarities with <utmpx.h>, so it shouldn't be too hard to port these applications eventually. In most simple cases, it should just be a matter of removing the ulog_ prefix everywhere. As a bonus, it also implements a function called ulog_login_pseudo(), which allows unprivileged applications to write log entries, provided they have a valid file descriptor to a pseudo-terminal master device. libulog will allow a smoother transition to a new file format by adding a library interface to deal with utmp/wtmp/lastlog files. I initially thought about adding the functionality to libutil, but because I'm not planning on keeping this library around forever, we'd better keep it separated. Next items on the todo list: 1. Port applications in the base system (and ports) to libulog, instead of letting them use <utmp.h>. 2. Remove <utmp.h>, implement <utmpx.h> and reimplement this library on top. 3. Port as many applications as possible back to <utmpx.h>.
* Fix local root vulnerability.cperciva2009-12-011-6/+6
| | | | | Security: Advisory will be coming soon. X-MFC-After: 30 seconds
* Allow to load not-openable dso when tracing. This fixes ldd on such dso orkib2009-11-282-4/+8
| | | | | | | | dso linked to non-openable object. Remove '\n' at the end of error message. End comments with dot. MFC after: 3 weeks (together with r199829)
* Implement rtld part of the support for -z nodlopen (see ld(1)).kib2009-11-262-14/+31
| | | | | Reviewed by: kan MFC after: 3 weeks
* Flag controlling origin expansion in DT_FLAGS is DF_ORIGIN, not DF_1_ORIGIN.kib2009-11-261-1/+1
| | | | | Reviewed by: kan MFC after: 3 days
* Fix white space in rtld runtime error printf.rwatson2009-11-141-1/+1
| | | | MFC after: 3 days
* Calculate relocation base for the main object, and apply the relocationkib2009-10-101-14/+15
| | | | | | | | | | | | | | adjustment for all virtual addresses encoded into the ELF structures of it. PIE binary could and should be loaded at non-zero mapbase. For sym_zero pseudosymbol used as a return value from find_symdef() for undefined weak symbols, st_value also should be adjusted, since _rtld_bind corrects symbol values by relocbase. Discussed with: bz Reviewed by: kan Tested by: bz (i386, amd64), bsam (linux) MFC after: some time
* In rtld's map_object(), use pread(..., 0) rather than read() to read therwatson2009-10-061-1/+1
| | | | | | | | | ELF header from the front of the file. As all other I/O on the binary is done using mmap(), this avoids the need for seek privileges on the file descriptor during run-time linking. MFC after: 1 month Sponsored by: Google
* printerr_reply() has never been used for as long as we've had this code indes2009-09-261-31/+12
| | | | | our tree (13+ years). This is an excellent argument for aggressive use of "static".
* Other minor style issues.des2009-09-251-5/+3
|
* Slight style cleanup.des2009-09-251-18/+16
|
* Do the first step in removing lukemftpd from the base system. Disconnectremko2009-09-031-1/+0
| | | | | | | | | | | | | | | it from the build. If you are using the FTP daemon, please consider using the port ftp/tnftpd which is the same FTP server, but newer and might have more/better functionality. This results in us providing only one ftp daemon by default. Reviewed by: bz Approved by: imp (mentor, implicit) MFC after: 3 days Silence from: obrien
* Implement RTLD_NOLOAD flag for dlopen(3).kib2009-07-171-6/+10
| | | | | | Requested and tested by: jkim Reviewed by: kan Approved by: re (kensmith)
* Only perform .bss mapping and cleaning operations when segment file sizekib2009-07-171-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | is not equal to its memory size. This eliminates unneeded clearing of the text segment that often happens due to text end not being page-aligned. For instance, $ readelf -l /lib/libedit.so.6 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x00000000 0x00000000 0x139e1 0x139e1 R E 0x1000 LOAD 0x014000 0x00014000 0x00014000 0x00f04 0x00f14 RW 0x1000 DYNAMIC 0x014cc4 0x00014cc4 0x00014cc4 0x000d0 0x000d0 RW 0x4 $ procstat -v $$ (for /bin/sh) 68585 0x28097000 0x280aa000 r-x 6 0 21 14 CN vn /lib/libedit.so.6 68585 0x280aa000 0x280ab000 r-x 1 0 1 0 CN vn /lib/libedit.so.6 <== 68585 0x280ab000 0x280ac000 rwx 1 0 1 0 CN vn /lib/libedit.so.6 Note the splitted map entry marked by '<=='. Reviewed by: kan Approved by: re (kensmith) MFC after: 1 month
* Second attempt at eliminating .text relocations in shared librarieskan2009-07-141-1/+1
| | | | | | | | | | | | | | compiled with stack protector. Use libssp_nonshared library to pull __stack_chk_fail_local symbol into each library that needs it instead of pulling it from libc. GCC generates local calls to this function which result in absolute relocations put into position-independent code segment, making dynamic loader do extra work every time given shared library is being relocated and making affected text pages non-shareable. Reviewed by: kib Approved by: re (kib)
* Back out previous revision until better tested fix is ready.kan2009-06-291-1/+1
| | | | Approved by: re (impliciti, by approving previos check-in)
* Eliminate .text relocations in shared libraries compiled with stack protector.kan2009-06-281-1/+1
| | | | | | | | | | | | Use libssp_nonshared library to pull __stack_chk_fail_local symbol into each library that needs it instead of pulling it from libc. GCC generates local calls to this function which result in absolute relocations put into position-independent code segment, making dynamic loader do extra work everys time given shared library is being relocated and making affected text pages non-shareable. Reviewed by: kib Approved by: re (kensmith)
* Fix a typo in the same comment, one line below.ed2009-06-231-1/+1
| | | | Submitted by: bf1783 googlemail com
* Fix typo in comment.ed2009-06-231-1/+1
| | | | Submitted by: Christoph Mallon
* Allow order of initialization of loaded shared objects to bekan2009-06-202-48/+47
| | | | | | | | | | | | | | | | | altered through their .init code. This might happen if init vector calls dlopen on its own and that dlopen causes some not yet initialized object to be initialized earlier as part of that dlopened DAG. Do not reset module reference counts to zero on final fini vector run when process is exiting. Just add an additional parameter to force fini vector invocation regardless of current reference count value if object was not destructed yet. This allows dlclose called from fini vector to proceed normally instead of failing with handle validation error. Reviewed by: kib Reported by: venki kaps
* FreeBSD returns main object handle from dlopen(NULL, ...) calls.kan2009-06-161-0/+10
| | | | | | | | | | dlsym seaches using this handle are expected to look for symbol definitions in all objects loaded at the program start time along with all objects currently in RTLD_GLOBAL scope. Discussed with: kib Reported by: Maho NAKATA MFC after: 2 weeks
* Increase the size of the static TLS area slightly (required for the NVidia'sdfr2009-05-271-1/+1
| | | | OpenGL driver on amd64).
* Per the man page:dougb2009-05-264-164/+0
| | | | | | | | | The makekey utility has been deprecated and will be removed in a future release of FreeBSD. Actually removing it was approved back on 10/29/2007 by re (kensmith) but I dropped the ball on actually removing it. It's doubtful that it's become more relevant/useful in the intervening time.
* Prefer <sys/param.h> to <machine/param.h> for the definition ofrwatson2009-04-201-1/+1
| | | | | | | CACHE_LINE_SIZE. Submitted by: bde MFC after: 2 weeks
* Explicitly include machine/param.h for CACHE_LINE_SIZE.rwatson2009-04-191-0/+2
| | | | MFC after: 2 weeks
* Now that the kernel defines CACHE_LINE_SIZE in machine/param.h, userwatson2009-04-197-14/+0
| | | | | | | | that definition in the custom locking code for the run-time linker rather than local definitions. Pointed out by: tinderbox MFC after: 2 weeks
OpenPOWER on IntegriCloud