Commit Graph

13153 Commits

Author SHA1 Message Date
ryo 5e3407a716 add CPU_ID_APPLE_M1_ICESTORM and CPU_ID_APPLE_M1_FIRESTORM.
sync cpuids[] to sys/arch/aarch64/aarch64/cpu.c r1.69
2022-04-30 14:06:10 +00:00
christos 3df5232c9f Handle warnings and errors from pcap_activate properly (from bch) 2022-04-30 13:20:09 +00:00
hannken 0c025a28a0 As the quota type comes from the kernel and is only valid when
quota is on get the type before quota_off and after quota_on.
2022-04-26 15:39:00 +00:00
reinoud 5823a2adcd Avoid warning by clang of unused variable
While here, use the computated obj_size even though it's always the same as
its information length since we don't use extended attribute files or
stream directories.
2022-04-26 15:18:08 +00:00
reinoud ecbc9e51ab Fix endian bug that resulted in UniqueIDs of 0 in file identifiers; note that
the the unique ID in a longad stored in a FID is 32 bit where in the file
descriptor (fe/efe) its 64 bits long.
2022-04-26 14:59:37 +00:00
reinoud 7906b5d46d No need to use ceilf() when ceil() is already used 2022-04-26 13:27:24 +00:00
reinoud 1cb1a07c94 Fix endian bug in makefs for udf 2022-04-26 13:26:30 +00:00
martin 18183f70fd Make default installations a bit more secure:
- push a bit harder for setup of a root password
 - simplify/clarify manual entropy setup
 - visit the entropy setup (on machines where it is needed) on the
   default path through sysinst
2022-04-21 17:30:15 +00:00
andvar f84252b461 fix various typos in comments and log messages. 2022-04-16 18:15:20 +00:00
martin 1e0c64ad24 Fix invalid msg_fmt_table_add() call, pointed out by Andreas Gustafsson. 2022-04-14 15:48:31 +00:00
andvar 2cf3f970af s/serivce/service/ in comments. 2022-04-11 20:57:37 +00:00
andvar 75d2abaeb1 fix various typos in comments and output/log messages. 2022-04-10 09:50:44 +00:00
riastradh 2773c1b540 makefs(8): Fix tool build -- no libutil DPADD if HOSTPROG. 2022-04-10 09:22:35 +00:00
riastradh b9ccfe96a1 makefs(8): Needs -lm for ceil in udf as a host tool too. 2022-04-09 14:38:47 +00:00
riastradh bf2ad72489 makefs(8): Nix trailing whitespace.
Computed by machine, eyeballed by hand, so to speak.
2022-04-09 10:05:35 +00:00
andvar 2fa7e14158 fix various typos, mainly in comments, but also log messages, docs, game text. 2022-04-08 10:17:52 +00:00
andvar 2e9df72ec3 fix various typos in comments. 2022-04-07 19:33:37 +00:00
hauke 56fc4047d2 udf.c uses math library functions. 2022-04-06 22:25:00 +00:00
wiz 374cb9be67 makefs: fix some typos 2022-04-06 13:44:25 +00:00
wiz 1baa92514a new sentence, new line 2022-04-06 13:39:06 +00:00
reinoud 8f4e1cd991 Refactor and rewrite of newfs_udf(8) and makefs(8) (-t udf) with a shared
section for fsck_udf(8).

Newfs_udf and makefs support predefined disc image profiles, harddisc
partitions (disklabel and wedges on all generic block devices) and all optical
media types on CD/DVD/BD writers.

Newfs_udf and makefs now also support formatting of UDF 2.50 with a metadata
partition.
2022-04-06 13:29:15 +00:00
gutteridge f2240c734a makemandb.c: fail sooner if man page dirs can't be found
There's no point initializing database state if we're then going to
fail to locate any man page sources. Make all the initial state checks
contiguous for simplicity and readability. Also, free the variable
"command" on the error path, and correct the error message.
2022-04-06 03:23:38 +00:00
andvar e82c4d9bb4 fix various typos, mainly in comments. 2022-04-04 19:33:44 +00:00
mlelstv 2c701485e4 Avoid integer overflow on systems with 32bit disk addresses. 2022-04-02 19:16:49 +00:00
andvar a41f6947a1 fix few typos for word "previous(ly)" in comments. 2022-03-23 13:06:06 +00:00
hgutch 0d7f3d7673 Make sure daddr_t is a 64 bit type when building tools.
(see also PR sw-bug/56742 ).
2022-03-06 08:31:54 +00:00
ozaki-r 7b24996912 mount_9p: check returned type for Tread 2022-03-02 07:48:20 +00:00
ozaki-r ab2dc16550 mount_9p: fix writing to a file opened with write-only mode
With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server.  Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.
2022-03-02 04:11:41 +00:00
hannken 9c423f2391 Add a marker VUSECOUNT_VGET to v_usecount that gets set whenever
vcache_vget() or vache_tryvget() succeeds.

Use it to rerun VOP_INACTIVE() if another thread ran a vget()..vrele()
cycle while we inactivated our last reference.
2022-02-17 14:39:14 +00:00
andvar c45fbc6e3a fix few typos in comments and log message. 2022-02-13 22:20:08 +00:00
andvar 474f1bbcdf s/mahine/machine/ 2022-02-13 00:30:10 +00:00
uwe 3d38e5fa92 mount_9p(8): Use full month name in previos (oops). 2022-02-11 14:10:12 +00:00
hannken 514b0270dd A component name is a counted string (cn_nameptr, cn_namelen),
not a zero terminated string cn_nameptr.

Change the following operations to work with counted strings:

v7fs_file_lookup_by_name()
v7fs_file_allocate()
v7fs_file_deallocate()
v7fs_directory_add_entry()
v7fs_directory_remove_entry()
v7fs_file_rename()
v7fs_file_link()
v7fs_dirent_filename()

Adapt all vnode operations with component names as argument.
2022-02-11 10:55:15 +00:00
martin d24f36fab5 x86: fix previous: in the UEFI case copy the bootloaders from install
media during initial installation, but use the (by then: updated)
files from the target disk for system upgrades.
2022-02-10 16:11:41 +00:00
uwe 65d9e41502 mount_9p(8): document the new -C option. 2022-02-10 13:05:07 +00:00
ozaki-r 9468ae1a74 mount_9p: don't cache path names by default
Caching path names doesn't handle file changes by host, which is
not expected for normal usages.  So turn it off by default.

Instead, -C option is added to turn it on.

Patch from k-goda@IIJ with my tweaks
2022-02-10 09:29:39 +00:00
rillig 3afd224e52 ldpd: remove unused bit-field member from anonymous union
The struct common_hello_tlv contained an anonymous union, which is a C11
feature.  That union contained a bit-field, which is very unusual since
the C standards answer basically all interesting questions about
bit-fields in unions with "implementation-defined" or "unspecified".
GCC passes these questions further down by saying "Determined by ABI".

This was the only occurrence of a bit-field union member in the whole
NetBSD tree, and it caused the lint diagnostic 41 to be downgraded from
error to warning on 2021-09-17 since this exotic construct is allowed by
the C standards but practically unused.

No binary change.
2022-02-07 02:35:09 +00:00
mrg 9eba1842f2 allow "cpuN" as well as "N" to specific a CPU.
update usage to include a change i made from 2015 to allow multiple
CPUs to be operated on at the same time for most commands.
2022-02-01 10:45:02 +00:00
martin fade124bc6 Do not defer wedge deletions when we have nothing mounted.
Define and use a constant for maximum disk name length.
2022-01-30 11:58:29 +00:00
martin 4204f81037 When upgrading, update the boot code post extraction from
the updated target file system.
2022-01-29 16:01:16 +00:00
martin 8bb96d39e3 Try to get rid of all wedges we created (after unmounting). 2022-01-29 15:32:49 +00:00
msaitoh 6f3942e76a Decode Intel Hybrid Information Enumeration (CPUID Fn0000_001a). 2022-01-29 08:20:45 +00:00
wiz 58fed2b507 sysinst: sync usage with man page 2022-01-28 19:38:51 +00:00
wiz d72710ea39 Sort options and their descriptions. 2022-01-28 19:36:00 +00:00
martin cfebcbba29 Document the missing command line options. 2022-01-28 19:28:08 +00:00
martin 3b7d675b40 Add an option to set the directory where we look for message catalogs. 2022-01-28 19:27:43 +00:00
msaitoh 4e642f75a7 Remove debug code and simplify. No functional change. 2022-01-27 09:53:43 +00:00
andvar 492c086f0a s/begining/beginning/ in comments and messages. 2022-01-24 09:14:36 +00:00
christos f0fde9902f PR/56657: Juraj Hercek: Add plainrsa-gen utility mentioned in racoon.conf(5)
and fix it for OpenSSL 1.1
2022-01-23 14:35:44 +00:00
andvar ae6f7bdf98 s/comatible/compatible/ 2022-01-21 21:39:32 +00:00
lukem 4c6c9aca34 etcupdate: fix error message for unimplemented option
noted by rudolf on source-changes-d
2022-01-17 08:47:03 +00:00
lukem e60c82181d etcupdate(8): consistent -h and -? text 2022-01-14 22:55:10 +00:00
msaitoh a80eb31137 Add Alder Lake, Rocket Lake and Sapphire Rapids. From the latest Intel SDM. 2022-01-13 16:02:44 +00:00
nia 7a9185329c sysinst(8): use scan_ssid=1 so hidden wifi networks can be used 2022-01-13 14:47:11 +00:00
nia d290f6b174 sysinst(8): Add a "data" argument to do_ifreq that is set after the
ifr struct is zeroed.

This allows us to simplify the code by not having 2x socket creation
code for checking whether interfaces are wireless.
2022-01-11 09:44:49 +00:00
nia 8fa39f5e34 sysinst(8): Avoid asking Wi-Fi questions about non-Wi-Fi devices. 2022-01-10 22:14:01 +00:00
nia f5d6f24e01 sysinst(8): Add initial support for connecting to Wi-Fi networks
by spawning wpa_supplicant.

Reviewed by martin.
2022-01-10 12:17:48 +00:00
martin 7af59e24ef Install sysinst message catalogs. 2022-01-09 16:39:50 +00:00
wiz 9e40d57217 Match verb forms. 2022-01-09 07:40:11 +00:00
lukem d638a288e8 etcupdate: add -? for help. improve option errors
Support -? to show help.
Implemented using getopts "leading colon optstring" feature.
Improve error messages for unknown options and missing arguments.
Change usage-related errors from stdout to stderr.
Keep all other errors to stdout for now.
2022-01-09 03:33:26 +00:00
lukem 4e66222659 etcupdate: -h to stdout. improve help
Send -h help to stdout not stderr, and exit 0 not 1.
Show options alphabetically.
Use UPPER_CASE instead of lowercase as the convention for argument names.
2022-01-09 03:31:23 +00:00
lukem 66a1e9e07c etcupdate: style change: function { on new line 2022-01-09 03:25:38 +00:00
lukem 3a170d5028 postinstall(8); add -?. expand operation usage 2022-01-08 23:57:32 +00:00
lukem 09a44b8875 postinstall: improve -s usage
Reword -s SRC_ARG to be a bit clearer as to the variations, and sync
more with postinstall(8).
2022-01-08 23:30:41 +00:00
lukem 41e938b0ec postinstall: tweak -a and -m usage 2022-01-08 23:07:17 +00:00
lukem f08fadb8b9 postinstall: add -? to usage 2022-01-08 23:04:11 +00:00
lukem 41d92dcdfa postinstall: add -?. improve option errors
Support -? to show help.
Implemented using getopts "leading colon optstring" feature.
Improve error messages for unknown options and missing arguments.
2022-01-08 06:58:40 +00:00
lukem ae7cd0c965 postinstall: usage improvements
Show options alphabetically.
Use UPPER_CASE instead of lowercase as the convention for argument names.
Provide per-OPERATION argument usage.
Implement options alphabetically.
2022-01-08 06:57:34 +00:00
lukem bbb43df076 postinstall: improve validation and help
Validate the operation and items before extracting any etc.tgz,
so that help or errors are displayed quicker, for a better user
experience.

Style:
- Rename todo to ITEMS.
- Order processing of list after check.
- Ensure DIFF_OPT is initialised, for consistency.
2022-01-08 06:56:43 +00:00
lukem b318894e7e postinstall: style tweaks
Fix ... in comments and internal errors.
Sort variables declared at top of main(), for easier review.
2022-01-08 06:55:13 +00:00
lukem f4a06ed268 postinstall: help to stdout. usage tweaks
When invoked as "help" or "usage", send the usage to stdout
instead of stderr, so that it's easier to pipe to a pager.

Explicitly warn that the operation is missing.

Tweak the usage; "operation" instead of "op", no need for [] around ...
2022-01-08 06:53:58 +00:00
lukem e2ecc8d595 postinstall: fix x11 migration of /usr/X11R6/lib/X11
Fix the x11 check if /usr/X11R6/lib/X11/* needs to migrate to /etc/X11/*
by ensuring that the former actually is detected.

Avoids false migration errors for paths such as /fs if /usr/X11R6
doesn't exist, such as:
	x11 check:
	        Migrate /fs to /etc/X11/fs

The original implemention handled this correctly, but the bug
crept in postinstall 1.110 on 2010/11/21.
2022-01-07 01:03:02 +00:00
ryo 0d457a2cc0 display the raw value of each field when -v specified 2022-01-06 18:00:58 +00:00
ryo 1a9455cf02 fix typo 2022-01-06 17:59:15 +00:00
ryo 57817f981a Added more field definitions for ARMv8.x system registers 2022-01-06 09:01:16 +00:00
ryo bf1b93949b macroify. NFC. 2022-01-06 08:46:43 +00:00
ryo 63bdacd840 fix ID_AA64ISAR0_EL1.ATOMIC field definition 2022-01-05 19:53:32 +00:00
martin 1219ba360c Now that (semi-)manual entropy setup may happen outside of the main
install/upgrade path, we need to (re-)write the entropy seed file
afterwards - the earlier written one would not have an entropy estimate
if we get here.
2022-01-03 11:44:02 +00:00
andvar 427b92d9af s/filname/filename/ 2021-12-21 21:28:31 +00:00
andvar 1cb7819f04 fix various typos in comments. 2021-12-12 22:20:52 +00:00
nia 8bb8291bb8 Fix copypasto in comment. 2021-12-12 14:33:13 +00:00
andvar 0e6a3361ec fix typos in word "request(s)". 2021-12-12 09:00:07 +00:00
andvar eb03b08ccf fix typos in word "operation(s)". 2021-12-12 08:49:57 +00:00
mrg d914a3c1b9 remove clause 3 from all my licenses that aren't conflicting with
another copyright claim line.  again.  (i did this in 2008 and then
did not update all of my personal templates.)
2021-12-11 19:24:18 +00:00
nia d855902010 useradd(8): Recognize Argon2 passwords as "valid" when they are given
on the command line.

Reported by Robert Nestor on current-users@.
2021-12-10 20:06:29 +00:00
msaitoh 1a03346fd7 s/OCCURED/OCCURRED/ in a debug message. 2021-12-10 11:09:52 +00:00
msaitoh 9833ff7c7e Print 1GB TLB entry at the same leve's line.
Example:
  before:
    cpu0: ITLB: 128 4KB entries 8-way, 2M/4M: 8 entries
    cpu0: DTLB: 64 4KB entries 4-way
    cpu0: L2 STLB: 4K/2M: 1024 entries
    cpu0: L1 1GB page DTLB: 4 1GB entries 4-way

  after:
    cpu0: ITLB: 128 4KB entries 8-way, 2M/4M: 8 entries
    cpu0: DTLB: 64 4KB entries 4-way, 4 1GB entries 4-way
    cpu0: L2 STLB: 4K/2M: 1024 entries
2021-12-09 14:23:06 +00:00
msaitoh 813cf550c4 s/trival/trivial/ in comment. 2021-12-05 08:18:18 +00:00
msaitoh 18b2a94814 s/systme/system/ in comment. 2021-12-05 08:11:39 +00:00
wiz d07955d934 preceds -> precedes 2021-12-05 08:03:32 +00:00
msaitoh 264979d70a s/rather then/rather than/ in comment. 2021-12-05 07:25:11 +00:00
msaitoh 79d22ebfb9 s/preceed/preced/ in comment. 2021-12-05 07:13:48 +00:00
msaitoh 18dd566a90 s/preceed/preced/ 2021-12-05 07:11:56 +00:00
msaitoh 83cf79d6fc s/partiton/partition/ 2021-12-05 07:06:17 +00:00
msaitoh 086f28ae4c s/maping/mapping/ 2021-12-05 05:01:50 +00:00
msaitoh b5ffb2e0d6 s/filesytem/filesystem/ in comment. 2021-12-05 04:47:17 +00:00
msaitoh 51f4f8be61 s/filesytem/filesystem/ 2021-12-05 04:46:33 +00:00
msaitoh 1e4f69d0ff s/existance/existence/ in comment. 2021-12-05 04:42:54 +00:00
msaitoh 5e4e622281 auxilary -> auxiliary 2021-12-05 04:25:33 +00:00
msaitoh 344f0d1e04 s/exisit/exist/ in comment. 2021-12-05 02:52:17 +00:00
pho 1f6f9b8380 librefuse: Preparation of a proper API versioning; no more #ifdef woes in user code
The goal is to fully support FUSE API version 3.0 while maintaining
API/ABI compatibility with code written for 2.6 (or even older).

* <fuse.h> now emits a compiler warning if it's included without
  defining FUSE_USE_VERSION. It had been silently defaulted to the
  latest supported version prior to this change. This is permissive
  compared to the original FUSE, as it emits an error instead.

* <fuse.h> now emits a warning if FUSE_USE_VERSION is higher than what
  can be provided.

* Added a macro FUSE_MAKE_VERSION(maj, min). It was missing from
  librefuse <fuse.h>.

No actual API updates have been made (yet).
2021-12-04 06:42:39 +00:00
andvar d1c4e519a3 fix various typos in comments, log messages and documentation. 2021-12-03 13:27:37 +00:00
andvar a5298dfcbd bta2dpd(8): s/conection/connection/ 2021-12-02 21:59:22 +00:00
andvar 95c774699b btconfig(8): s/fomat/format/ and article fix. 2021-12-02 21:55:22 +00:00
christos 3d96da2095 PR/56530: RVP: use ioctl to get the partition size if possible (avoids SEGV) 2021-12-02 14:26:42 +00:00
christos 638ed4d6a7 PR/56530: RVP: fix iconv open error. 2021-12-02 14:26:12 +00:00
rillig 6f4965e060 usr.sbin: remove unnecessary CONSTCOND, lint no longer needs it
Since 2021-01-31, lint no longer requires a CONSTCOND comment in a
do-while-0 statement since this is a common code pattern, especially in
statement-like macros.

sed -i -E 's,} while \(/\* ?CONSTCOND ?\*/ ?0\),} while (0),' */*.[ch]
2021-11-27 22:30:25 +00:00
uwe f9113856a8 wsmoused: support absolute mouse position events
Tested with VirtualBox Guest Addtions.
2021-11-24 14:34:51 +00:00
reinoud 2e7f29dcb8 Explain cd9660 and udf exceptions on the rule that the default sectorsize is
512.
2021-11-12 07:41:55 +00:00
msaitoh 2b17502d19 s/funtion/function/ in comment. 2021-11-10 16:19:48 +00:00
msaitoh 54914f4034 s/streror/strerror/ in comment. 2021-11-10 15:49:42 +00:00
nia 34bdb82372 edquota(8): convert realloc(x * y) to reallocarr 2021-11-09 09:21:31 +00:00
skrll f1a526204c acpi_print_gicc_flags: print {en,dis}abled 2021-11-08 10:19:42 +00:00
andvar 369abe069b fix various typos, mainly s/prefered/preferred/ 2021-11-07 20:31:09 +00:00
msaitoh f81569c702 s/writting/writing/ 2021-11-06 06:40:33 +00:00
christos 987f284e0a Put the NOAOUT in one place 2021-10-31 18:06:42 +00:00
christos b83f5063e9 USE CPPFLAGS instead of CFLAGS for -D ! 2021-10-31 17:50:35 +00:00
nia dc6d60f228 timed(8): avoid hand-rolling arc4random_uniform 2021-10-31 10:47:18 +00:00
nia 25b32e0991 rpcbind(8): restore previous behaviour. Wait instead of breaking from
the loop if svc_fdset_getmax fails.

thanks rin.
2021-10-30 11:41:45 +00:00
nia 43d0286d06 rpcbind(8): Use reallocarr, fix reallocation logic.
In my_svc_run(), only update the fd count _after_ the allocation
succeeds (which may be after waiting in the loop). This function
previously tried to go to a label that doesn't exist. I wonder why
GCC didn't catch this before but does now.
2021-10-30 11:04:48 +00:00
nia 1ef2e3bf13 ndbootd(8): Rework allocation macros to add integer overflow checking. 2021-10-30 10:44:25 +00:00
nia 7dd9eb1a0e traceroute(8): Convert realloc usage to reallocarr.
Eliminate a temporary variable.
2021-10-30 09:26:11 +00:00
mrg d626ccb00f decode SMT parts for AMD family >= 0x17, not just 0x17.
now zen3 systems are properly identified by cpu topology for the
scheduler and cpuctl identify.
2021-10-27 04:15:41 +00:00
andvar fb817dab52 fix various typos in comments, mainly copypasta. 2021-10-24 20:00:11 +00:00
thorpej 8086f46e37 Sanitize the symbol namespace. NFC. 2021-10-23 16:58:17 +00:00
hannken 25fae635e5 Factor out the lookup results from struct denode.
No functional change.
2021-10-23 07:38:33 +00:00
andvar 6f8dc1509f fix various typos, mainly in comments, but also in man pages and log messages. 2021-10-21 13:21:53 +00:00
christos f229892ff8 Explicitly cast the long->float conversion since it is value-changing and
produces clang warnings.
2021-10-18 14:16:49 +00:00
ryo 223f9ca45a To an alias address, or in a multihoming environment, the internal dgram
server may respond from a different address than the destination address
sent by the client.
To solve this problem, I introduce sendfromto() and recvfromto() so that
the server can reply from the correct address, i.e., the destination address
used in the request.

This change also has the aspect of a reference implementation using the
RECVDSTADDR and PKTINFO socket options.
2021-10-17 04:14:49 +00:00
skrll 3064404475 Output alignement - give lwp 6 characters 2021-10-14 09:52:40 +00:00
rillig 8b3967e586 inetd: remove trailing whitespace, add space after 'if' and 'for'
No functional change.
2021-10-12 22:51:28 +00:00
rillig d6e8de267e inetd.8: remove trailing whitespace 2021-10-12 22:47:18 +00:00
rillig 429d53e02c inetd.8: new sentence, new line; minor formatting issues 2021-10-12 22:42:01 +00:00
christos b19025f3ec PR/56448: Solomon Ritzow: Various improvements.
Rate limiting code has been moved to ratelimit.c. I renamed
clear_ip_list to rl_clear_ip_list and broke the code up into more
functions. I have also made the per-IP rate limiting allocation more
efficient. IP addresses are now stored in their network format instead
of a string from getnameinfo (see inetd.h struct rl_ip_node). malloc
calls use only the space needed by the structure by using offsetof on
union members (I suppose this can be a bit dangerous if not done
correctly...). Per-IP rate limiting still supports textual comparison
using getnameinfo for address families other than AF_INET and AF_INET6, but I
don't think there are any that are actually compatible or used by inetd (I
haven't tested UNIX sockets with a remote bound to another file, but I did test
using IPv6 with the textual format by commenting out the IPv6 specific
code, and it works properly). Still potentially handy for the future.
The IP node list (se_rl_ip_list) now uses the <sys/queue.h> SLIST macros
instead of a custom list. I've broken rl_process up into helper functions
for each type of rate limiting and created a separate function for
address stringification, for use with printouts from the -d flag. I
tried to reduce stack memory use by moving printing code involving
string buffers into separate functions. I haven't tested rl_ipv6_eq on
a 32-bit system.

The code for the positional syntax has also been moved to parse.c.
Function try_biltin has been added to remove parse.c:parse_server's
dependency on the biltin structure definition.

File inetd.h has been updated with the proper function prototypes, and
the servtab structure has been update with the new IP node SLIST. I also
moved things around a bit. The way we (a peer and myself)
formatted inetd.h previously was somewhat confusing. Function and global
variable prototypes are now organized by the source file they are
defined in.

I also added a -f flag that I saw in another problem report
(https://gnats.netbsd.org/12823) that I thought could be useful. It
runs inetd in the foreground but without debug printouts or SO_DEBUG.
I'm not completely sure about the line "if (foreground) setsid()" that
I changed from "if (debug) setsid()".
2021-10-12 19:08:04 +00:00
rillig 24db90bb18 sysinst: fix typo in comment 2021-10-11 18:46:34 +00:00
rillig 587f7f989c sysinst: proofread German entropy translation 2021-10-11 17:23:28 +00:00
martin 40c1074537 Consistent #if for static helper function add_entropy 2021-10-09 09:06:28 +00:00
martin 2a566a5853 Disable some installer options to shrink the ramdisk image 2021-10-09 08:21:03 +00:00
nia 9ddbd658d4 Fix accidental word duplication 2021-10-08 22:07:11 +00:00
martin 03af0822f9 Re-enable the entropy handling code in sysinst (only visible on machines
that do not have full entropy), but move it to the config menu
instead of enforcing it as mandatory step.

This menu is shown at the end of the setup, or if explicitly invoked
from the main menu.

Some of the input options are complex but useful in some situations
and code to support them is tiny. Most users will use the manual input
(first + default option) but some might prefer to connect a USB TRNG
or have easy setups to transfer entropy from another machine (while
copy & paste on a serial console sometimes is tricky).
2021-10-08 15:59:55 +00:00
msaitoh fae021bceb Move some common functions into x86/identcpu_subr.c. No functional change. 2021-10-07 13:04:18 +00:00
msaitoh a79b797b99 Improve variable sized TLB's output.
- Fix a bug that STLB is printed as DTLB.
 - If a TLB is variable sized, print the max size instead of error message.
   XXX This is temporary solution.
2021-09-27 17:05:58 +00:00
msaitoh 5bad7a59b6 Add Load Only TLB and Store Only TLB. 2021-09-27 16:52:15 +00:00
msaitoh ec1888b4e2 Fix a bug that some TLB related lines were not printed. 2021-09-27 16:47:15 +00:00
msaitoh bdd55414af Add ':' for readability. 2021-09-27 16:22:58 +00:00
maya f9d97969cb Restore MKNOUVEAUFIRMWARE and MKRADEONFIRMWARE and make gpufw set unconditional
Simplifies logic.
(Second commit - first one was partial)

Restoring MK* requested by mrg on tech-kern discussion
https://mail-index.netbsd.org/tech-kern/2021/09/25/msg027695.html
2021-09-26 15:52:40 +00:00
maya f54624bd74 Move DRM-driver firmware from base to its own set, gpufw
This set is only installed on amd64,i386,evbarm.
This set is installed on minimal installs and on install media, in
case someone needs it for basic driver functionality.

Comments:
Switched to a single MK tunable for it - that is probably unneeded.

An upcoming DRM update will include even fatter firmware, and we'd
like to minimize the impact of it.
2021-09-25 08:54:29 +00:00
andvar c1d86c1466 fix few more typos in comments, messages and documentation. 2021-09-19 11:37:00 +00:00
andvar a136e22ab6 fix various typos in comments, messages and documentation. 2021-09-19 10:34:06 +00:00
christos 292aad7505 Change the default for ACLs to be posix1e instead of nfsv4 to match FreeBSD.
Requested by chuq.
2021-09-18 03:05:19 +00:00
christos ce58ffd338 remove lint hacks now that lint supports _Static_assert 2021-09-17 21:06:35 +00:00
christos 707cb24578 XXX: Teach lint about _Static_assert... 2021-09-17 14:49:03 +00:00
christos 76d4fad60d Use CPPFLAGS for -D and -I so that lint works. 2021-09-17 14:48:31 +00:00
andvar b58602814f fix typos in word "successful". 2021-09-16 22:19:10 +00:00
andvar 72e44f84cb fix typos in word "successfully", mainly s/succesfully/successfully/. 2021-09-16 21:29:41 +00:00
rillig eff0250e6d sysinst: fix lint error about empty compound literal
In C99, a compound literal must have at least one expression between the
braces.  Empty structs and compound literals are a GNU extension.

The first member of struct part_entry has type size_t, therefore 0 fits
well.

No functional change.
2021-09-14 21:45:20 +00:00
rillig 8e69325a35 bta2dpd: fix lint build 2021-09-14 20:45:19 +00:00
rillig cca06e9c53 autofs: fix lint errors
common.c(1034): error: void function parse_map cannot return value [213]
common.c(1053): error: void function parse_map cannot return value [213]
2021-09-14 20:40:55 +00:00
rillig f6412b224f usr.sbin: enable lint for all programs 2021-09-14 20:36:02 +00:00
rillig bbb9ad67ae acpidump: fix lint errors
When lint runs on the code, it defines the preprocessor macro 'lint' to
be 1.  Due to that, this name cannot be used as a regular identifier.

acpi.c(86): error: syntax error '1' [249]
acpi.c(1004): error: syntax error '1' [249]
acpi.c(2422): error: void function acpi_print_lpit cannot return value
    [213]

The FreeBSD code doesn't need this name change since lint is specific to
NetBSD.

No functional change.
2021-09-14 20:34:36 +00:00
andvar 80f2027016 sysinst/partitions.h: fix typos comments, also fix same typos in other files. 2021-09-11 21:30:46 +00:00
andvar 207defd036 Add missing double p and d for stopped and overriden accordingly.
Fix few more typos along the way, mainly in copy-pasted comments.
2021-09-11 20:28:03 +00:00
andvar 11850c9e27 s/existant/existent/ in comments and messages, plus few more similar fixes. 2021-09-03 22:33:17 +00:00
andvar f9faf20aef fix typos in comments, mainly s/extention/extension/ and s/sufficent/sufficient/ 2021-09-03 21:54:58 +00:00
rillig 11067b051b inetd: remove redundant tests before calling isspace 2021-09-03 21:02:04 +00:00
rillig 18ec0f1992 inetd: remove redundant null check before free
No functional change.
2021-09-03 20:41:19 +00:00
rillig adeed07f1b inetd: prepare for lint's strict bool mode
Lint's strict bool mode considers bool incompatible with the other
scalar types.  This makes the type of expressions more visible in the
code.  In particular, conditions of the form '!strcmp(...)' are no
longer allowed, they have to be written as 'strcmp(...) == 0'.

The operator '!' cannot be used with sep->se_wait since that has type
pid_t, not bool.

No change to the resulting binary.
2021-09-03 20:24:28 +00:00
rillig 9948f2b7a0 inetd: normalize indentation and alignment in comments 2021-09-03 19:33:51 +00:00
andvar 3b732a4cd9 s/optons/options/ 2021-09-01 13:44:02 +00:00
mlelstv 478946fb16 conditional build fix. 2021-09-01 06:10:06 +00:00
rillig 3ac7b8f346 inetd: fix Clang build
error: implicit conversion changes signedness: 'service_type' to 'int'
2021-08-31 19:34:42 +00:00
wiz 6ac4757e25 Use Dq. 2021-08-31 11:16:00 +00:00
rillig 5d133dbc57 inetd: raise WARNS from 5 to 6
The necessary fixes include:
* explicit integer conversions, to get rid of mixed signedness
* function prototypes for parameterless functions

While here:
* add space after comma
* add space after 'if'
* place the '{' of a function definition on a separate line
* rename variables 'bits' and 'temp' to 'hi' and 'lo'
* in parse_quote, prefer expressions over assignments
* make hex_to_bits static

No functional change.
2021-08-30 18:21:11 +00:00
rillig 9805323331 inetd: remove trailing whitespace 2021-08-30 17:32:23 +00:00
wiz 2c6f71cb3d Wording and formatting improvements.
New sentence, new line.
2021-08-30 16:10:34 +00:00
mlelstv 1223be2cd5 Fix reverted logic when parsing server program.
Compare pointer with NULL not 0.
2021-08-30 08:21:12 +00:00
tih d118c9fa9a Summary: char is unsigned on arm, so use int when -1 indicates error
hex_to_bits() returns -1 on error, so declare it int, and do the same
for the variables that hold intermediate values returned by it.
2021-08-30 06:27:49 +00:00
christos 6344409ebf remove -m32 accidentally committed 2021-08-29 11:43:48 +00:00
christos b74091d873 fix printf formats (intmax -> j) 2021-08-29 11:43:25 +00:00
christos 2557380693 Inetd enhancements by James Browning, Gabe Coffland, Alex Gavin, Solomon Ritzow
Described in:
    https://www.mail-archive.com/tech-userlevel@netbsd.org/msg03114.html
And developed in:
    https://github.com/ritzow/src/pull/1

From their notes:

All new functionality should be explained by the updated manpage.

The manpage has been refactored a bit: A new section "Directives"
has been added and the information about default hostnames and
IPsec directives has been moved there, and the new file include
directive information is also there.

getconfigent has the most major changes. A newline is no longer
read immediately, but is called only by a "goto more" (inside an
if(false) block). This allows multiple definitions or directives
to exist on a single line for anything that doesn't terminate using
a newline. This means a key-values service definition can be followed
by another key-values service definition, a positional definition,
or an ipsec, hostname, or .include directive on the same line.

memset is no longer used explicitly to clear the servtab structure,
a function init_servtab() is used instead, which uses a C struct
initializer.

The servtab se_group field is its own allocation now, and not just
a pointer into the user:group string.

Refactored some stuff out of getconfigent to separate functions
for use by parse_v2.c. These functions in inetd.c are named with
the form parse_*()

parse_v2.c only has code for parsing a key-values service definition
into a provided servtab. It should not have anything that affects
global state other than line and line_number.

Some function prototypes, structures, and #defines have been moved
from inetd.c to inetd.h.

The function config_root replaces config as the function called on
a config file load/reload. The code removed from the end of
config(void) is now called in config_root, so it is not run on each
recursive config call.

setconfig(void) was removed and its code added into config_root
because that is the only place it is called, and redundant checks
for non-null globals were removed because they are always freed by
endconfig. The fseek code was also removed because the config files
are always closed by endconfig.

Rate limiting code was updated to add a per-service per-IP rate
limiting form. Some of that code was refactored out of other places
into functions with names in the form rl_*()

We have not added any of the license or version information to the
new files parse_v2.c, parse_v2.h, and inetd.h and we have not
updated the license or version info for inetd.c.

Security related:

The behavior when reading invalid IPsec strings has changed. Inetd
no longer exits, it quits reading the current config file instead.
Could this impact program security?

We have not checked for memory leaks. Solomon tried to use dmalloc
without success. getconfigent seemed to have a memory leak at each
"goto more". It seems like inetd has never free'd allocated strings
when throwing away erroneous service definitions during parsing
(i.e. when "goto more" is called when parsing fields). OpenBSD's
version calls freeconfig on "goto more"
(c5eae130d6/usr.sbin/inetd/inetd.c (L1049))
but NetBSD only calls it when service definitions are no longer
needed. This has been fixed. freeconfig is called immediately before
any "goto more". There shouldn't be any time when a servtab is in
an invalid state where freeconfig would break.
2021-08-29 09:54:18 +00:00
andvar 626fac18a1 s/priviledge/privilege/ in comments/log messages and fix one typo in descriptor. 2021-08-22 20:18:39 +00:00
andvar c69f42d323 fix mainly same typos as in my previous commit but outside sys/dev/dm. 2021-08-21 23:00:30 +00:00
andvar 8324be4c9b fix some more typos in comments/log messages, improve wording as well. 2021-08-21 11:55:24 +00:00
andvar b53fb80371 s/accidentaly/accidentally/ 2021-08-21 10:06:33 +00:00
andvar 16e91b5f21 s/helt/held+s/eroneously/erroneously/+s/splitted/split/+s/recommented/recommended/ 2021-08-21 09:59:45 +00:00
andvar 2e0bf311b3 fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected. 2021-08-17 22:00:26 +00:00
christos 1b6126848e Restore BSD BUGS section 2021-08-15 11:00:43 +00:00
ryo 567a3a02e7 Improved the performance of kernel profiling on MULTIPROCESSOR, and possible to get profiling data for each CPU.
In the current implementation, locks are acquired at the entrance of the mcount
internal function, so the higher the number of cores, the more lock conflict
occurs, making profiling performance in a MULTIPROCESSOR environment unusable
and slow. Profiling buffers has been changed to be reserved for each CPU,
improving profiling performance in MP by several to several dozen times.

- Eliminated cpu_simple_lock in mcount internal function, using per-CPU buffers.
- Add ci_gmon member to struct cpu_info of each MP arch.
- Add kern.profiling.percpu node in sysctl tree.
- Add new -c <cpuid> option to kgmon(8) to specify the cpuid, like openbsd.
  For compatibility, if the -c option is not specified, the entire system can be
  operated as before, and the -p option will get the total profiling data for
  all CPUs.
2021-08-14 17:51:18 +00:00
christos 077013d943 One more ldap change 2021-08-14 17:08:21 +00:00
andvar 6e3ee785e2 s/bacause/because/ 2021-08-13 20:19:13 +00:00
martin 38248942cf PR 56354: all actions to set up swap space are not guaranteed to gain
us enough virtual memory anyway, so drop return codes from set_swap*.
The state for cleanup (which swap dev to unuse) has been made global
some time ago anyway.

Previously use of the return values was inconsistent. Error reporting
will only confuse users and sometimes the situation is hard to fix or
even impossible (like in miniroots copide to swap space for booting).
2021-08-12 09:33:59 +00:00
andvar 6584ea569e fix various typos in compatibility, mainly in comments. 2021-08-09 20:49:08 +00:00
andvar 32a556f954 fix various typos in comments and messages. 2021-08-09 19:24:32 +00:00
andvar db383f4739 s/partion/partition/ s/arrray/array/ in comments. 2021-08-08 21:50:10 +00:00
nia f96b5061e9 perfused: use SOL_LOCAL 2021-08-08 20:56:54 +00:00
nia 213aa76def introduce a SOL_LOCAL for unix-domain socket level socket options
as an alias of the current 0 used for these options, as in FreeBSD.

reviewed by many.
2021-08-08 20:54:48 +00:00
andvar ba70c588fa fix various typos in comments. 2021-08-06 07:55:13 +00:00
andvar bfc9dbf5d0 s/pasword/password/ 2021-08-03 20:59:20 +00:00
martin fa635f7d57 Cleanup alarm(3) handling in the timezone selection menu for error
cases, pointed out by RVP.
2021-08-03 13:40:33 +00:00
martin 71830ed8c3 When reading output from a program we don't know how much it will
be - so scale the buffer (within reasonable limits).
Problem pointed out by RVP, triggered e.g. by disks with lots of GPT
partitions.
2021-08-03 13:34:04 +00:00