aboutsummaryrefslogtreecommitdiff
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't mess with BLOCKSIZE in shell startup files - it's set by login.conf(5);Edward Tomasz Napierala2019-01-203-8/+0
| | | | | | | | | | | | | there's no need to even mention it in shell rc files. Not that it's wrong; just pointless and somewhat misleading. Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18809 Notes: svn path=/head/; revision=343231
* sh: Send libedit "ferr" output to fd 2Jilles Tjoelker2019-01-201-5/+3
| | | | | | | | | | The libedit "fout" output must be sent to fd 2 since it contains prompts that POSIX says must be sent to fd 2. However, the libedit "ferr" output receives error messages such as from "bind" that make no sense to send to fd 1. Notes: svn path=/head/; revision=343215
* Fix an edge case when parsing large numbers which resulted in inconsistentDag-Erling Smørgrav2019-01-093-2/+22
| | | | | | | | | | | results between an expression that refers to a variable by name and the same expression that includes the same variable by value. Submitted by: se@ MFC after: 1 week Notes: svn path=/head/; revision=342880
* sh: Add test for exported but unset variablesJilles Tjoelker2019-01-032-0/+6
| | | | | | | PR: 233545 Notes: svn path=/head/; revision=342741
* sh: Do not place exported but unset variables into the environmentJilles Tjoelker2019-01-031-2/+2
| | | | | | | | | PR: 233545 Submitted by: Jan Beich Obtained from: NetBSD Notes: svn path=/head/; revision=342740
* Add a note that the use of -B option does not guarantee a size of fragmentChris Rees2018-12-291-3/+13
| | | | | | | | | | | | | | | | | | if -z option also used. Recommend the use of zip(1) if compressed files of predictable size needed. PR: docs/41089 Submitted by: Sevan Janiyan Reported by: areilly@bigpond.net.au While here, pet igor Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D18686 Notes: svn path=/head/; revision=342601
* Make sh(1) collapse $HOME into "~" in PS1.Edward Tomasz Napierala2018-12-281-2/+20
| | | | | | | | | | Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18663 Notes: svn path=/head/; revision=342577
* Remove, the now very outdated, timed.George V. Neville-Neil2018-12-155-226/+3
| | | | | | | | | | Submitted by: Kyle Spiers ksspiers at gmail Reviewed by: bcr,brooks,bz,sbruno Relnotes: yes Differential Revision: https://reviews.freebsd.org/D18505 Notes: svn path=/head/; revision=342139
* sh(1): Remove -c string from set builtin documentationJilles Tjoelker2018-12-081-3/+3
| | | | | | | | | Altering the -c string at run time does not make sense and is not possible. MFC after: 1 week Notes: svn path=/head/; revision=341725
* Clarify that /dev/kmem is not used.Sevan Janiyan2018-12-031-1/+8
| | | | | | | | | | Move cross ref to right place while here. Submitted by: kib MFC after: 7 days Notes: svn path=/head/; revision=341440
* Note these tools use kvm(3) and not procfs as in Solaris.Sevan Janiyan2018-12-031-1/+7
| | | | | | | | Obtained from: NetBSD MFC after: 7 days Notes: svn path=/head/; revision=341435
* Clarify that patterns are extended regular expressions in pkill(1) manual page.Guangyuan Yang2018-12-011-2/+2
| | | | | | | | | PR: 231060 Submitted by: naddy MFC after: 3 days Notes: svn path=/head/; revision=341357
* Replace hand-crafted naive byte-by-byte zero block detection routineMaxim Sobolev2018-11-292-7/+7
| | | | | | | | | | | | | | with macro based around memcmp(). The latter is expected to be some 8 times faster on a modern 64-bit architectures. In practice, throughput of doing conv=sparse from /dev/zero to /dev/null went up some 5-fold here from 1.9GB/sec to 9.7GB/sec with this change (bs=128k). MFC after: 2 weeks Notes: svn path=/head/; revision=341257
* sh: Fix ${param?} default error messageJilles Tjoelker2018-11-283-2/+15
| | | | | | | | | | | | | | | If word in ${param?word} is missing, the shell shall write a default error message. So expanding ${param?} when param is not set should write an error message like sh: param: parameter not set This was broken by r316417. PR: 233585 Notes: svn path=/head/; revision=341164
* sh: Use 126 and 127 exit status for failures opening a scriptJilles Tjoelker2018-11-274-4/+18
| | | | | | | | | | This affects scripts named on the command line, named with a '.' special builtin and found via the PATH %func autoloading mechanism. PR: 231986 Notes: svn path=/head/; revision=341097
* rm(1): Formalize non-functional status of -P flagConrad Meyer2018-11-102-137/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -P was introduced in 4.4BSD-Lite2 around 1994. It overwrote file contents with a pass of 0xff, 0x00, then 0xff, in a low effort attempt to "really delete" files. It has no user-visible effect; at the end of the day, the file is unlinked via the filesystem. Furthermore, the utility of overwriting files with patterned data is extremely limited due to caveats at every layer of the stack[0] and therefore mostly futile. At the least, three passes is likely wasteful on modern hardware[1]. It could also be seen as a violation of the "Unix Philosophy" to do one thing per tiny, composable program. Since 1994, FreeBSD has left it alone; OpenBSD replaced it with a single pass of arc4random(3) output in 2012[2]; and NetBSD implemented partial, but explicitly incomplete support for U.S. DoD 5220.22-M, "National Industrial Security Program Operating Manual" in 2004[3]. NetBSD's enhanced comment above rm_overwrite makes a strong case for removing the flag entirely: > This is an expensive way to keep people from recovering files from your > non-snapshotted FFS filesystems using fsdb(8). Really. No more. > > It is impossible to actually conform to the exact procedure given in > [NISPOM] if one is overwriting a file, not an entire disk, because the > procedure requires examination and comparison of the disk's defect lists. > Any program that claims to securely erase *files* while conforming to the > standard, then, is not correct. > > Furthermore, the presence of track caches, disk and controller write > caches, and so forth make it extremely difficult to ensure that data have > actually been written to the disk, particularly when one tries to repeatedly > overwrite the same sectors in quick succession. We call fsync(), but > controllers with nonvolatile cache, as well as IDE disks that just plain lie > about the stable storage of data, will defeat this. > > [NISPOM] requires physical media destruction, rather than any technique of > the sort attempted here, for secret data. As a first step towards evental removal, make it a placebo. It's not like it was serving any security function. It is not defined in or mentioned by POSIX. If you are security conscious and need to erase your files, use a woodchipper. At a minimum, the entire disk needs to be overwritten, not just one file. [0]: https://www.ru.nl/publish/pages/909282/draft-paper.pdf [1]: https://commons.erau.edu/cgi/viewcontent.cgi?article=1131&context=jdfsl [2]: https://github.com/openbsd/src/commit/7c5c57ba81b5fe8ff2d4899ff643af18c [3]: https://github.com/NetBSD/src/commit/fdf0a7a25e59af958fca1e2159921562cd Reviewed by: markj, Daniel O'Connor <darius AT dons.net.au> (previous version) Differential Revision: https://reviews.freebsd.org/D17906 Notes: svn path=/head/; revision=340330
* sh: Unify EXERROR and EXEXECJilles Tjoelker2018-11-097-44/+25
| | | | | | | | | | | The difference between EXERROR and EXEXEC was that EXEXEC passed along exitstatus and EXERROR set exitstatus to 2 in the handling code. By changing the places that raised EXERROR to set exitstatus to 2, the handling of EXERROR and EXEXEC becomes the same. Notes: svn path=/head/; revision=340284
* capsicum: use a new capsicum helpers in toolsMariusz Zaborski2018-11-041-4/+3
| | | | | | | Use caph_{rights,ioctls,fcntls}_limit to simplify the code. Notes: svn path=/head/; revision=340138
* Drop ed(1) "crypto"Conrad Meyer2018-11-048-467/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You should not be using DES. You should not have been using DES for the past 30 years. The ed DES-CBC scheme lacked several desirable properties of a sealed document system, even ignoring DES itself. In particular, it did not provide the "integrity" cryptographic property (detection of tampering), and it treated ASCII passwords as 64-bit keys (instead of using a KDF like scrypt or PBKDF2). Some general approaches ed(1) users might consider to replace the removed DES mode: 1. Full disk encryption with something like AES-XTS. This is easy to conceptualize, design, and implement, and it provides confidentiality for data at rest. Like CBC, it lacks tampering protection. Examples include GELI, LUKS, FileVault2. 2. Encrypted overlay ("stackable") filesystems (EncFS, PEFS?, CryptoFS, others). 3. Native encryption at the filesystem layer. Ext4/F2FS, ZFS, APFS, and NTFS all have some flavor of this. 4. Storing your files unencrypted. It's not like DES was doing you much good. If you have DES-CBC scrambled files produced by ed(1) prior to this change, you may decrypt them with: openssl des-cbc -d -iv 0 -K <key in hex> -in <inputfile> -out <plaintext> Reviewed by: allanjude, bapt, emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17829 Notes: svn path=/head/; revision=340132
* Avoid copying a struct stat for acl_from_stat() calls.Mark Johnston2018-11-011-11/+11
| | | | | | | | CID: 1375584 MFC after: 2 weeks Notes: svn path=/head/; revision=340014
* ps(1): Pet mandoc and igorMateusz Piotrowski2018-10-311-7/+8
| | | | | | | | | | | | | | | - Use Xr to reference other manual pages. - Reference execve(2) instead of exec(2) as exec(2) does not exist. - Remove the deprecated "Tn" macro. - Improve the formatting of the etime description. Reviewed by: bcr Approved by: krion (mentor, implicit), mat (mentor, implicit) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17780 Notes: svn path=/head/; revision=339962
* ps(1): Add a standard exit status sectionMateusz Piotrowski2018-10-311-1/+3
| | | | | | | | | | Reviewed by: bcr, eadler Approved by: krion (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17146 Notes: svn path=/head/; revision=339957
* sh: Use exitstatus instead of exerrno to pass EXEXEC statusJilles Tjoelker2018-10-275-13/+10
| | | | | | | No functional change is intended. Notes: svn path=/head/; revision=339822
* Don't set NFSv4 ACL inheritance flags on non-directories.Mark Johnston2018-10-262-14/+71
| | | | | | | | | | | | | | | | | They only make sense in the context of directory ACLs, and attempting to set them on regular files results in errors, causing a recursive setfacl invocation to abort. This is derived from patches by Shawn Webb <shawn.webb@hardenedbsd.org> and Mitchell Horne <mhorne063@gmail.com>. PR: 155163 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15061 Notes: svn path=/head/; revision=339793
* Don't print pathconf() errors if the target file doesn't exist.Mark Johnston2018-10-261-2/+2
| | | | | | | | | | | The subsequent acl_get_file(3) call will simply echo the same error. PR: 229930 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=339781
* Avoid leaking memory in error paths.Mark Johnston2018-10-261-10/+11
| | | | | | | | | CID: 1390906 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=339780
* stty.1: Document kern.tty_info_kstacks behavior (r339471)Conrad Meyer2018-10-201-1/+8
| | | | | | | | | Reported by: bdrewery Reviewed by: bdrewery Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=339474
* dd(1): Correct padding in status=progressKyle Evans2018-09-131-3/+3
| | | | | | | | | | | | | | | | | | Output padding is specified via outlen, which is set using the return value of fprintf. Because it's printing that padding plus a trailing byte, it grows by one each iteration rather than reflecting actual length. Additionally, iec was sized improperly for scaling up similarly to si. Fixing this revealed that the humanize_number(3) call to populate persec was using the wrong width. Submitted by: Thomas Hurst <tom@hur.st> Reviewed by: imp Approved by: re (kib) Differential Revision: https://reviews.freebsd.org/D16960 Notes: svn path=/head/; revision=338646
* Fix unlink(1) for files starting with -Ed Maste2018-09-126-9/+79
| | | | | | | | | | | | | | | | | | Restore the original behavior of unlink(1), passing the provided filename directly to unlink(2), handling the first argument being "--" correctly. This fixes "unlink -foo", broken in r97533. PR: 228448 Submitted by: Brennan Vincent <brennan@umanwizard.com> (original version) Submitted by: Yuri Pankov Reported by: Brennan Vincent <brennan@umanwizard.com> Reviewed by: emaste, kevans, vangyzen, 0mp Approved by: re (delphij) Differential Revision: https://reviews.freebsd.org/D17132 Notes: svn path=/head/; revision=338620
* sh: Fix formal overflow in pointer arithmeticJilles Tjoelker2018-09-051-2/+2
| | | | | | | | | | | | The intention is to lower the value of the pointer, which according to ubsan cannot be done by adding an unsigned quantity. Reported by: kevans Approved by: re (kib) MFC after: 1 week Notes: svn path=/head/; revision=338473
* Finish moving dot.cshrc and dot.profile to bin/csh/ and bin/sh/.Brad Davis2018-08-294-2/+76
| | | | | | | | Approved by: re (gjb), will (mentor) Differential Revision: https://reviews.freebsd.org/D16770 Notes: svn path=/head/; revision=338374
* Fix the install of /root/.login missed as part of r337849.Brad Davis2018-08-281-1/+4
| | | | | | | Approved by: re (rgrimes) Notes: svn path=/head/; revision=338362
* ls(1): Gate the do_color_* definitions behind COLORLSKyle Evans2018-08-181-0/+2
| | | | | | | Pointy hat to: me Notes: svn path=/head/; revision=338028
* ls(1): Support other aliases for --color arguments used by GNU ls(1)Kyle Evans2018-08-182-4/+48
| | | | | | | | | | | These aliases are supported and documented in the man page. For now, they will not be mentioned in the error when an invalid argument is encountered, instead keeping that list to the shorter 'preferred' names of each argument. Reported by: rgrimes Notes: svn path=/head/; revision=338027
* ls(1): Add --color=whenKyle Evans2018-08-175-13/+163
| | | | | | | | | | | | | | | | | | | --color may be set to one of: 'auto', 'always', and 'never'. 'auto' is the default behavior- output colors only if -G or COLORTERM are set, and only if stdout is a tty. 'always' is a new behavior- output colors always. termcap(5) will be consulted unless TERM is unset or not a recognized terminal, in which case ls(1) will fall back to explicitly outputting ANSI escape sequences. 'never' to turn off any environment variable and -G usage. Reviewed by: cem, 0mp (both modulo last-minute manpage changes Differential Revision: https://reviews.freebsd.org/D16741 Notes: svn path=/head/; revision=337956
* ls(1): Fix color env var checkingKyle Evans2018-08-161-2/+25
| | | | | | | | | | | | CLICOLOR will behavior as always- if present at all in the environment, allow colors. COLORTERM, recently enforced, will have to be both present and not empty. Submitted by: imp Notes: svn path=/head/; revision=337885
* Revert parts of r337849 and r337857Brad Davis2018-08-154-79/+2
| | | | | | | | | | | | This fixes the build and I will redo these changes as part of a future review that organizes them differently. The way I tried to do it here could be done better. Sorry for the noise. Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D16737 Notes: svn path=/head/; revision=337882
* dd(1): Kill off duplicate progress definition following r337865Kyle Evans2018-08-151-1/+0
| | | | | | | Reported by: mmacy Notes: svn path=/head/; revision=337869
* dd: Incorporate some changes from imp for status=progressKyle Evans2018-08-155-31/+32
| | | | | | | | | | | | | | | Notable changes from what landed in r337505: - sigalarm handler isn't setup unless we're actually using it - Humanized versions of the amount of data transferred in the progress update Submitted by: imp Reviewed by: kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D16642 Notes: svn path=/head/; revision=337865
* Fix build after r337849Brad Davis2018-08-152-4/+5
| | | | | | | | | | | | This moves the symlink creation to after where the files are installed. This also inverts the shell change so that it only happens if MK_TCSH is on. Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D16725 Notes: svn path=/head/; revision=337857
* Move all sh and csh files into bin/sh/ or bin/csh/Brad Davis2018-08-159-1/+131
| | | | | | | | | | | This simplifies pkgbase by migrating these to CONFS so they are properly tagged as config files. Approved by: will (mentor) Differential Revision: https://reviews.freebsd.org/D16708 Notes: svn path=/head/; revision=337849
* ls(1): Enable colors with COLORTERM is set in the environmentKyle Evans2018-08-082-3/+13
| | | | | | | | | | | | | COLORTERM is the de facto standard, while CLICOLOR is generally specific to FreeBSD and ls(1). PR: 230101 Submitted by: D Green <dfrg@xsmail.com> (with manpage additions by myself) Reviewed by: cem ("LGTM" in PR; pre-manpage changes) MFC after: 1 week Notes: svn path=/head/; revision=337506
* dd: add status=progress supportKyle Evans2018-08-086-2/+59
| | | | | | | | | | | | This reports the current status on a single line every second, mirroring similar functionality in GNU dd, and carefully interacts with SIGINFO. PR: 229615 Submitted by: Thomas Hurst <tom@hur.st> (modified for style(9) nits by me) MFC after: 1 week Notes: svn path=/head/; revision=337505
* date(1): Add ISO 8601 formatting optionConrad Meyer2018-08-043-11/+219
| | | | | | | | The new flag is named '-I'. It is documented in the manual page and covered by basic unit tests. Notes: svn path=/head/; revision=337332
* Describe how to prevent *.core files from being created using ulimit.Mateusz Piotrowski2018-07-191-28/+24
| | | | | | | | | | | While here, pet mandoc. Reviewed by: eadler (previous revision), jilles (previous revision), mat (mentor) Approved by: manpages (jilles), mat (mentor) Differential Revision: https://reviews.freebsd.org/D15609 Notes: svn path=/head/; revision=336483
* sh: Don't treat % specially in CDPATHJilles Tjoelker2018-07-156-26/+59
| | | | Notes: svn path=/head/; revision=336320
* sh: Don't use padvance() for MAIL/MAILPATHJilles Tjoelker2018-07-151-14/+16
| | | | | | | | | | Using padvance() requires undoing its append of '/' and prevents adjusting its '%' logic to allow most directories with '%' in PATH. No functional change is intended. Notes: svn path=/head/; revision=336303
* Stop building intermediate .o files.Bryan Drewery2018-06-271-9/+2
| | | | | | | | | | | | These are not used to link the final tool anymore. At some point in the past the suffix rules changed to not link these in. The original reason for this in r19176 is unclear but seems to be related to mkdep. The .depend handling is still broken here as it is for all build tool patterns like this. Sponsored by: Dell EMC Notes: svn path=/head/; revision=335746
* Don't use CCACHE for linking.Bryan Drewery2018-06-271-1/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: Dell EMC Notes: svn path=/head/; revision=335733
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-194-4/+4
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395