summaryrefslogtreecommitdiff
path: root/lib/libutil
AgeCommit message (Collapse)Author
2019-09-02Pull up following revision(s) (requested by brad in ticket #110):martin
libexec/lfs_cleanerd/lfs_cleanerd.c: revision 1.59 libexec/lfs_cleanerd/lfs_cleanerd.8: revision 1.19 sbin/resize_lfs/resize_lfs.c: revision 1.15 usr.sbin/puffs/rump_lfs/rump_lfs.c: revision 1.19 libexec/lfs_cleanerd/lfs_cleanerd.c: revision 1.60 lib/libutil/getdiskrawname.c: revision 1.6 tests/fs/common/fstest_lfs.c: revision 1.7 Use getdiskrawname to find the device name. Reviewed by Christos - Teach getdiskrawname and getdiskcookedname about zvols. Reviewed by Christos - Add support for passing the raw device name separate from the filesystem. This is useful in the case where the cleaner is compiled into code, such as rump_lfs and the ATF tests. This helps to fix bin/54488 - The cleaner is compiled into rump_lfs and executed as a thread. Pass in the raw device using the new -J option. This avoids the use of getdiskrawname which is not particularly rump safe in this context and insures that the rump container device is used for cleaning, not the outer device.
2019-04-29snprintb(3) says that, in the new(?) Torek format, all fields specs end with \0kre
The F spec is one of those, it should be terminated with \0 just like all the others (irrelevant that it has no extra data to delimit). Fix <sys/mman.h> to define the snprintb() format string correctly (include the missing \0's). Fix the copy of that definition included into snprintb(3) to match the updated mman.h version (ride the date bump from the day before yesterday .. this is the same change, just corrected). Undo the previous snprintb.c change ("off by one" fix) which was an attempt to make the broken mman.h usage work (and did, but not the way it should be done). Also, after using the new * format (instead of only when something has already matched) skip the associated data so we don't attempt to interpret it as more field specifiers. This func needs lots of TLC! Fix the ATF tests for snprintb() to not assume that F format is really exactly like f format, and has data after the field specifier. It doesn't. Add several more tests (including testing the '*' field operator recently added).
2019-04-27Remove trailing whitespace.wiz
2019-04-27remove dup linechristos
2019-04-27Document the '*' field and give a more complex example with F and *.christos
2019-03-08s/ the the / the /msaitoh
2018-12-28Document "ROOT." syntax before documenting a generic .alnsn
2018-12-27No need to quadruple a buffer because strunvis(3) doesn't expand.alnsn
2018-10-06use the right type.christos
2018-10-06If fs_spec starts with the special string "ROOT.", replace it with a devicejmcneill
path derived from the value of the kern.root_device sysctl.
2018-06-24Fix stack use after scope in libutil/ptykamil
The pt variable's elements are used after the end of the pt scope. A move of pt to outer scope fixes this. Detected with MKSANITIZER/ASan with tmux(1), a forkpty(3) user.
2018-06-24Prevent underflow buffer read in trim_whitespace() in libutil/passwd.ckamil
If a string is empty or contains only white characters, the algorithm of removal of white characters at the end of the passed string will read buffer at index -1 and keep iterating backward. Detected with MKSANITIZER/ASan when executing passwd(1).
2018-04-05Use mdoc macros.wiz
2018-04-04Document opendisk1() - it has been around long enough.kre
(pity about the name...) XXX pullup-8
2017-10-23Sort errors.wiz
2017-10-22Add snprintb_m to the NAME section.abhinav
2017-10-22Add missing functions to the NAME sectionabhinav
2017-07-03Remove workaround for ancient HTML generation code.wiz
2017-06-14Stop including <sys/user.h> in userland librarieskamil
This header in this context is freebsdism.
2017-04-01Add man page links for:abhinav
EV_SET to kqueue(2) getmntoptstr, getmntoptnum, freemntopts to getmntopts(3) Reviewed by wiz@
2017-03-30Use Sy to highlight the table header.abhinav
2017-03-30Add missing functionsabhinav
2017-03-30Add getmntoptstr, getmntoptnum, and freemntopts to the NAME sectionabhinav
Fix couple of sentences getmntoptstr, getmntoptnum, and freemntopts need to be linked to the getmntopts(3) man page as well. Will do in a later commit after doing a relase build test.
2017-03-30Add getdiskcookedname to the NAME sectionabhinav
Fix couple of typos.
2017-03-22parsedate.y: meaningless KNF of a comment (no code changes)kre
parsedate.3: add an item in BUGS noting the weirdness of "next" The real purpose of this commit is to supply the following message which should be used for the immediately previous commit, replacing its commit message (the two are similar, but definitely not the same). With thanks to gdt@ for pointing out one of the (many) errors in the previous message (and noting others I had already seen). ---- Make parsedate handle "12 noon" and "12 midnight" (including when the time given is "12:00" or "12:00:00") - but only for exactly 12 o'clock. "12:00:01" is am or pm, not noon or midnight. "12 am" remains as an alias for "12 midnight", and "12 pm" for noon, though both are strictly (pedanticly) invalid (and meaningless.) Note that "12 midnight" (or "12 am") means 00:00:00 (ie: midnight at the start of the day, not at the end.)
2017-03-22Make parsedate handle "12 noon" and "12 midnight" (including whenkre
the time is "12:00" or "12:00:00) - but only for exactly 12 o'clock. "12:00:01" is am or pm, not noon or midnight. "12 am" remains as an alias for "12 midnight", and "12 pm" for midnight, though both are strictly invalid (and meaningless.) Note that "12 pm" means 00:00:00 (ie: midnight at the start of the day, not at the end.)
2017-03-22Fix PR lib/52101 -- 12:30 am is 00:30:00 and 12:30 pm is 12:30:00kre
2017-01-29new lookup order will be in 7.1 before 8.0snj
2016-12-29Make this portable to other OSschristos
2016-12-23Complete a sentenceabhinav
and replace full stop with a comma at one place as the sentence wasn't finished
2016-06-26Remove dawn/sunup/sunset/sundown (sunrise was never there...)kre
If 06:00 or 18:00 are wanted, just say "06:00" (etc). If these are ever added back, they really should determine location, and calculate actual sunrise/sunset times for the location and date. That's not likely to happen...
2016-06-07Fix typo. Sort errors.wiz
2016-06-06PR/51216: Instead of trying to open files in the current workingchristos
directory first for paths that don't contain "/", first try the /dev paths to avoid confusion with files in the working directory that happen to match disk names.
2016-06-01Use NULL instead of 0.christos
2016-05-03Make relative date changes ("+ 2 months") etc, work a little more sanely.kre
OK christos@
2016-04-12Removed botched debug left over.roy
2016-04-12Fix pidfile location path rules to match prior version.roy
2016-04-11Add serial commas. Fix minus. Sort SEE ALSO. Fix xref.wiz
2016-04-11Bump libutil for new pidfile functions.roy
2016-04-10Implement pidfile_lock, pidfile_read and pidfile_clean.roy
Discussed on tech-net@, ok core@.
2016-04-06pretty-print link addresses.christos
2016-01-25prefer <sys/cpu.h> instead of <machine/cpu.h>christos
2016-01-23unsigned -> unsigned intwiz
2016-01-23Update synopses to match u_int/u_long/etc. changes. Do not bump date asdholland
it's not a substantive change.
2015-12-31When computing relative months, use mktime() directly and don't calldholland
our Convert(). And check it for failure. This fixes three sets of problems: (1) depending on the passed-in value of Timezone it might disassemble the time in one timezone and reassemble it in another, causing mysterious offsets of a few hours; (2) with the previous set of changes to this file, Convert() fails if it ends up normalizing a date, so e.g. going three months forward from March 31 would fail; (3) previously if Convert() failed we passed -1 on to DSTcorrect(), which made a mess. PR 50574.
2015-12-31Always use localtime_r; I don't think any of this code is trippingdholland
itself up, but it's still good practice for library functions to not trash static libc state. Might be relevant to PR 50574.
2015-12-31Reformat grammar part according to my standards for yacc grammars.dholland
2015-12-10Markup improvements.wiz
2015-12-08more changes I forgot to commitchristos
2015-12-08preserve a copy of the tm so we can check later.christos