summaryrefslogtreecommitdiffstats
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* Update dependencies.bdrewery2016-02-261-1/+3
| | | | Sponsored by: EMC / Isilon Storage Division
* talk(1): Replace select(2) with poll(2)pfg2016-02-252-20/+16
| | | | Hinted by: OpenBSD and NetBSD
* Convert casperd(8) daemon to the libcasper.oshogbo2016-02-252-17/+20
| | | | | | | | | | | | | | | | | | | | After calling the cap_init(3) function Casper will fork from it's original process, using pdfork(2). Forking from a process has a lot of advantages: 1. We have the same cwd as the original process. 2. The same uid, gid and groups. 3. The same MAC labels. 4. The same descriptor table. 5. The same routing table. 6. The same umask. 7. The same cpuset(1). From now services are also in form of libraries. We also removed libcapsicum at all and converts existing program using Casper to new architecture. Discussed with: pjd, jonathan, ed, drysdale@google.com, emaste Partially reviewed by: drysdale@google.com, bdrewery Approved by: pjd (mentor) Differential Revision: https://reviews.freebsd.org/D4277
* Add simple support for CloudABI processes to kdump(1).jhb2016-02-251-0/+7
| | | | | | | | This does not decode arguments to system calls but should properly decode system call names and error return values. Reviewed by: ed Differential Revision: https://reviews.freebsd.org/D5412
* DIRDEPS_BUILD: Regenerate without local dependencies.bdrewery2016-02-2427-204/+0
| | | | | | | | These are no longer needed after the recent 'beforebuild: depend' changes and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports skipping 'make depend'. Sponsored by: EMC / Isilon Storage Division
* DIRDEPS_BUILD: Update dependencies.bdrewery2016-02-243-0/+32
| | | | Sponsored by: EMC / Isilon Storage Division
* Properly fix these builds by adding NO_WMISSING_VARIABLE_DECLARATIONS from ↵bdrewery2016-02-242-6/+2
| | | | | | | | | r249657. This reverts r284374. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Obsolete mkulzma(8) and geom_uncompress(4), their functionalitysobomax2016-02-245-466/+0
| | | | | | is now provided by mkuzip(8) and geom_uzip(4) respectively. MFC after: 1 month
* Improve mkuzip(8) and geom_uzip(4), merge in LZMA support from mkulzma(8)sobomax2016-02-2311-70/+717
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and geom_uncompress(4): 1. mkuzip(8): - Proper support for eliminating all-zero blocks when compressing an image. This feature is already supported by the geom_uzip(4) module and CLOOP format in general, so it's just a matter of making mkuzip(8) match. It should be noted, however that this feature while it sounds great, results in very slight improvement in the overall compression ratio, since compressing default 16k all-zero block produces only 39 bytes compressed output block, which is 99.8% compression ratio. With typical average compression ratio of amd64 binaries and data being around 60-70% the difference between 99.8% and 100.0% is not that great further diluted by the ratio of number of zero blocks in the uncompressed image to the overall number of blocks being less than 0.5 (typically). However, this may be important from performance standpoint, so that kernel are not spinning its wheels decompressing those empty blocks every time this zero region is read. It could also be important when you create huge image mostly filled with zero blocks for testing purposes. - New feature allowing to de-duplicate output image. It turns out that if you twist CLOOP format a bit you can do that as well. And unlike zero-blocks elimination, this gives a noticeable improvement in the overall compression ratio, reducing output image by something like 3-4% on my test UFS2 3GB image consisting of full FreeBSD base system plus some of the packages (openjdk, apache etc), about 2.3GB worth of file data (800+MB compressed). The only caveat is that images created with this feature "on" would not work on older versions of FeeBSDxi kernel, hence it's turned off by default. - provide options to control both features and document them in manual page. - merge in all relevant LZMA compression support from the mkulzma(8), add new option to select between both. - switch license from ad-hoc beerware into standard 2-clause BSD. 2. geom_uzip(4): - implement support for de-duplicated images; - optimize some code paths to handle "all-zero" blocks without reading any compressed data; - beef up manual page to explain that geom_uzip(4) is not limited only to md(4) images. The compressed data can be written to the block device and accessed directly via magic of GEOM(4) and devfs(4), including to mount root fs from a compressed drive. - convert debug log code from being compiled in conditionally into being present all the time and provide two sysctls to turn it on or off. Due to intended use of the module, it can be used in environments where there may not be a luxury to put new kernel with debug code enabled. Having those options handy allows debug issues without as much problem by just having access to serial console or network shell access to a box/appliance. The resulting additional CPU cycles are just few int comparisons and branches, and those are minuscule when compared to data decompression which is the main feature of the module. - hopefully improve robustness and resiliency of the geom_uzip(4) by performing some of the data validation / range checking on the TOC entries and rejecting to attach to an image if those checks fail. - merge in all relevant LZMA decompression support from the geom_uncompress(4), enable automatically when appropriate format is indicated in the header. - move compilation work into its own worker thread so that it does not clog g_up. This allows multiple instances work in parallel utilizing smp cores. - document new knobs in the manual page. Reviewed by: adrian MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D5333
* Add handling for non-native error values to libsysdecode.jhb2016-02-239-283/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new functions, sysdecode_abi_to_freebsd_errno() and sysdecode_freebsd_to_abi_errno(), which convert errno values between the native FreeBSD ABI and other supported ABIs. Note that the mappings are not necessarily perfect meaning in some cases multiple errors in one ABI might map to a single error in another ABI. In that case, the reverse mapping will return one of the errors that maps, but which error is non-deterministic. Change truss to always report the raw error value to the user but use libsysdecode to map it to a native errno value that can be used with strerror() to generate a description. Previously truss reported the "converted" error value. Now the user will always see the exact error value that the application sees. Change kdump to report the truly raw error value to the user. Previously kdump would report the absolute value of the raw error value (so for Linux binaries it didn't output the FreeBSD error value, but the positive value of the Linux error). Now it reports the real (i.e. negative) error value for Linux binaries. Also, use libsysdecode to convert the native FreeBSD error reported in the ktrace record to the raw error used by the ABI. This means that the Linux ABI can now be handled directly in ktrsysret() and removes the need for linux_ktrsysret(). Reviewed by: bdrewery, kib Helpful notes: wblock (manpage) Differential Revision: https://reviews.freebsd.org/D5314
* Add support for displaying thread IDs to truss(1).jhb2016-02-236-72/+60
| | | | | | | | | | | | | | | - Consolidate duplicate code for printing the metadata at the start of each line into a shared function. - Add an -H option which will log the thread ID of the relevant thread for each event. While here, remove some extraneous calls to clock_gettime() in print_syscall() and print_syscall_ret(). The caller of print_syscall_ret() always updates the current thread's "after" time before it is called. Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D5363
* Remove O_SYNC from the options passed to dbmopen().se2016-02-191-1/+1
| | | | | | | | | | | | | | | | The output file is created as a temporary file that is moved over the existing file after completion. Thus there is no need to immediately flush all created db records to the temporary file. This speeds up creation of the termcap db by a factor of 40 on my ZFS based /etc filesytem (from 25 seconds to 0.6 seconds). I have compared multiple output files created with and without O_SYNC and they came out identical each time. Nonetheless it might be best to MFC this change and the similar one for services_mkdb (r295465) at the same time when the changes to hash.c in review D5186 are merged. MFC: 1 week
* DIRDEPS_BUILD: Add dependencies somehow missed in r295681.bdrewery2016-02-191-0/+66
| | | | Sponsored by: EMC / Isilon Storage Division
* Fix installation of makewhatis.local(1) since r283777.bdrewery2016-02-181-5/+0
| | | | | | | | The wrapper script has moved to libexec/makewhatis.local since it is not directlry related to the older makewhatis(1) utility that has been replaced by the usr.bin/mandoc version. Reported by: vangyzen
* DIRDEPS_BUILD: Hookup CLANG_EXTRAS.bdrewery2016-02-1623-0/+1140
| | | | Sponsored by: EMC / Isilon Storage Division
* Remove an unused variable that snuck into the previous revision.jhb2016-02-161-1/+0
|
* Fetch the current thread and it's syscall state from the trussinfo objectjhb2016-02-163-24/+27
| | | | | | instead of passing some of that state as arguments to print_syscall() and print_syscallret(). This just makes the calls of these functions shorter and easier to read.
* Fix naive use of ftell(3).pfg2016-02-161-1/+1
| | | | Secure coding practices, FIO19-C.
* Add myself as ports committer (including calendar)olivier2016-02-161-0/+1
| | | | | Approved by: jadawin Differential Revision: https://reviews.freebsd.org/D5295
* DIRDEPS_BUILD: Update dependencies.bdrewery2016-02-163-12/+1
| | | | Sponsored by: EMC / Isilon Storage Division
* Test directories can build in parallel fine.bdrewery2016-02-161-0/+3
| | | | Sponsored by: EMC / Isilon Storage Division
* Correct the ABI name for Linux/i386 binaries under FreeBSD/i386.jhb2016-02-151-1/+1
| | | | | | This allows truss to work for these binaries again after r288424. MFC after: 3 days
* Sign extend the error value for failing Linux/i386 system calls. Thisjhb2016-02-151-0/+2
| | | | | restores the mapping of Linux errors to native FreeBSD errno values after the refactoring in r288424.
* Fix a bug that caused nothing to be skipped when skipping exactly thekevlo2016-02-141-1/+1
| | | | | | number of bytes present in a regular file was requested. Obtained from: OpenBSD
* elfcopy: enable PE and EFI supportemaste2016-02-121-3/+4
| | | | Sponsored by: The FreeBSD Foundation
* Rename variable to reflect the condition.kib2016-02-091-4/+4
| | | | | Suggested by: jhb Sponsored by: The FreeBSD Foundation
* Rename P_KTHREAD struct proc p_flag to P_KPROC.kib2016-02-091-4/+4
| | | | | | | | I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL() definition. Suggested by: jhb Sponsored by: The FreeBSD Foundation
* Increase max allowed backlog for listen socketsalfred2016-02-023-9/+10
| | | | | | | | from short to int. PR: 203922 Submitted by: White Knight <white_knight@2ch.net> MFC After: 4 weeks
* Add a SYSDECODE_ABI_ prefix to the ABI enums to avoid potential collisions.jhb2016-01-3015-21/+21
| | | | | | Suggested by: jmallett Reviewed by: bdrewery, jmallett Differential Revision: https://reviews.freebsd.org/D5123
* Augment struct tcpstat with tcps_states[], which is used for book-keepingglebius2016-01-271-1/+1
| | | | | | | the amount of TCP connections by state. Provides a cheap way to get connection count without traversing the whole pcb list. Sponsored by: Netflix
* Bump copyrightdteske2016-01-271-1/+1
|
* Add `-k' for dpv(3) `keep_tite' config optiondteske2016-01-262-4/+13
| | | | | | For scripts using dialog(1) several times, it can be visually distracting running dpv(1) several times amidst other dialogs. The `-k' option, similar to dialog(1) `--keep-tite', enables the same functionality to smooth ti/te.
* Add support to libsysdecode for decoding system call names.jhb2016-01-2620-191/+83
| | | | | | | | | | | | | | | | | | | | | | | | A new sysdecode_syscallname() function accepts a system call code and returns a string of the corresponding name (or NULL if the code is unknown). To support different process ABIs, the new function accepts a value from a new sysdecode_abi enum as its first argument to select the ABI in use. Current ABIs supported include FREEBSD (native binaries), FREEBSD32, LINUX, LINUX32, and CLOUDABI64. Note that not all ABIs are supported by all platforms. In general, a given ABI is only supported if a platform can execute binaries for that ABI. To simplify the implementation, libsysdecode's build reuses the existing pre-generated files from the kernel source tree rather than duplicating new copies of said files during the build. kdump(1) and truss(1) now use these functions to map system call identifiers to names. For kdump(1), a new 'syscallname()' function consolidates duplicated code from ktrsyscall() and ktrsyscallret(). The Linux ABI no longer requires custom handling for ktrsyscall() and linux_ktrsyscall() has been removed as a result. Reviewed by: bdrewery Differential Revision: https://reviews.freebsd.org/D4823
* Disable gprof and users on RISC-V, they don't build.br2016-01-251-1/+4
|
* elfdump: handle STT_SPARC_REGISTERemaste2016-01-251-4/+24
| | | | | | | | | | STT_SPARC_REGISTER is a SPARC-specific symbol type specified by the Sparcv9 ABI to provide some information on register use by the object. Also rework st_info type lookup to avoid out-of-bounds array access. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* We don't support a.out executables on RISC-V.br2016-01-241-2/+2
| | | | | | | Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5048
* Fix a regression in the .de and .dk whois special casesfanf2016-01-231-7/+15
| | | | | | | | | | Ensure the special cases trigger whether we come via a referral or via the -c option. Match host names case-insensitively. Use the default character set supported by .de (UTF-8) since that is more compatible with the modern world than ISO 8859-1. Persuade them to give us a useful answer whether an internationalized domain name is given in UTF-8 or in punycode.
* A lot of the cleverness in whois is no longer needed!fanf2016-01-232-189/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | The IANA whois server has the right referral information for domain names, IP addresses, and AS numbers, so whois does not need to be able to choose servers itself (except for a few cases where referrals do not work). We can delete a chunk of code, which is always fun. This change improves the referral handling to be less sensitive to all the various formats, and to allow multi-hop referral chains, such as IANA -> registry -> registrar. ARIN queries have the "+" flag added if no flags are present, so we get full details if the query matches multiple objects. The Verisign anti-spam logic is also now suppressed if the user provided a non- trivial query string. Uninformative rubric is now trimmed by default. The -S option turns off trimming, and disables query fettling. The -i option is back to its traditional pre-1999 hostname, since whois.internic.net is more useful than whois.networksolutions.com. Note that the old fallback/default server whois.crsnic.net is an alias for whois.internic.net. The manual is more informative about query syntax.
* Update whois synopsis and usage with new optionsfanf2016-01-222-2/+2
|
* Bump .Dd after r294575bjk2016-01-221-1/+1
|
* A few `whois` usability improvementsfanf2016-01-222-56/+80
| | | | | | | | | Look up AS numbers at ARIN. Handle more referral formats. Suppress spammy nameserver objects when querying the .com and .net whois servers by explicitly querying for domain names by default.
* Add support for RISC-V ISA.br2016-01-222-0/+56
| | | | | | | Reviewed by: andrew Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D5014
* Fix usr.bin.truncate.truncate_test.bad_truncate with ZFS /tmp.asomers2016-01-191-7/+4
| | | | | | | | | | | | The bad_truncate test sets the uimmutable flag to produce an error in truncate, but that flag isn't supported by ZFS. If /tmp is on a ZFS filesystem, the test will fail. Change it to use readonly permissions and an unpriveleged user instead. Reviewed by: jilles MFC after: 1 week Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4862
* Import misc.c,v 1.46 from OpenBSD (by espie@)bapt2016-01-181-1/+3
| | | | Yet another missed ferror call
* Fix printing multibyte printing when performing a networked finger(1) requestbapt2016-01-181-6/+7
| | | | MFC after: 1 week
* mdoc: sort Xrjoel2016-01-181-3/+3
|
* Update mandoc to 20160116bapt2016-01-151-2/+4
|
* - Add support for zip to lesspipe.shak2016-01-151-0/+3
| | | | Approved by: des
* - Match directory extraction message with Infozip [1]ak2016-01-151-2/+5
| | | | | | | - Add comment explaining masks in check_binary() Obtained from: NetBSD [1] Approved by: des
* - Extract common code from extract()/extract_stdout() to extract2fd()ak2016-01-152-143/+91
| | | | | | | - Update information about central directory handling Obtained from: NetBSD Approved by: des
OpenPOWER on IntegriCloud