Commit Graph

7358 Commits

Author SHA1 Message Date
christos 81d301652a Add birthtime support and make time 64 bit. 2021-05-29 16:51:25 +00:00
wiz 55f2c23495 Avoid using Pq.
In this case, the parentheses were wrong when a line was extended.
2021-05-27 07:03:27 +00:00
mrg 41c1322c84 move the basic history i wrote from raidctl(8) to raid(4), and
fix the x86 (thanks simonb) and sparc bootable dates, a couple
of spelling errors.
2021-05-27 06:53:37 +00:00
mrg debaf4757e update the list of platforms supporting loading kernels from raid.
expand the HISTORY section to include notable RF moments in netbsd.
bump date.
2021-05-26 08:23:18 +00:00
thorpej f3e7a08f5b Make sure the output packet buffer and the control message buffer
are aligned.

Fixes bin/56198.
2021-05-23 07:17:50 +00:00
yamaguchi f0101d0e08 Add a new link-aggregation pseudo interface named lagg(4)
- FreeBSD's lagg(4) based implementation
 - MP-safe and MP-scalable
2021-05-17 04:07:41 +00:00
yamaguchi fe63e5c41b Added a keyword to change keepalive interval 2021-05-14 09:08:59 +00:00
yamaguchi 428f5be81d Make authproto not change when "authproto" is not in command option 2021-05-11 06:58:03 +00:00
yamaguchi aa069c4991 Added keywords that are ipcp, noipcp, ipv6cp, noipv6cp
for configuring NCP
2021-05-11 05:51:42 +00:00
nia cb91ad3daa cgdconfig.8: use gpt in examples, it's more versatile for this use case 2021-04-30 21:07:34 +00:00
yamaguchi 861187a72c Add a new option to enable SPPP_AUTHFLAG_PASSIVEAUTHPROTO flag 2021-04-23 02:28:40 +00:00
maya 1b70e4604b The -n flag is useless with -g, don't mention it.
From rudolf in PR misc/36243
2021-04-18 19:56:09 +00:00
mrg 90cb3f8f93 vax vs gcc: fsdb.c loses. also build this with -O0. 2021-04-15 01:56:00 +00:00
mrg 8b5e691ee5 build lfs_node.c with -O3 on ia64 to avoid assembler overflow issues. 2021-04-14 08:31:24 +00:00
mrg 97b36aa771 more GCC 10 fixes.
mDNSResponder: another wrong return local address

dhcp: ignore a seemingly impossible stringop overflow

hpacel: avoid maybe uninitialised error that is wrong.

rsh: avoid impossible malloc(0)

udf: cast pointers through (uintptr_t) to fool invalid boundary checks
2021-04-13 06:25:48 +00:00
mrg 5132a436cc properly terminate a buffer after strncpy(). 2021-04-12 09:18:14 +00:00
simonb c84bb8ac7c Update usage message to reflect reality. 2021-04-07 14:45:28 +00:00
riastradh 8603ff52c2 Clarify wording further based on private feedback. 2021-04-06 22:02:40 +00:00
riastradh cfdaa93ec8 Clarify security model of rndctl -S files. 2021-04-06 12:32:39 +00:00
nia 9ff36a0c40 rndctl(8): to -l, add a "samples" column separate to "bits"
rename the "bits" column to "estimated bits".

this provides a clear indication when a source is being used, but
not increasing the entropy counter.

this commit fixes an unrelated bug where verbose output functioned
incorrectly when a class of device was specified with -t.

while here, reduce code duplication.

"gofer it" riastradh@
2021-04-04 13:37:17 +00:00
nia 8a1f05e369 rndctl(8): remove no-longer-useful stats from -s
these are always 0 now.

"gofer it" riastradh@
2021-04-04 12:50:31 +00:00
nia 2843dad115 rndctl: make -l's "Flags" field reflect current reality
don't print "legacy options" RND_FLAG_ESTIMATE_TIME and
"RND_FLAG_ESTIMATE_VALUE"

only print "estimate" if we have actually counted any bits from
something, since it's no longer really possible to "enable estimation".

ideally, there should also be a "samples" field so it's clear
collected bits are not being counted.
2021-04-02 07:17:56 +00:00
nia a712f2f75f rndctl.8: reflect current reality 2021-04-02 07:04:05 +00:00
rin 623d9b5490 Fix typo: s/--r/-r/ 2021-03-14 02:56:51 +00:00
msaitoh 44f4353477 s/skiping/skipping/ 2021-03-11 01:13:11 +00:00
christos 1261169451 PR/50933: Uwe Toenjes: Document hardware limitations 2021-03-09 14:39:43 +00:00
martin d4bd079f4d Make IEEE802.11 support optional 2021-03-01 16:47:48 +00:00
jmcneill e60d6bc1d4 Use 32K as the default NFSv3 read and write data sizes on aarch64, matching
i386 and amd64.
2021-01-24 12:51:32 +00:00
mrg 1e8d1e7cf5 call it "kernel object linker module framework" not just
"module framework".  the latter is generic enough to
also mean the old ld(1) linked loadable kernel modules.
2021-01-17 00:17:40 +00:00
mlelstv 3b6e7d0308 Also replace calls to dirname. 2021-01-09 16:25:19 +00:00
mlelstv 1f9fa21d0b Remove need for awk/sed/readlink tools. 2021-01-09 14:00:05 +00:00
uwe 4c353c3815 route(8): group RTF_GATEWAY and ~RTF_GATEWAY (-iface).
While here, tweak RTF_GATEWAY description.  Passive voice elsewhere in
this table is used to talk about the routes themselves, while here
it's about packets.
2021-01-02 22:02:27 +00:00
uwe ba49a14327 route(8): be consistent about capitalization. 2021-01-02 20:36:02 +00:00
uwe ea20573539 route(8): don't split -blackhole and -noblackhole. 2021-01-02 19:50:42 +00:00
jmcneill 2c1310a89c Managment -> Management 2020-12-20 10:19:30 +00:00
jnemeth 464df8b50e PR/55875 - Valentin -- "gpt recover -r" does nothing
Delete do nothing undocumented option, that was there from initial
import.  No idea what it was intended to do and there is no longer
an "upstream".
2020-12-13 21:55:25 +00:00
riastradh 800615b324 Touch up cgdconfig(8) man page.
- Suggest adiantum first.
- Remove references to Blowfish.
- Clarify that ivmethod is relevant only for ancient compatibility.
2020-12-11 21:52:19 +00:00
ryoon 704d4179fb Describe after example like other examples 2020-12-11 18:49:37 +00:00
mrg a63aaf55a5 micron SMART 202 is percent lifetime used not remaining.
almost gave myself a heart attack when my server said 7% remaining!
2020-12-07 10:36:19 +00:00
kre b2fc8900ac PR bin/55834
count blocks written in unsigned 64 bit counter
rather than signed int which overflows after 2^31-1
blocks (2TiB) after which neither the 5 minute
status updates or SIGINFO (^T) reports are issued
until the negative numbers increase past 0 and
wildly inaccurate reports would be written.
2020-12-03 08:25:57 +00:00
pgoyette 1761fcfd85 Be consistent with mark-up of vop_reclaim 2020-12-01 02:43:18 +00:00
dholland 83e8764286 Add missing newlines to ACL prints in tunefs; from Jan Schaumann in PR 55824. 2020-11-26 02:06:01 +00:00
yamaguchi d29dd4c534 add -dd option for reference of the parameter about control protocols
reviewed by knakahara@n.o.
2020-11-25 10:32:54 +00:00
nia c7b55a6538 file systems that are used as what spools? 2020-10-24 10:51:34 +00:00
mlelstv 5c685f7b3c Make command line arguments -r and -w actually override defaults from fstab,
previously -w would only cancel a preceeding -r.

No longer strip -o rw.
2020-10-18 10:57:30 +00:00
roy 8b0aa988ec ifconfig: go back to using direct ioctls rather than data from getifaddrs
AF_LINK may not be the first address returned for the interface.
Technically, it *might* not even exist on the interface even though
other families do.
This is likely a driver bug if this really is the case though.

As such it's just easier to use direct ioctls rather than thump around
getifaddrs results. As it stands, the code makes a lot of getifaddrs
calls anyway, so an extra ioctl or two won't break the bank.
2020-10-14 13:37:14 +00:00
roy 2669b948a0 ifconfig: if SIOCGLIFADDR fails, continue to the next address 2020-10-11 21:32:37 +00:00
mlelstv 3ce6ce8d42 Use raw device for configuring units. This is necessary as
having a block device opened prevents autodiscovery of wedges.
2020-10-06 18:47:07 +00:00
roy ec2482217d Minor correction to prior 2020-10-05 17:29:22 +00:00
roy a6f0f00cfa ifconfig: Warn once more if media supported but no types
This reverts media.c -r1.7
2020-10-05 16:17:05 +00:00
christos 10f7eba97a - centralize number parsing code
- enable -g
- KNF
2020-10-03 18:42:20 +00:00
wiz 2858bf9ece New sentence, new line. 2020-10-03 18:29:02 +00:00
christos a9f74273b0 Add -A (noac) option to turn off the attribute cache. (Maciej W. Rozycki) 2020-10-03 18:06:37 +00:00
msaitoh b140fa3c95 Add [-]eee and [-]vlan-hwfilter. 2020-09-29 08:52:11 +00:00
msaitoh 57920690e6 s/occurence/occurrence/ 2020-09-29 02:58:51 +00:00
msaitoh 811d5a8b03 s/parition/partition/ 2020-09-29 02:49:55 +00:00
roy 4d511cd47d ifconfig: Just look at if_data->ifi_link_state for carrier
It should be the sole source of truth.
if_data is also carried in ifa_data from getifaddrs(3) which saves
more ioctl calls.
2020-09-28 13:50:22 +00:00
jdolecek 6eddb6bb08 add -s option for 'power' command, this instructs the controller to save
the value so it persists resets/whatnot; the NVMe specification lists
this as optional, so this only works if the controller supports it
2020-09-27 18:17:35 +00:00
jdolecek 895d4c1ad7 print current power state and workload as separate values for
'nvmectl power nvme0'
2020-09-27 17:27:07 +00:00
jdolecek 09685c0005 show APSTA support status in identify 2020-09-27 16:45:21 +00:00
roy c054c3f155 ifconfig: We already have struct if_data in ifa_data.
So let's not bother with an ioctl we don't need.
2020-09-26 23:43:26 +00:00
roy 4670a6a468 ifconfig: test cases want LINK_STATE_UNKNOWN to be treated as up. 2020-09-23 10:48:12 +00:00
roy 0fd9c80d4e ifconfig: teach carrier test about ifi_link_state from SIOCGIFDATA
Because not all interfaces support media.
2020-09-23 02:09:18 +00:00
roy bfeafc760c ifconfig: Report link state even if media is not supported
For AF_LINK addrs from getifaddrs(2), ifa_data is struct if_data.
This in turn holds ifi_link_state which we can use to report
link status if the interface does not support media where it's normally
reported.

Based on OpenBSD.
2020-09-22 14:14:17 +00:00
mlelstv ad2d0017d3 Document keyboard mode ioctls and let wsconsctl manage it. 2020-09-13 07:35:15 +00:00
mlelstv edc4e8445d Allow components to be specified by wedge name. 2020-09-13 06:04:53 +00:00
mrg 95c5ec5682 remove GCC_NO_ADDR_OF_PACKED_MEMBER now lfs_accessors.h works. 2020-09-07 03:19:04 +00:00
mrg c2082ece61 remove GCC_NO_ADDR_OF_PACKED_MEMBER for several subdir builds
that are now handled by lfs_accessors.h internally.
2020-09-07 03:09:53 +00:00
mrg cb93b81028 add support for new GCC 9 warnings that may be too much to fix
right now.  new address-of-packed-member and format-overflow
warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd
GCC_NO_FORMAT_OVERFLOW variables to remove these warnings.

apply to a bunch of the tree.  mostly, these are real bugs that
should be fixed, but in many cases, only by removing the 'packed'
attribute from some structure that doesn't really need it.  (i
looked at many different ones, and while perhaps 60-80% were
already properly aligned, it wasn't clear to me that the uses
were always coming from sane data vs network alignment, so it
doesn't seem safe to remove packed without careful research for
each affect struct.)  clang already warned (and was not erroring)
for many of these cases, but gcc picked up dozens more.
2020-09-06 07:20:26 +00:00
mrg 07b516d274 avoid trying to printf() a NULL as %s. fixes likely bug. 2020-09-06 05:31:46 +00:00
mrg 30b1a162d1 rework error message to never call printf() %s with NULL. 2020-09-06 02:34:30 +00:00
mrg 32fbe21e0b avoid calling printf() %s with NULL. 2020-09-06 02:34:02 +00:00
bouyer 33be3b5b89 If we hit an unknown header type (likely to be a corrupt record), and
the user choose to not abort, skip to the next header instead of trying
to use it.
This allowed me to recover files from a corrupt dump, instead of
getting a segfault.
2020-09-03 19:31:34 +00:00
christos 0a22125dca Make the "interesting" flags match the netstat ones, so:
route show -inet
    netstat -r -f inet

outputs match.
2020-08-29 19:28:32 +00:00
christos ce43f29fa9 Instead of defining RTF_LLINFO, use RTF_LLDATA 2020-08-29 19:27:40 +00:00
christos ad93f4b708 Document 'L' 2020-08-29 19:27:08 +00:00
riastradh 25f11de3b9 mmap MAP_FAILED audit. 2020-08-20 15:54:11 +00:00
christos 230f192a92 Find the if a device points to an active filesystem by looking at the mount
list.
2020-08-08 11:44:55 +00:00
christos a0c61f459b catch up with source rename of fbsd-zfs -> zfs 2020-07-27 20:54:18 +00:00
mlelstv fd33bfb7f2 Refactor remaining mount_* commands to use the common pathadj()
function for resolving paths.

Make pathadj() no longer warn about symlinks. Symlinks in /dev are
regularly used in several places like LVM . The warning was also
only visible when calling a mount_* command directly as mount(8)
itself would resolve the path witout warning before passing it to
a mount_* command.
2020-07-26 08:20:22 +00:00
wiz 707fcfff00 Remove unused Pp. Sort SEE ALSO. 2020-07-19 14:43:35 +00:00
maxv 6466ac3ae7 sync with reality 2020-07-19 14:39:42 +00:00
nia 4a2e556972 Move description of keyboard layouts to wskbd.4, add newer layouts
Previously, the best reference was pckbd.4. This does not make much
sense to read if you are on, say, an evbarm device with only USB.

wsconsctl.8 contained a vaguer description of supported language names,
which isn't very useful because you can't pass full language names
to the command. Point readers to wskbd.4 instead.

Note in the wskbd.4 page that while all layouts are generally supported
by pckbd(4) and ukbd(4), older keyboard interfaces might only support
a subset.
2020-07-13 11:14:12 +00:00
nia d0c1a9d713 More keyboard layouts 2020-07-12 03:37:06 +00:00
jruoho a2d604357d Xref x86/tco(4) instead of the parent x86/ichlpcib(4) bridge. 2020-07-11 12:51:21 +00:00
wiz c6cc6b9db4 Use Nm. 2020-06-23 14:08:01 +00:00
nia 44bd074d70 cgdconfig.8: remove references to using cgd for swap
this is potentially misleading now that the kernel does swap encryption
2020-06-23 13:23:56 +00:00
nia 4e9ba6e816 cgdconfig.8: Reflect actual behaviour of /dev/(u)random 2020-06-23 13:20:14 +00:00
msaitoh 9007cd7213 s/successfuly/successfully/ in comment. No functional change. 2020-06-22 07:50:53 +00:00
wiz 634f9eb189 The ACL flag is -p, not -n. 2020-06-18 19:32:56 +00:00
kamil aa97815be0 Include explicitly <rump/rump_syscallshotgun.h> for previous indirect users
via <rump/rump.h>.
2020-06-17 00:16:21 +00:00
thorpej aae463daac Update for proplib(3) API changes. 2020-06-11 13:49:57 +00:00
thorpej 759cf71618 When we add "entries", "index", and "sector_size" values to the dictionary,
add them as signed valaues, rather than unsigned (which is how we keep them
in memory).  This causes them be serialized in base-10 (rather than base-16,
which is the default for unsigned).  This behavior is documented in
prop_number(3).  Fixes t_gpt::backup_2part unit test.
2020-06-08 22:52:09 +00:00
wiz 99aaf50145 Sort option descriptions. 2020-06-07 19:35:15 +00:00
thorpej abcb66ec85 Update for proplib(3) API changes. 2020-06-07 05:54:00 +00:00
thorpej d147ce2226 Update for proplib(3) API changes. 2020-06-07 05:42:25 +00:00
thorpej aebbed3d12 Update for proplib(3) API changes. 2020-06-06 22:33:23 +00:00
uwe 22cb993c0d Make -f description actually use the word "force" so that it can be
found when searched for.
2020-06-01 03:18:36 +00:00
wiz 0fa531d9a4 Add -g to usage. 2020-05-24 21:02:12 +00:00
wiz 11e3f06a51 Use Nx, fix formatting nit. 2020-05-24 21:01:49 +00:00
wiz 6f392fa3a0 Fix typo in macro. Sort option descriptions. 2020-05-24 20:59:16 +00:00
jmcneill f907c64a8f Add -g flag to preserve GPT headers when updating MBR. 2020-05-24 18:42:48 +00:00
jmcneill e5906ade5e Add -H flag to ignore existing MBR (Hybrid MBR/GPT mode). 2020-05-24 18:42:20 +00:00
jmcneill 084befafcb Exit gracefully when auto-expanding a partition and it is already the
correct size. Add a -q flag to "resize" and "resizedisk" commands to skip
printing warnings in the already resize paths.
2020-05-24 14:42:44 +00:00
jmcneill 2cf653d8b7 Use getfsspecname and getrawdiskname so we can resize by NAME= label. 2020-05-24 14:41:26 +00:00
christos 9aa2a9c323 Add ACL support for FFS. From FreeBSD. 2020-05-16 18:31:45 +00:00
msaitoh 8012ca3f0e Remove extra semicolon. 2020-05-14 08:34:17 +00:00
khorben 2478cc98bc Fix and improve parsing of configuration files
XXX pull-up to netbsd-9
2020-05-13 21:44:30 +00:00
simonb da20e95aa9 Whitespace alignment nits. 2020-05-12 09:48:44 +00:00
riastradh 3fb2c51c3c Trigger entropy consolidation before saving seed.
This way, whenever /etc/security runs infrequently (daily), or the
operator manually issues rndctl -S, we ensure that all samples taken
during the entire boot are hashed together in the seed for the next
boot.

This should be infrequent enough that it's unlikely to enable the
iterative-guessing attacks that we try to mitigate by not frequently
consolidating entropy.
2020-05-07 19:13:38 +00:00
riastradh c2a3429284 Rework rndctl seed load sequence again.
Go back to the book's order, now that writing to /dev/random
guarantees to consolidate entropy -- this way the _next_ boot is no
less secure than the current boot, in the event that entropy sources
like interrupt timings provided any security that we just don't know
how to measure honestly.

Make sure to open the old seed to overwrite and the new seed to write
anew first so that we can determine whether the medium is read-only
before accepting the file's entropy estimate.
2020-05-07 19:12:45 +00:00
riastradh 97603a72a0 Touch up rndctl(8) a bit. 2020-05-07 19:09:26 +00:00
wiz fecac516fe Add -i to SYNOPSIS. 2020-05-07 12:58:09 +00:00
riastradh 1e65f60a58 Tweak logic to decide whether a medium is safe for an rndseed.
- Teach rndctl to load the seed, but treat it as zero entropy, if the
  medium is read-only or if the update fails.

- Teach rndctl to accept `-i' flag instructing it to ignore the
  entropy estimate in the seed.

- Teach /etc/rc.d/random_seed to:
  (a) assume nonlocal file systems are unsafe, and use -i, but
  (b) assume / is safe, even if it is nonlocal.
  If the medium is nonwritable, leave it to rndctl to detect that.
  (Could use statvfs and check for ST_LOCAL in rndctl, I guess, but I
  already implemented it this way.)

Treating nonlocal / as safe is a compromise: it's up to the operator
to secure the network for (e.g.) nfs mounts, but that's true whether
we're talking entropy or not -- if the adversary has access to the
network that you've mounted / from, they can do a lot more damage
anyway; this reduces warning fatigue for diskless systems, e.g. test
racks.
2020-05-06 18:49:26 +00:00
riastradh 1154c4b65f Sort includes. 2020-04-30 03:27:15 +00:00
riastradh 825d46aec4 Accept both byte orders for random seed in `rndctl -L'.
The file format was defined with a machine-dependent 32-bit integer
field (the estimated number of bits of entropy in the process that
generated it).  Take whichever byte order gives a number that is
reasonable, i.e. lower than the number of bits in the buffer.

Continue to have `rndctl -S' generate it in machine-dependent byte
order for now, so that if you roll back to an older rndctl(8) then
`rndctl -L' on the same machine will still be able to load it with
the right entropy estimate.  In a future revision, perhaps we can
change it to be little-endian.
2020-04-30 03:24:48 +00:00
gson d609938dfa Remove references to "special", as mount_qemufwcfg(8) does not
actually take such an argument.  Discussed with jmcneill.
2020-04-29 09:54:43 +00:00
christos 4efd5405d6 make umount NAME= work 2020-04-23 04:21:13 +00:00
christos 7df60872d5 Enable the code to clean the extattr blocks 2020-04-19 19:37:06 +00:00
sevan ad16dbb6f1 grammar 2020-04-18 22:02:11 +00:00
jdolecek 1ef16aec19 add NO_IOBUF_ALIGNED to not pull aligned_alloc() for really constrained
boot media
2020-04-18 12:54:38 +00:00
jdolecek 93217591a2 align buffers used for I/O to DEV_BSIZE so it's executed more optimally
when run for xbd(4) raw (character) device
2020-04-17 09:42:27 +00:00
jdolecek 4a168442c5 align buffers used for I/O to DEV_BSIZE so it's executed more optimally
when run for xbd(4) device
2020-04-17 09:33:37 +00:00
jdolecek 171fa94db7 adjust to work with updated dkwedge_bsdlabel.c - provide geteblk() and
brelse() which just allocate/free the memory
2020-04-11 17:21:16 +00:00
plunky 7ea6ef2b6d trim extraneous return statement 2020-04-10 14:32:50 +00:00
christos 9655c24691 Refresh the superblock in memory if changing a mounted partition. 2020-04-09 14:44:38 +00:00
martin b187e11174 Sync "common" declarations with ifdefs in header. 2020-04-06 09:54:24 +00:00
mrg d26fa7dbd1 dion't define endian as well as try to declare it as a variable. 2020-04-06 06:41:34 +00:00
joerg 6ce4f404a1 Fix depenency on common symbols in sbin. 2020-04-05 15:25:39 +00:00
joerg a74e29fe24 Avoid common symbols for fsck_lfs. 2020-04-03 19:36:32 +00:00
maxv 6fa9cf7eed Avoid overflows when reading strings. 2020-04-03 19:09:43 +00:00
joerg a69687b194 Just declare driver and buf 2020-04-03 18:39:15 +00:00
martin af2ed9cf6e Make route and netstat share the same struct progops (and initialization
code)
2020-04-03 16:20:51 +00:00
christos a17e9ce771 Add a prog_setsockopt (thanks kre@) 2020-04-02 18:32:31 +00:00
martin 29b6fd854b Now that we use the same UUID for ZFS as FreeBSD, drop the FreeBSD marker
from the description.
2020-03-30 10:41:53 +00:00
wiz 81e8a3b48e Teach dk(4) about ZFS.
"looks ok" mlelstv
2020-03-30 08:36:09 +00:00
gutteridge b849d2c572 rfilter.2: fix a typo
Reported by Andrius V in PR kern/54889.
2020-03-22 23:24:08 +00:00
khorben 9e6960f916 Forbid command line parameters when parsing configuration files
This behaviour was ambiguous at best.
While there, also correct the usage screen, and the corresponding manual
page.
2020-03-22 07:45:02 +00:00
roy ae92cb1896 route: Enable receive error reporting on the routing socket 2020-03-14 22:26:39 +00:00
wiz 14df4e9b76 New sentence, new line. Bump date for previous. 2020-02-24 11:59:33 +00:00
mlelstv c445faa062 Add one-shot mode. 2020-02-24 11:45:30 +00:00
riastradh 2d468aafe8 Fix userland references to LFS_ORPHAN_NEXTFREE.
Forgot to grep for these or do a full distribution build, oops!
2020-02-23 15:11:33 +00:00
wiz 74532f1d21 Fix date. 2020-02-23 00:14:31 +00:00
pgoyette 9a34b1cfc9 Clarify that the -k option only provides the address of the module's
text segment.  The addresses of any other segments are not available.
2020-02-22 14:26:18 +00:00
kamil b110dc906e Avoid unportable shift construct
boot.c:150:29, left shift of 255 by 24 places cannot be represented in type 'int'
boot.c:153:29, left shift of 255 by 24 places cannot be represented in type 'int'
2020-02-22 09:59:22 +00:00
kamil 7cd593c092 Avoid undefined behavior
route.c:1523:20, left shift of 1073741824 by 1 places cannot be represented
in type 'int'
2020-02-22 00:42:15 +00:00
leot f006c3623b Fix a thinko
Reported by qjsgkem via #netbsd-code, thanks!
2020-02-12 09:43:19 +00:00
kamil 5f94716bd4 Stop including unused header <sys/poll.h> 2020-02-06 19:20:21 +00:00
roy b433cf8862 route: address flags are more useful than interface flags for address msgs 2020-01-22 19:22:06 +00:00
roy cdc408b51e route: Decode the correct flags for interface address messages 2020-01-22 17:55:41 +00:00
thorpej c1d9ec8d89 Remove the strip(4) - Starmode Radio IP - pseudo-device driver. It is
long since obsolete.
2020-01-19 01:25:03 +00:00
christos 1c0459f7c5 .include bsd.own.mk for ${NETBSDSRCDIR} 2020-01-14 23:13:36 +00:00
christos 08f54aa8c8 Don't add the 2 reserved clusters before we determine if we using fat16/fat32.
From FreeBSD: https://reviews.freebsd.org/D23082:

Correct off-by-two issue when determining FAT type.

In the code we used NumClusters as the upper (non-inclusive) boundary
of valid cluster number, so the actual value was 2 (CLUST_FIRST) more
than the real number of clusters. This causes a FAT16 media with
65524 clusters be treated as FAT32 and might affect FAT12 media with
4084 clusters as well.

To fix this, we increment NumClusters by CLUST_FIRST after the type
determination.
2020-01-11 16:29:07 +00:00
ad 9e93be3837 - options NAMECACHE_ENTER_REVERSE is no more.
- Partially sort the list of per-vnode namecache entries by using a TAILQ.
  Put the real name to the head, and put dot and dotdot to the tail so that
  cache_lookup_reverse() doesn't have to consider them.
2020-01-08 12:04:56 +00:00
ryo d5ec837d73 fix printing capabilities and enabled flags.
no need to skip a prefix "0x" of output of snprintb.
ifconfig expect the result of snprintb has "0x" prefix, but snprintb(3) specification has changed
so that if 0 is passed, it prints "0" instead of "0x0". (common/lib/libutil/snprintb.c r1.22)
2020-01-02 23:02:19 +00:00
kre 6b4ce10f36 Make recent change build for SMALL builds as well as normal ones. 2020-01-01 00:24:52 +00:00
tsutsui 475a622639 Fix dmesg(8) to preserve leading whitespaces of kernel messages.
Closes PR/54729.
2019-12-31 19:58:56 +00:00
msaitoh 88af233251 s/opration/operation/ 2019-12-27 07:41:22 +00:00
wiz 3bb7993d91 Fix xrefs. 2019-12-15 11:49:28 +00:00
christos b54315f23d PR/54756: germain: Avoid confusion caused by overuse of the word "file" both
as a noun and an argument name.
2019-12-14 20:46:13 +00:00
wiz 97394f0e9a Remove superfluous Pp. 2019-12-07 12:35:27 +00:00
pgoyette ac676e6637 Note also that the load address (if provided) is also for the module's
text segment.
2019-12-06 21:45:14 +00:00
riastradh 5af49f98fe Teach `rndctl -L' to update the seed file, not just delete it.
The seed file is updated by entering the old seed into the system and
then hashing the old seed together with data from /dev/urandom, and
writing it atomically with write-to-temporary/rename-to-permanent.

This way, interruption by crash or power loss does not obliterate
your persistent entropy (unless it causes file system corruption).
2019-12-06 14:43:18 +00:00
pgoyette c5b5c0a464 Note that the size returned by modctl(2) and displayed by modstat(8) is
only for the module's text section, not for the entire size of the module.

Addresses PR kern-54737
2019-12-04 23:35:36 +00:00
wiz b6ec8480de Sort options and SEE ALSO. Improve a sentence. 2019-11-20 21:56:19 +00:00
tkusumi 764206462f mount_autofs: Sync man page with DragonFlyBSD
Taken-from: DragonFlyBSD
2019-11-20 17:29:51 +00:00
tkusumi b35c5f0b43 mount_autofs: Remove blank line with trailing whitespace 2019-11-20 17:18:35 +00:00
mrg 91cecf62cf elide recently introduced warnings that trigger in normal cases, eg:
savecore: dump_exists:471: kvm_read newdumpmag: _kvm_kvatop(ffffffff8180030c)
2019-11-06 07:29:08 +00:00
christos 6d3bef8dbf inode.c needs -O0 for vax 2019-10-28 22:52:43 +00:00
maya cede1cc99c Switch files copyright Reinoud Zandijk from BSD 4 clause to BSD 2 clause.
OK'd by reinoud in email (from 4 Feb 2019).
2019-10-16 21:52:22 +00:00
jnemeth a1afb41542 Do the 'dkctl makewedges' dance to drop any wedges assoicated the
destroyed GPT.
2019-10-16 19:03:53 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
martin 410b25665f When we end up with too few clusters for the requested FAT type after
configuring default values, retry with a smaller cluster size.
This makes the typical invocation to create a spec conformant EFI boot
partition work out of the box.
2019-10-12 09:42:38 +00:00
christos 683824cce0 gpt_uuid_parse does not set errno ... 2019-10-11 23:04:52 +00:00
christos ea4f9899c6 print the name of the disk causing the error. 2019-10-07 20:56:07 +00:00
mrg d6b33fe60a avoid access uninitialised memory, found by gcc8, patch by agc@. 2019-10-04 09:16:38 +00:00
kardel 479b835cf3 PR/54513 ifconfig exits on newly created carp interfaces
downgrade from err(EXIT_FAILURE, ... ) to warn() if ioctl(SIOCGLIFADDR) fails.
ifconfig now survives freshly created carp interfaces.
2019-10-01 10:52:53 +00:00
bad 7a2e426f67 initialize disc_dict to NULL.
otherwise, if DIOCGDISKINFO returns an error != ENXIO getdiskinfo() later
tries to prop_object_release() stack garbage.

found by rumpctrl tests using clang-7.
2019-09-28 18:03:18 +00:00
mlelstv dacdd9d9b5 Need MIN in userland. Also some more signed/unsigned clashes. 2019-09-26 10:47:30 +00:00
mlelstv 3a8aa0a47c nspares is now unsigned. Validate and use as positive integer. 2019-09-26 10:33:30 +00:00
roy 99b959ff0d route(8): Show addres for RTM_LOSING
While here, add /* FALLTHROUGH */.
2019-09-02 00:30:01 +00:00
wiz 7c8c4d229e Remove superfluous Pp. 2019-09-01 19:13:18 +00:00
sevan fe6b8268b9 grammar 2019-09-01 18:51:27 +00:00
roy 68a5c140d2 route(8): show addrs for RTM_MISS 2019-08-31 18:20:08 +00:00
brad 277f8a757a Use getdiskrawname to find the device name.
Reviewed by Christos
2019-08-22 20:26:07 +00:00
roy 2b94ade947 route(8): print RTM_CHANGE messages
XXX Pullup -9
2019-08-22 16:10:48 +00:00
perseant f5654bbebe Clean up debugging cruft that somehow made it into my previous commit. 2019-08-20 21:18:10 +00:00
wiz 27a1bb09f8 Sort options in usage.
filesystem -> file system
2019-08-20 21:07:21 +00:00
perseant 473107ea62 Allow the user to specify the filesystem ID for umapfs at mount time,
allowing a consistent filesystem ID across reboots.  Closes PR #54471.
2019-08-20 20:18:54 +00:00
perseant 7aae290207 Add -D flag to allow the user to specify an alternate dumpdates file.
Closes PR #54469.
2019-08-19 18:12:50 +00:00
martin 21c20a3068 Properly release the disk properties dictionary we received via
ioctl.
Detected by leak sanitizer when building with MKSANITIZER=yes.
2019-08-18 11:08:56 +00:00
kamil 997c4cdc97 sysctl: Add indirection of symbols to remove clash with sanitizers
Add indirection and symbol renaming under MKSANITIZER for the linked in
version of sysctlbyname and sysctlgetmibinfo.
2019-08-18 04:10:22 +00:00
msaitoh 5ae436aa7e Whitespace fix. 2019-08-16 10:33:17 +00:00
kamil 1f7b844ec7 fsck: Stop defining the same variable concurrently in bss and data
returntosingle was defined in multiple places:

 - fsck_lfs/main.c
 - fsck_ffs/main.c
 - fsck_ext2fs/main.c
 - fsck/fsutil.c

Keep the fsutil.c definition as the only one.

Detected during the build of telned with Address Sanitizer (MKSANITIZER).
2019-08-15 03:10:42 +00:00
roy 85f97b7a69 reboot: fix arg order for logwtmpx(3)
Matches the correct order from init(1).

Thanks to Sascha Wildner <swildner@dragonflybsd.org>
2019-08-08 21:14:12 +00:00
wiz 1100063163 Remove superfluous Pp. 2019-08-07 19:08:10 +00:00
mrg 1eef670a51 add an example about reattaching USB devices 2019-08-06 10:45:14 +00:00
isaki 002042ffe7 Fix a trivial wrong comment. x68k's arch is not m68010. 2019-08-03 04:21:37 +00:00
martin 8e17bc1a27 Remove outdated note about sysinst restrictions 2019-07-26 07:22:05 +00:00
msaitoh eea2ee1212 Implement VLAN hardware filter function(ETHERCAP_VLAN_HWFILTER).
First proposed by jmcneill in 2017 and modified by me.

How to use:

 - Set callback function:

	ether_set_vlan_cb(struct ethercom *, ether_vlancb_t)

 - Callback. This function is called when a vlan is attached/detached to the
   parent interface:

	int (*ether_vlancb_t)(struct ethercom *ec, uint16_t vlanid, bool set);

 - ifconfig(8)

	ifconfig ixg0 [-]vlan-hwfilter

 Note that ETHERCAP_VLAN_HWFILTER is set by default on ixg(4) because
the PF driver usually enable "all block" filter by default.
2019-07-17 03:26:24 +00:00
msaitoh cb1ccde89c KNF. No functional change. 2019-07-17 03:09:16 +00:00
msaitoh 83631b96b8 Add "ifconfig [-]vlan-hwtagging" to enable/disable VLAN hardware tagging
offload function. It's useful to see Ethernet frame's VLAN tag by
disabling with "ifconfig fooX -vlan-hwtagging" and "tcpdump -e -i fooX".
2019-07-08 03:04:15 +00:00
wiz 4785fe6db5 Formatting nit. 2019-07-04 13:55:31 +00:00
ozaki-r 86e9de9cad Add descr,description/-descr,-description commands to ifconfig(8) to handle a description.
From t-kusaba@IIJ
2019-07-04 02:45:45 +00:00
mlelstv 45a6f3d566 Fix NATIVELABEL_ONLY build. 2019-07-03 07:05:27 +00:00
wiz 400b2bc13c Sort and unify a bit. Add more macros. 2019-07-02 16:47:19 +00:00
mlelstv 1b979fcca7 Add options to define labelsector and -offset and number of slices.
Make options to chose alternate label position for systems using MBR
more intuitive. -m now selects mode with MBR, -n selects mode without,
independent of the machine defaults.
2019-07-02 16:23:47 +00:00
sevan edae29ee93 Add rcsid 2019-06-30 11:38:16 +00:00
jnemeth 7d442200ff Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.
2019-06-25 04:53:40 +00:00
jnemeth acc2b630b1 adjust gpt_uuid_generate() to accept gpt==NULL 2019-06-25 04:25:11 +00:00
jnemeth 46e7349176 Add gpt_change_hdr() similar to gpt_change_ent() for changing
arbitrary header fields.
2019-06-25 03:42:45 +00:00
jnemeth e003a26f4c Add a third argument to the "cfn" function that is an argument to
gpt_change_ent().  The purpose of the third argument is to specify
whether the entry to be changed is a primary GPT entry or a secondary
GPT entry.  It is assumed that a secondary GPT entry will always
follow a corresponding primary entry.

This is in preparation for an upcoming change that will require it.
2019-06-21 02:14:59 +00:00
martin cad3861523 When biosboot is used on an existing wedge and we are switching to
the gpt of the parent device, do not pass the size of the wedge to
gpt_open, it certainly is smaller than the whole device.
Fixes bin/54312.
2019-06-20 10:56:38 +00:00
martin 08878476cc Do not try to close a NULL gpt. Fixes the core dump part of PR bin/54312 2019-06-20 10:41:58 +00:00
kre 1d7ccd04d7 Delete a redundant (useless) assignment. NFCI. 2019-06-04 11:59:05 +00:00
kre 43729d11af PR toolchain/54269
Make a SMALL dmesg even smaller.

When compiled -DSMALL, dmesg does nothing at all with the kernel
timestamps (it processes no options to be told what would be the
user's desire) so make it truly do (almost) nothing, rather than
some botched partial processing of them.

The "almost" is that a SMALL dmesg will now ignore spaces at the
beginning of each new message line ... those are (vanishingly)
unlikely to occur, as the kernel puts the timestamp (which starts
with '[' there) - fixing this would have meant even more #ifdef's
as the code that ignores that leading space is the only remaining
thing that (in a SMALL) dmesg looks at the value of the "tstamp"
variable, and if we don't keep some use of it, gcc complains...

These changes affect only SMALL dmesg (as installed on boot
floppies, etc) and have no intended effect on the version that's
installed on a normal (full size) running system.
2019-06-04 11:37:39 +00:00
christos 7031824410 We already incremented cl; fix indexing. Noticed by Xin Li @FreeBSD. 2019-06-04 00:08:00 +00:00
wiz 3969855bdf New sentence, new line. 2019-05-31 16:38:27 +00:00
mlelstv 8ba9fb4d1c Mention SATL support. 2019-05-31 05:47:22 +00:00
mlelstv c2d06938d9 Add support for ATA command pass-through to SCSI devices. 2019-05-30 21:32:08 +00:00
kre fe6f1f01c1 PR bin/54222
Don't use portal_node_reclaim() inappropriately.   It frees data we
did not allocate, but which might have been allocated by someone else.

While here, various other cleanups (avoid losing fd's if fork fails,
don't compose mangled st_mode S_IFMT values - puffs or's in what it
thinks is correct to the value we set, one case I saw was producing
0110600 for the mode, the 011 isn't any defined type at all - I'd
never seen ls print a '?' as the first char of ls -l output before!

This is still not really correct, but is I believe, better than before.
2019-05-23 11:13:17 +00:00
wiz 7a2e675187 Remove superfluous Pp. 2019-05-23 09:15:45 +00:00
kre 4ab11b0d22 Better handling of comments in portal.conf ... # now only introduces
a comment at beginning of line, or after whitespace.   This allows #
to be used as data otherwhere in the line (there is no escape mechanism).
2019-05-23 04:34:25 +00:00
kre de0c485250 KNF: blank lines after declarations, return (x) -> return x, and
eliminate spaces between cast and value being cast (most were OK already)
NFCI.
2019-05-23 02:39:06 +00:00
wiz 3a5a3e206b Sort SEE ALSO. 2019-05-08 06:10:30 +00:00
cnst f11bc4e580 bioctl(8): Xr ataraid(4), mpii(4) && mfii(4); 2019-05-08 03:29:59 +00:00
christos dfb7cec746 Add a -z flag to zero out the up to 4 bytes of padding in directory entry
names (including the terminating NUL), as well as directory entries with
extra free space (d->d_reclen > UFS_DIRSIZ(d)).

Inspired from FreeBSD:
    https://svnweb.freebsd.org/base?view=revision&revision=347066

While the kernel has been fixed to deal with the padding bytes (new
kernels will correctly zero out all the padding after the name), it
appears that there is still an issue with directory entries with extra
free space, since a newly created and populated filesystem gets modified
with "fsck_ffs -z".
2019-05-05 14:59:06 +00:00
christos b131cb44b1 simplify the endian byte-swapping code. 2019-05-05 13:24:19 +00:00
msaitoh 1ad0ba196b Suggested by Christos:
- Dont' cast malloc()'s return value.
 - Use calloc() instead of malloc().
2019-04-22 10:44:55 +00:00
maya f93d65267a wether -> whether 2019-04-21 11:45:08 +00:00
maya 2c4214cba2 Omit mention of old vnd(4) bug, now resolved.
Via elge, thanks.
2019-04-13 19:29:27 +00:00
pgoyette a398332c7f Add missing space in "quotas disabled" output from tunefs -N 2019-04-12 01:14:37 +00:00
kre 84b2b98300 KNF, 80 column police, a few other tidy ups (use if (ret == 0) rather
than if (!ret) when ret is not a boolean, and test fopen result against
NULL, for example).

NFCI.
2019-04-10 06:11:37 +00:00
kre c2cf8ad6d4 PR bin/53999 from rudolf (eq.cz)
Fix cgdconfig to report verification failures with gpt and mbr
verification methods (and not treat them as silent hard errors).
This also causes the cgd to be unconfigured when one of those
verification methods fails.

Add ATF tests to check that bad verification is reported, and
does not leave the cgd configured.

Patches from the PR applied.
2019-04-10 06:09:39 +00:00
tnn 3fe2f616e7 mention that -B is used to set the timeout for mbr_bootsel 2019-04-09 09:03:41 +00:00
martin 5bb85d19b9 PR bin/54088: make "destroy" remove the protective MBR too.
We could make this optional if someone comes up with a good reason
to leave it intact.
2019-04-04 14:03:40 +00:00
martin 920f8d883d Ignore -f with the "destroy" command completely (it was effectively
ignored already, so no functional change). Leave it as valid option
for compatibility.
2019-04-04 13:58:20 +00:00
martin f63c9f4407 Allow specifying the partition via -b startsec for the biosboot cmd. 2019-04-04 13:55:40 +00:00
mlelstv da22d85db7 Ignore EXT4 'kbytes written' field when validating alternate superblock. 2019-03-31 13:16:52 +00:00
mlelstv 25aaa28e7c No longer rely on data in disklabel to deduce alternate superblock
positions from block size. Instead use the same defaults as newfs_ext2fs.

Side effect is that fsck_ext2fs now works with wedges.
2019-03-31 10:55:58 +00:00
mlelstv fcaa2faa3e remove debug printfs from last commit. 2019-03-31 10:52:00 +00:00
mlelstv bbddb1419d Ignore recorded last mount point when validating alternate superblocks.
Compute log_bsize correctly. This fixes computation of alternate
superblock addresses.
2019-03-30 17:32:40 +00:00
martin d48fad1d9d Allow -b to specify a partition for "gpt unset" as well. 2019-03-26 14:55:02 +00:00
martin d0774e18ba When displaying a single partition (gpt show -i ...) display offset
and size in sectors (instead of the totally confusing bytes),
followed by the humanized byte offset/size.

This makes the numbers match the "gpt show" or "gpt show -a"
output.
2019-03-26 11:23:55 +00:00
martin 1756583860 Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.
2019-03-25 20:15:49 +00:00
wiz d774658d68 Bump date for previous. 2019-03-25 07:03:17 +00:00
manu eeb96f8c80 Add -U flag to dump(8) and dump_lfs(8) to specify dumpdates entry
This address situations where dump(8) cannot figure out the device being
dumped. It also allows tracking of subvolume dumps by using virtual
device as dumpdates entry.
2019-03-25 02:13:01 +00:00
martin 2ee402b3d0 Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).
2019-03-24 13:45:35 +00:00
martin f2b09ed0f6 Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.
2019-03-24 13:31:00 +00:00
mlelstv 5ca1f5a8c5 print little-endian header fields correctly. 2019-03-14 10:26:10 +00:00