aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Revert r253748,253749Andriy Gapon2013-07-282-0/+2
| | | | | | | | | This WIP should not have been committed yet. Pointyhat to: avg Notes: svn path=/head/; revision=253750
* remove needless inclusion of machine/cpu.h in userlandAndriy Gapon2013-07-282-2/+0
| | | | | | | MFC after: 21 days Notes: svn path=/head/; revision=253749
* Add the name of the file that could not be opened to the error messageGuy Helmer2013-06-111-1/+1
| | | | | | | | | regarding the failure. Suggested while working on PR bin/113239. Notes: svn path=/head/; revision=251627
* Prevent races running the queue by serializing access to theGuy Helmer2013-06-111-0/+4
| | | | | | | | | queue directory. PR: bin/113239 Notes: svn path=/head/; revision=251625
* mdoc sweep.Joel Dahl2013-05-121-1/+1
| | | | Notes: svn path=/head/; revision=250582
* Properly terminate the result string for intermediate results, toKonstantin Belousov2013-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 Notes: svn path=/head/; revision=250075
* The origin_subst_one() function limits the length of the string toKonstantin Belousov2013-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 Notes: svn path=/head/; revision=249525
* Map libraries linked with -Ttext-segment=base_addr at base_addr.Tijl Coosemans2013-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 Notes: svn path=/head/; revision=247396
* Since clang 3.2 now has an option to suppress warnings about implicitlyDimitry Andric2013-02-162-10/+0
| | | | | | | | | | promoted K&R parameters, remove the workarounds added for sendmail components in r228558. MFC after: 1 week Notes: svn path=/head/; revision=246880
* Avoid use of register variables, which some compilers (e.g. clang)Nathan Whitehorn2013-02-081-9/+5
| | | | | | | | | don't like. It makes the code a little clearer as well. MFC after: 1 week Notes: svn path=/head/; revision=246556
* Retire struct sockaddr_inarp.Gleb Smirnoff2013-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@ Notes: svn path=/head/; revision=246143
* Mark tftp_log() as __printflike() (which would have caught the bugMarius Strobl2013-01-314-15/+17
| | | | | | | | | fixed in r246106) and deal with the fallout. MFC after: 2 weeks Notes: svn path=/head/; revision=246139
* Remove extra %s from debug statement that ends up crashing tftpd ifSean Bruno2013-01-301-1/+1
| | | | | | | | | | debug is set very high (like -d15 in my case). Obtained from: Yahoo! Inc MFC after: 2 weeks Notes: svn path=/head/; revision=246106
* When building for ARM EABI link against libgcc for the __aeabi_* functions.Andrew Turner2013-01-191-0/+10
| | | | Notes: svn path=/head/; revision=245653
* Use correct size in snprintf.Antoine Brodin2012-12-251-2/+1
| | | | | | | | | | | Remove unused buffer. PR: 174631 Submitted by: Henning Petersen MFC after: 1 month Notes: svn path=/head/; revision=244686
* Use absolute path for /usr/libexec/ld-elf.so.1 symlink.Pawel Jakub Dawidek2012-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 Notes: svn path=/head/; revision=243864
* Do not change entire BINDIR, it might be needed later, just changePawel Jakub Dawidek2012-12-041-2/+2
| | | | | | | | | symlink target. MFC after: 2 weeks Notes: svn path=/head/; revision=243862
* Change /usr/libexec/ld-elf.so.1 to point at ../../libexec/ld-elf.so.1Pawel Jakub Dawidek2012-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 Notes: svn path=/head/; revision=243861
* rtld: Fix fd leak with parallel dlopen and fork/exec.Jilles Tjoelker2012-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 Notes: svn path=/head/; revision=242587
* atrun(8): scale default load average limit with the number of CPUsMateusz Guzik2012-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 Notes: svn path=/head/; revision=242372
* Check the return error of set[e][ug]id. While this can never fail in theEitan Adler2012-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 Notes: svn path=/head/; revision=241848
* Add ATF to the build. This is may be a bit rought around the egdes,Marcel Moolenaar2012-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@ Notes: svn path=/head/; revision=241823
* More -Wmissing-variable-declarations fixes.Ed Schouten2012-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. Notes: svn path=/head/; revision=241777
* More -Wmissing-variable-declarations fixes.Ed Schouten2012-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'. Notes: svn path=/head/; revision=241737
* Fix warnings found by -Wmising-variable-declarations.Ed Schouten2012-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. Notes: svn path=/head/; revision=241720
* atrun: Do not assume that MAXLOGNAME <= 100.Jilles Tjoelker2012-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 Notes: svn path=/head/; revision=240974
* Do not reference z_nodeflib for !objgiven case, thus fixing LD_PRELOADKonstantin Belousov2012-09-191-4/+4
| | | | | | | | | | for a non-absolute path. PR: bin/171604 MFC after: 3 days Notes: svn path=/head/; revision=240686
* Bump date missed in r202756Eitan Adler2012-09-142-2/+2
| | | | | | | | | | PR: docs/171624 Submitted by: bdrewery Approved by: gabor MFC after: 3 days Notes: svn path=/head/; revision=240506
* 1. Use install -d to create the entropy_dir if missing so that we can do itDoug Barton2012-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 Notes: svn path=/head/; revision=240090
* Rework all non-contributed files that use `struct timezone'.Ed Schouten2012-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. Notes: svn path=/head/; revision=239991
* 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=/head/; revision=239470
* Fix two instances of the file names generated by revnetgroup(8).Niclas Zeising2012-08-181-2/+2
| | | | | | | Approved by: joel (mentor) Notes: svn path=/head/; revision=239364
* Merging of projects/armv6, part 2Oleksandr Tymoshenko2012-08-151-1/+14
| | | | | | | Handle TLS for ARMv6 and ARMv7 Notes: svn path=/head/; revision=239269
* Pospone the DF_1_NODELETE processing until object DAG is fully loaded.Alexander Kabaev2012-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 Notes: svn path=/head/; revision=239253
* Ensure we align the stack to 8 bytes in rtld.Andrew Turner2012-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. Notes: svn path=/head/; revision=239031
* Parse notes only after object structure had been allocated.Alexander Kabaev2012-08-031-2/+2
| | | | | | | | Reported by: kargl Reviewed by: kib (sans whitespace) Notes: svn path=/head/; revision=239019
* Import the DragonFly BSD commit 4f0bc915b65fcf5a23214f6d221d65c80be68ad4Konstantin Belousov2012-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 Notes: svn path=/head/; revision=238471
* Ensure that for the object which is a dependency for some filtee,Konstantin Belousov2012-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 Notes: svn path=/head/; revision=237659
* Eliminate the static buffer used to read the first page of the mappedKonstantin Belousov2012-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 Notes: svn path=/head/; revision=237058
* None of these programs actually use auth.conf.Dag-Erling Smørgrav2012-06-111-1/+0
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=236892
* mdoc: Only use macros inside a reference block.Joel Dahl2012-05-231-8/+4
| | | | Notes: svn path=/head/; revision=235857
* mdoc: fix .Bl -offset.Joel Dahl2012-05-231-1/+1
| | | | Notes: svn path=/head/; revision=235856
* Properly use LDADD & DPADD to link against libwrap.Marcel Moolenaar2012-05-191-1/+3
| | | | Notes: svn path=/head/; revision=235643
* open the resolved pathBaptiste Daroussin2012-05-051-4/+4
| | | | | | | | | | fix debug message Submitted by: John Marino <draco@marino.st> Approved by: des (mentor) Notes: svn path=/head/; revision=235059
* Work around a situation where symlook_obj() could be called for theKonstantin Belousov2012-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 Notes: svn path=/head/; revision=235054
* Add two special directives to libmap.conf:Baptiste Daroussin2012-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 Notes: svn path=/head/; revision=234851
* Add GNU hash support for rtld.Konstantin Belousov2012-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 Notes: svn path=/head/; revision=234841
* Split the symlook_obj1 into a loop iterating over the ELF object symbolKonstantin Belousov2012-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 Notes: svn path=/head/; revision=234840
* Fix a missed file in r234580: replace the now-obsolete powerpc_mb() withNathan Whitehorn2012-04-231-2/+2
| | | | | | | regular mb(). Notes: svn path=/head/; revision=234592
* Do a better job at determining the username of the login session.Ed Schouten2012-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 Notes: svn path=/head/; revision=234469