summaryrefslogtreecommitdiffstats
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Revert r253748,253749avg2013-07-282-0/+2
| | | | | | This WIP should not have been committed yet. Pointyhat to: avg
* remove needless inclusion of machine/cpu.h in userlandavg2013-07-282-2/+0
| | | | MFC after: 21 days
* Add the name of the file that could not be opened to the error messageghelmer2013-06-111-1/+1
| | | | | | regarding the failure. Suggested while working on PR bin/113239.
* Prevent races running the queue by serializing access to theghelmer2013-06-111-0/+4
| | | | | | queue directory. PR: bin/113239
* mdoc sweep.joel2013-05-121-1/+1
|
* Properly terminate the result string for intermediate results, tokib2013-04-291-1/+2
| | | | | | | | allow the final strcpy() to start at the intended place. Reported and tested by: pgj Pointy hat to: kib MFC after: 3 days
* The origin_subst_one() function limits the length of the string tokib2013-04-151-73/+75
| | | | | | | | | | | | | | | | | | PATH_MAX after the token substitution. This is wrong, because origin_subst_one() performs the substitution on the whole rpath and similar strings, which contain several pathes separated by colon. As result, long (but correct) rpath consisting of many path elements is rejected by the function. Correct the problem by rewriting the origin_subst_one() to perform two passes, first pass to calculate the number of substitutions to be performed, and second pass to generate the resulting string. Second pass allocates the memory for the result based on the count from the first pass, without enforcing a limit. Reported and tested by: pgj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* Map libraries linked with -Ttext-segment=base_addr at base_addr.tijl2013-02-271-1/+1
| | | | | | | | | 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 MFC after: 1 week
* Since clang 3.2 now has an option to suppress warnings about implicitlydim2013-02-162-10/+0
| | | | | | | promoted K&R parameters, remove the workarounds added for sendmail components in r228558. MFC after: 1 week
* Avoid use of register variables, which some compilers (e.g. clang)nwhitehorn2013-02-081-9/+5
| | | | | | don't like. It makes the code a little clearer as well. MFC after: 1 week
* Retire struct sockaddr_inarp.glebius2013-01-311-19/+7
| | | | | | | | | | | | | | | Since ARP and routing are separated, "proxy only" entries don't have any meaning, thus we don't need additional field in sockaddr to pass SIN_PROXY flag. New kernel is binary compatible with old tools, since sizes of sockaddr_inarp and sockaddr_in match, and sa_family are filled with same value. The structure declaration is left for compatibility with third party software, but in tree code no longer use it. Reviewed by: ru, andre, net@
* Mark tftp_log() as __printflike() (which would have caught the bugmarius2013-01-314-15/+17
| | | | | | fixed in r246106) and deal with the fallout. MFC after: 2 weeks
* Remove extra %s from debug statement that ends up crashing tftpd ifsbruno2013-01-301-1/+1
| | | | | | | debug is set very high (like -d15 in my case). Obtained from: Yahoo! Inc MFC after: 2 weeks
* When building for ARM EABI link against libgcc for the __aeabi_* functions.andrew2013-01-191-0/+10
|
* Use correct size in snprintf.antoine2012-12-251-2/+1
| | | | | | | | Remove unused buffer. PR: 174631 Submitted by: Henning Petersen MFC after: 1 month
* Use absolute path for /usr/libexec/ld-elf.so.1 symlink.pjd2012-12-041-2/+2
| | | | | | | | | Requested by: kan, kib Use -h flags for chflags, so we won't remove 'schg' flag from system's /libexec/ld-elf.so.1. MFC after: 2 weeks
* Do not change entire BINDIR, it might be needed later, just changepjd2012-12-041-2/+2
| | | | | | symlink target. MFC after: 2 weeks
* Change /usr/libexec/ld-elf.so.1 to point at ../../libexec/ld-elf.so.1pjd2012-12-041-1/+1
| | | | | | | | | | | instead of /libexec/ld-elf.so.1. Below in the Makefile we execute 'chflags noschg ${DESTDIR}/usr/libexec/ld-elf.so.1', which follows symlink and removes 'schg' flag from system's /libexec/ld-elf.so.1 instead of the one in DESTDIR. It is also more friendly to use replative paths in symlink in case of jail/chroot environments. Obtained from: WHEEL Systems MFC after: 2 weeks
* rtld: Fix fd leak with parallel dlopen and fork/exec.jilles2012-11-042-4/+4
| | | | | | | | | | | | | | | | Rtld did not set FD_CLOEXEC on its internal file descriptors; therefore, such a file descriptor may be passed to a process created by another thread running in parallel to dlopen() or fdlopen(). No other threads are expected to be running during parsing of the hints and libmap files but the file descriptors need not be passed to child processes so add O_CLOEXEC there as well. This change will break fdlopen() (as used by OpenPAM) on kernels without F_DUPFD_CLOEXEC (added in July). Note that running new userland on old kernels is not supported. Reviewed by: kib
* atrun(8): scale default load average limit with the number of CPUsmjg2012-10-302-2/+21
| | | | | | | | | Previously atrun refused to run jobs if load average was not below fixed limit of 1.5. PR: 173175 Reviewed by: peterj Approved by: trasz (mentor) MFC after: 2 weeks
* Check the return error of set[e][ug]id. While this can never fail in theeadler2012-10-221-1/+4
| | | | | | | | | | current version of FreeBSD, this isn't guarenteed by the API. Custom security modules, or future implementations of the setuid and setgid may fail. Submitted by: Erik Cederstrand Approved by: cperciva MFC after: 3 days
* Add ATF to the build. This is may be a bit rought around the egdes,marcel2012-10-224-1/+113
| | | | | | | | | | | | | | | | | but committing it helps to get everyone on the same page and makes sure we make progress. Tinderbox breakages that are the result of this commit are entirely the committer's fault -- in other words: buildworld testing on amd64 only. Credits follow: Submitted by: Garrett Cooper <yanegomi@gmail.com> Sponsored by: Isilon Systems Based on work by: keramida@ Thanks to: gnn@, mdf@, mlaier@, sjg@ Special thanks to: keramida@
* More -Wmissing-variable-declarations fixes.ed2012-10-209-18/+52
| | | | | | | | | | In addition to adding missing `static' keywords: - bin/dd: Pull in `extern.h' to guarantee consistency with source file. - libexec/rpc.rusersd: Move shared globals into an extern.h. - libexec/talkd: Move `debug' and `hostname' into extern.h. - usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree. - usr.bin/m4: Move `end_result' into extern.h. - usr.sbin/services_mkdb: Move shared globals into an extern.h.
* More -Wmissing-variable-declarations fixes.ed2012-10-191-1/+1
| | | | | | | | | | | | | | | | In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
* Fix warnings found by -Wmising-variable-declarations.ed2012-10-193-5/+5
| | | | | | | | | | | This self-written compiler warning, which is hopefully going to be committed into LLVM sources soon, warns about potentially missing `static' keywords, similar to -Wmissing-prototypes. - bin/pax: Move external declaration of chdname and s_mask into extern.h. - bin/setfacl: Move setfacl.c-specific stuff out of setfacl.h. - sbin/mount_fusefs: Remove char *progname; use getprogname(). - others: add `static' where possible.
* atrun: Do not assume that MAXLOGNAME <= 100.jilles2012-09-261-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 MFC after: 1 week
* Do not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOADkib2012-09-191-4/+4
| | | | | | | for a non-absolute path. PR: bin/171604 MFC after: 3 days
* Bump date missed in r202756eadler2012-09-142-2/+2
| | | | | | | PR: docs/171624 Submitted by: bdrewery Approved by: gabor MFC after: 3 days
* 1. Use install -d to create the entropy_dir if missing so that we can do itdougb2012-09-041-28/+26
| | | | | | | | | | | | | | | | | | | | all in one command, with no permissions race. 2. Simplify the rotation logic by cd'ing into the directory, with a test to make sure that it succeeds. 3. Remove any files numbered higher than entropy_save_num. This helps when the user reduces the number, and may be useful for other purposes down the road. 4. Simplify the rotation logic by first testing the common case (it's a regular file) then testing if something else exists with the same name using elif. Also switch from using jot to simpler countdown format. 5. Fix logger lines and error messages to be more consistent, and wrap the code more consistently in the 80 column range. The "not a regular file" error message was mistakenly wrapped entirely in "quotes" which caused logger to include line-wrapping whitespace. Change that to wrap only the variables in quotes, which is both consistent and works better. 6. Update copyright to reflect the fact that changes were made this year. Parts of 2-4 were taken from etc/periodic/daily/310.accounting
* Rework all non-contributed files that use `struct timezone'.ed2012-09-013-8/+8
| | | | | | | | | | | | | | This structure is not part of POSIX. According to POSIX, gettimeofday() has the following prototype: int gettimeofday(struct timeval *restrict tp, void *restrict tzp); Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is not used). Remove dead error handling code. Also use NULL for a nul-pointer instead of integer 0. While there, change all pieces of code that only use tv_sec to use time(3), as this provides less overhead.
* Do not call process_nodelete with NULL object pointer.kan2012-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
* Fix two instances of the file names generated by revnetgroup(8).zeising2012-08-181-2/+2
| | | | Approved by: joel (mentor)
* Merging of projects/armv6, part 2gonzo2012-08-151-1/+14
| | | | Handle TLS for ARMv6 and ARMv7
* Pospone the DF_1_NODELETE processing until object DAG is fully loaded.kan2012-08-141-7/+27
| | | | | | | | | Trying to up the reference from the load loop risks missing dependencies that have not been loaded yet. MFC afer: 1 week Reported by: nox Reviewd by: kib
* Ensure we align the stack to 8 bytes in rtld.andrew2012-08-041-2/+4
| | | | | | | This is not strictly required with the current ABI but will be when we switch to the ARM EABI. The aapcs requires the stack to be 4 byte aligned at all times and 8 byte aligned when calling a public subroutine where the current ABI only requires sp to be a multiple of 4.
* Parse notes only after object structure had been allocated.kan2012-08-031-2/+2
| | | | | Reported by: kargl Reviewed by: kib (sans whitespace)
* Import the DragonFly BSD commit 4f0bc915b65fcf5a23214f6d221d65c80be68ad4kib2012-07-153-72/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by John Marino <draco@marino.st>, with the following (edited) commit message Date: Sat, 24 Mar 2012 06:40:50 +0100 Subject: [PATCH 1/1] rtld: Implement DT_RUNPATH and -z nodefaultlib DT_RUNPATH is incorrectly being considered as an alias of DT_RPATH. The purpose of DT_RUNPATH is to have two different types of rpath: one that can be overridden by the environment variable LD_LIBRARY_PATH and one that can't. With the currently implementation, LD_LIBRARY_PATH will always trump any embedded rpath or runpath tags. Current path search order by rtld: ================================== LD_LIBRARY_PATH DT_RPATH / DT_RUNPATH (always the same) ldconfig hints file (default: /var/run/ld-elf.so.hints) /usr/lib New path search order by rtld: ============================== DT_RPATH of the calling object if no DT_RUNPATH DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj LD_LIBRARY_PATH DT_RUNPATH ldconfig hints file /usr/lib The new path search matches how the linux runtime loader works. The other major added feature is support for linker flag "-z nodefaultlib". When this flag is passed to the linker, rtld will skip all references to the standard library search path ("/usr/lib" in this case but it could handle more color delimited paths) except in DT_RPATH and DT_RUNPATH. New path search order by rtld with -z nodefaultlib flag set: ============================================================ DT_RPATH of the calling object if no DT_RUNPATH DT_RPATH of the main binary if no DT_RUNPATH and binary isn't calling obj LD_LIBRARY_PATH DT_RUNPATH ldconfig hints file (skips all references to /usr/lib) FreeBSD notes: - we fixed some bugs which were submitted to DragonFly and merged there as commit 1ff8a2bd3eb6e5587174c6a983303ea3a79e0002; - we added LD_LIBRARY_PATH_RPATH environment variable to switch to the previous behaviour of considering DT_RPATH a synonym for DT_RUNPATH; - the FreeBSD default search path is /lib:/usr/lib and not /usr/lib. Reviewed by: kan MFC after: 1 month MFC note: flip the ld_library_path_rpath default value for stable/9
* Ensure that for the object which is a dependency for some filtee,kib2012-06-271-40/+84
| | | | | | | | | | | | | | | | relocations are performed before the object's initializer is called. When dlopen()ing an object, relocate the whole DAG rooted in the object instead of only relocating the object itself and list of newly loaded dependencies. Reversed sequence currently can occur if the same object is a dependency for both filtee and filter, since filtees are loaded typically during the relocation processing, when some filter dependencies might be already loaded but not relocated yet. Reported and tested by: swills Reviewed by: kan MFC after: 1 week
* Eliminate the static buffer used to read the first page of the mappedkib2012-06-141-62/+70
| | | | | | | | | | | | | | | object, and eliminate the pread(2) call as well [1]. 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 [2]. Insipired by the patch by: Ian Lepore <freebsd damnhippie dyndns org> [1] Suggested by: alc [2] MFC after: 2 weeks
* None of these programs actually use auth.conf.des2012-06-111-1/+0
| | | | MFC after: 1 week
* mdoc: Only use macros inside a reference block.joel2012-05-231-8/+4
|
* mdoc: fix .Bl -offset.joel2012-05-231-1/+1
|
* Properly use LDADD & DPADD to link against libwrap.marcel2012-05-191-1/+3
|
* open the resolved pathbapt2012-05-051-4/+4
| | | | | | | fix debug message Submitted by: John Marino <draco@marino.st> Approved by: des (mentor)
* Work around a situation where symlook_obj() could be called for thekib2012-05-051-3/+5
| | | | | | | | | | | | | object for which digest_dynamic1() was not done yet. Just return EINVAL and do not try to dereference NULL buckets hash array. This seems to happen on ia64 for rtld object itself, where the R_IA_64_FPTR64LSB relocations require symbol lookup. The dynamic linker itself does not rely on identity of the C-level function pointers (i.e. function descriptors). Reported and reviewed by: marcel MFC after: 8 days
* Add two special directives to libmap.conf:bapt2012-04-301-30/+132
| | | | | | | | | | | | | | | 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. Reviewed by: kib, des Approved by: des (mentor) MFC after: 1 month
* Add GNU hash support for rtld.kib2012-04-309-19/+163
| | | | | | | Based on dragonflybsd support for GNU hash by John Marino <draco marino st> Reviewed by: kan Tested by: bapt MFC after: 2 weeks
* Split the symlook_obj1 into a loop iterating over the ELF object symbolkib2012-04-302-95/+116
| | | | | | | | | | hash elements, and a helper matched_symbol() which match the given hash entry and request, performing needed type and version checks. Based on dragonflybsd support for GNU hash by John Marino <draco marino st> Reviewed by: kan Tested by: bapt MFC after: 2 weeks
* Fix a missed file in r234580: replace the now-obsolete powerpc_mb() withnwhitehorn2012-04-231-2/+2
| | | | regular mb().
* Do a better job at determining the username of the login session.ed2012-04-191-1/+23
| | | | | | | | | | | When multiple users share the same UID, the old code will simply pick an arbitrary username to attach to the utmpx entries. Make the code a bit more accurate by first checking whether getlogin() returns a username which corresponds to the uid of the calling process. If this fails, simply fall back to picking an arbitrary username. Reported by: saurik on GitHub MFC after: 2 weeks
OpenPOWER on IntegriCloud