Commit Graph

7153 Commits

Author SHA1 Message Date
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