#
82fa7f83 |
| 06-Jan-2025 |
Piotr Pawel Stefaniak <pstef@FreeBSD.org> |
ls -lh: humanize the total
Before this change, the total printed on the first line was always in blocks.
Now the long format with -h will print the "humanized number" instead.
`ls -sh` never provi
ls -lh: humanize the total
Before this change, the total printed on the first line was always in blocks.
Now the long format with -h will print the "humanized number" instead.
`ls -sh` never provided sizes in anything other than blocks, total or individual, and this commit doesn't change that.
The total number of blocks is a sum of fts_statp->st_blocks, so it's multiplied by 512 and not by blocksize.
$ ls -lh /usr/bin | head -n 2 total 442 MB -r-xr-xr-x 1 root wheel 70B Dec 20 21:06 CC
Differential Revision: https://reviews.freebsd.org/D48329
show more ...
|
Revision tags: release/14.2.0, release/13.4.0 |
|
#
647d4a8c |
| 24-Jul-2024 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
ls: Make -, apply to -s as well as -l.
While here, remove a bogus comment about a gcc bug. The bug was in ls, which used an incorrect format string, and in libc, which accepted it.
MFC after: 1 we
ls: Make -, apply to -s as well as -l.
While here, remove a bogus comment about a gcc bug. The bug was in ls, which used an incorrect format string, and in libc, which accepted it.
MFC after: 1 week Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D46067
show more ...
|
Revision tags: release/14.1.0, release/13.3.0 |
|
#
e043f372 |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
bin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
bin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
#
90aea514 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl s
bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
3bfbb521 |
| 18-Jul-2023 |
Minsoo Choo <minsoochoo0122@proton.me> |
ls: Improve POSIX compatibility for -g and -n.
- Change -g (ignored for BSD 4.3 compatibility since BSD 4.4) to use POSIX semantics of implying -l but omitting the owner's name.
- Change -n to
ls: Improve POSIX compatibility for -g and -n.
- Change -g (ignored for BSD 4.3 compatibility since BSD 4.4) to use POSIX semantics of implying -l but omitting the owner's name.
- Change -n to imply -l.
The -o option remains unchanged (POSIX defines -o as a complement to -g that implies -l but omits group names whereas BSD defines -o to add file flags to -l). This compromise is the same used by both NetBSD and OpenBSD.
PR: 70813 Reviewed by: jhb, Pau Amma <pauamma@gundo.com> Co-authored-by: John Baldwin <jhb@FreeBSD.org> Differential Revision: https://reviews.freebsd.org/D34747
show more ...
|
Revision tags: release/13.2.0, release/12.4.0 |
|
#
927f8d8b |
| 09-Sep-2022 |
Kirk McKusick <mckusick@FreeBSD.org> |
Handle NULL return from localtime(3) in ls(1) and find(1)
The ls(1) (with -l option) and find(1) (with -ls option) utilties segment fault when operating on files with very large modification times.
Handle NULL return from localtime(3) in ls(1) and find(1)
The ls(1) (with -l option) and find(1) (with -ls option) utilties segment fault when operating on files with very large modification times. A recent disk corruption set a spurious bit in the mtime field of one of my files to 0x8000000630b0167 (576460753965089127) which is in year 18,266,940,962. I discovered the problem when running fsck_ffs(8) which uses ctime(3) to convert it to a readable format. Ctime cannot fit the year into its four character field, so returns ??? ??? ?? ??:??:?? ???? (typically Thu Nov 24 18:22:48 2021).
With the filesystem mounted, I used `ls -l' to see how it would report the modification time and it segment faulted. The find(1) program also segment faulted (see script below). Both these utilities call the localtime(3) function to decode the modification time. Localtime(3) returns a pointer to a struct tm (which breaks things out into its component pieces: year, month, day, hour, minute, second). The ls(1) and find(1) utilities then print out the date based on the appropriate fields in the returned tm structure.
Although not documented in the localtime(3) manual page, localtime(3) returns a NULL pointer if the passed in time translates to a year that will not fit in an "int" (which if "int" is 32-bits cannot hold the year 18,266,940,962). Since ls(1) and find(1) do not check for a NULL struct tm * return from localtime(3), they segment fault when they try to dereference it.
When localtime(3) returns NULL, the attached patches produce a date string of "bad date val". This string is chosen because it has the same number of characters (12) and white spaces (2) as the usual date string, for example "Sep 3 22:06" or "May 15 2017".
The most recent ANSI standard for localtime(3) does say that localtime(3) can return NULL (see https://pubs.opengroup.org/onlinepubs/9699919799/ and enter localtime in the search box). Our localtime(3) man page should be updated to indicate that NULL is a possible return. More importantly, there are over 100 uses of localtime(3) in the FreeBSD source tree (see Differential Revision D36474 for the list). Most do not check for a NULL return from localtime(3).
Reported by: Peter Holm Reviewed by: kib, Chuck Silvers, Warner Losh MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36474
show more ...
|
Revision tags: release/13.1.0, release/12.3.0 |
|
#
97c31821 |
| 19-Sep-2021 |
Cameron Katri <me@cameronkatri.com> |
ls(1): Allow LSCOLORS to specify an underline
Allows capitalizing the background color character to enable an underline instead of bold, capitalizing the foreground color char will still do bold.
D
ls(1): Allow LSCOLORS to specify an underline
Allows capitalizing the background color character to enable an underline instead of bold, capitalizing the foreground color char will still do bold.
Differential Revision: https://reviews.freebsd.org/D30547
show more ...
|
Revision tags: release/13.0.0, release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0 |
|
#
3611ec60 |
| 18-Aug-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r337646 through r338014.
|
#
e10ba800 |
| 17-Aug-2018 |
Kyle Evans <kevans@FreeBSD.org> |
ls(1): Add --color=when
--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.
'al
ls(1): Add --color=when
--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
show more ...
|
Revision tags: release/11.2.0 |
|
#
0fdf7fa8 |
| 17-Jan-2018 |
Conrad Meyer <cem@FreeBSD.org> |
Convert ls(1) to not use libxo(3)
libxo imposes a large burden on system utilities. In the case of ls, that burden is difficult to justify -- any language that can interact with json output can use
Convert ls(1) to not use libxo(3)
libxo imposes a large burden on system utilities. In the case of ls, that burden is difficult to justify -- any language that can interact with json output can use readdir(3) and stat(2).
Logically, this reverts r291607, r285857, r285803, r285734, r285425, r284494, r284489, r284252, and r284198.
Kyua tests continue to pass (libxo integration was entirely untested).
Reported by: many Reviewed by: imp Discussed with: manu, bdrewery Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13959
show more ...
|
#
82725ba9 |
| 23-Nov-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r325999 through r326131.
|
#
8a16b7a1 |
| 20-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier f
General further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 3-Clause license.
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts.
Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point.
show more ...
|
Revision tags: release/10.4.0, release/11.1.0 |
|
#
348238db |
| 01-Mar-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r314420 through r314481.
|
#
fbbd9655 |
| 01-Mar-2017 |
Warner Losh <imp@FreeBSD.org> |
Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is
Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point.
Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96
show more ...
|
#
a3906ca5 |
| 17-Feb-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r313644 through r313895.
|
#
cdf44896 |
| 16-Feb-2017 |
Konstantin Belousov <kib@FreeBSD.org> |
Use uintmax_t to print st_nlink.
Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
Revision tags: release/11.0.1, release/11.0.0, release/10.3.0 |
|
#
b626f5a7 |
| 04-Jan-2016 |
Glen Barber <gjb@FreeBSD.org> |
MFH r289384-r293170
Sponsored by: The FreeBSD Foundation
|
#
9a7cd2e6 |
| 22-Dec-2015 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
MFH @r292599
This includes the pluggable TCP framework and other chnages to the netstack to track for VNET stability.
Security: The FreeBSD Foundation
|
#
be90c1c6 |
| 07-Dec-2015 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Fix ls -l alignement with new locales
Latest update of locales introduced abbreviated month that follows the regionale rules meaning that they can be of variable length instead of being arbitrary tr
Fix ls -l alignement with new locales
Latest update of locales introduced abbreviated month that follows the regionale rules meaning that they can be of variable length instead of being arbitrary truncated to top 3 characters.
To fix alignement, ls now computes the visible length of the abbreviated month, pads the shorter month with spaces in order to make sure everything is properly aligned
Reviewed by: ache, ed, jilles Differential Revision: https://reviews.freebsd.org/D4239
show more ...
|
#
b5ff185e |
| 12-Sep-2015 |
Baptiste Daroussin <bapt@FreeBSD.org> |
Merge from head
|
#
ab875b71 |
| 14-Aug-2015 |
Navdeep Parhar <np@FreeBSD.org> |
Catch up with head, primarily for the 1.14.4.0 firmware.
|
Revision tags: release/10.2.0 |
|
#
5f78ec1c |
| 28-Jul-2015 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r285793 through r285923.
|
#
e9eed90c |
| 24-Jul-2015 |
Allan Jude <allanjude@FreeBSD.org> |
Cast uid and gid to the correct type for display to solve segfault in ls(1) on 32bit arches
Correctly escape literal % for display
This fixes segfaults in 32bit arches caused by r285734
Reviewed b
Cast uid and gid to the correct type for display to solve segfault in ls(1) on 32bit arches
Correctly escape literal % for display
This fixes segfaults in 32bit arches caused by r285734
Reviewed by: ngie Approved by: dim Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3191
show more ...
|
#
ddaf675f |
| 22-Jul-2015 |
Allan Jude <allanjude@FreeBSD.org> |
Remove an excess space accidently introduced in the output in ls(1) by r285734
Spotted by: dim Approved by: eadler (mentor) Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.free
Remove an excess space accidently introduced in the output in ls(1) by r285734
Spotted by: dim Approved by: eadler (mentor) Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3152
show more ...
|