Commit Graph

12896 Commits

Author SHA1 Message Date
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
andvar 077d1c0f36 fix various typos in comments and log messages. 2021-08-02 12:56:22 +00:00
andvar 8179431272 fix typo in definition: s/threshhold/threshold/ 2021-08-01 18:02:22 +00:00
andvar 7991f5a7b8 Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
2021-07-24 21:31:31 +00:00
ozaki-r e60c9f37ff altqstat, cbq: follow uint64_t changes
PR kern/56319
2021-07-21 06:48:28 +00:00
ozaki-r 74e779797d altqstat: follow changes of types of variables
PR kern/56319
2021-07-21 06:45:10 +00:00
ozaki-r d08f344ac0 altqstat: show raw values of avgidle, maxidle and minidle
The values are sometimes small and cooked values of them can be less
informative such as 0 or -1.
2021-07-21 06:42:07 +00:00
ozaki-r 605235537f altqstat: adopt ps_per_byte
PR kern/56319
2021-07-21 06:38:57 +00:00
ozaki-r 9b73e13909 libaltq, cbq: convert ns_per_byte to ps_per_byte
PR kern/56319
2021-07-21 06:36:33 +00:00
martin a18ae2f2ae PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.
2021-07-20 16:41:27 +00:00
martin 64e2b749b9 RAM size will not change during installation, do the sysctl() dance
only once.
2021-07-20 16:40:12 +00:00
martin f15fffe7ba Use strlcpy() to copy the wedge device name (the code still assumes
the string is short enough and 0 terminated, but now gcc is happy).
2021-07-17 19:27:22 +00:00
martin 9238070ceb PR 56310: if we fail to create a wedge this either means there is
a bug here (and we requested something nonsensial), or there are pre-
existing "foreign" wedges which disturb our work.
So remove all wedges on this disk that we do not know about and retry
to add our new wedge.
2021-07-17 18:07:22 +00:00
martin 2f5e5e5d38 PR 56310: avoid assert() failures (or crashes) when the runtime addition
of a wedge fails (for whatever reasons).
2021-07-17 11:32:50 +00:00
martin 0c74f0eefd When converting partitions from one scheme to another, never fail
without providing (if requested) a proper error message.
2021-07-14 18:56:05 +00:00
christos fe67084211 PR/56307: Konrad Schroder: npfctl's error messages don't report the failing
filename.
Add the filename (but in quotes for consistency with other places in the file).
Also fix an err -> errx
2021-07-14 09:15:01 +00:00
ozaki-r aeaca9db55 libaltq: allow longer config lines 2021-07-14 08:33:05 +00:00
ozaki-r 1fa2b30b26 libaltq, cbq: add two options to interface
- no-control: don't create a control class automatically
- no-tbr: don't install TBR
2021-07-14 08:32:13 +00:00
martin 8dc1646304 PR install/56303: when using xz files enable swap during set extraction
if the machine does not have more than 256MB of RAM.
2021-07-13 09:13:00 +00:00
kre 53dbacc38d Revert 1.4, that just trades one problem for a different one
(splitting the message on % instead of white space, which affects
less messages, but makes a bigger mess of them when it happens).

The real problem is that the expansion of the message was unquoted,
which allowed the field splitting to happen at all (which was mitigated
by the way printf rescans its format string for each arg when there are
more args than conversions in the format) otherwise it would have been
a much bigger mess (both times).

Just add quotes where quotes are needed, no more splitting, all good.
2021-07-12 19:03:20 +00:00
msaitoh 1fdbc7c04d Add 0x96(Elkhart Lake) and 0x9c(Jasper Lake).
Not listed in SDM but listed in those spec update documents.
2021-07-12 12:56:52 +00:00
cjep e111d10031 We need IFS to be set to % for the rest of the script so be explicit
about it. Fixes message truncation for non-English in sysinst.
2021-07-11 10:51:46 +00:00
msaitoh 1f5dbb6eb2 0x6a and 0x6c are 3rd gen Xeon Scalable (Ice Lake). 2021-07-10 17:18:05 +00:00
martin 5c18a11ba1 Allow to set sanitizer flags for the rump build from the
build.sh command line, like: -V RUMP_SANITIZE=address
2021-07-07 11:51:45 +00:00
cjep ae35b2c1fe 1. Rework the IFS handling when checking consistency of formatting in
sysinst messages. Closes PR toolchain/56181.
2. Whilst here, change some shell clauses to be more portable.

Patch developed by kre. Also reviewed by martin. Cross-builds tested
on NetBSD, OpenBSD, FreeBSD and Darwin.
2021-06-29 08:02:50 +00:00
christos 3151045394 fix proplib deprecation 2021-06-21 03:04:27 +00:00
mlelstv 37d7696158 Don't overwrite changed autofs config files. 2021-06-07 05:29:22 +00:00
hannken 0af7903fb3 Fix typo, its the element not the array ... 2021-06-05 08:26:34 +00:00
hannken 66f6f55589 Change get_exportlist() to collect all exports and emit all
exports for a single mount in one call to nfssvc(2).

Should finally fix PR kern/5844 (NFS server sends "permission denied"
while mound re-read exports).
2021-06-04 10:46:57 +00:00
hannken 1015c2123b Restructure do_nfssvc() and simplify the left cases GT_HOST and GT_NET.
Add a helper add_export_arg() that emits a single export_args item and
does the IPv6 check.
Always use the path of the mount point for the export.
2021-06-04 10:46:01 +00:00
joerg 67de9e3b2a address-of-packed-member warning is no longer a problem here. 2021-05-30 02:28:35 +00:00
riastradh a8fb54449d Teach cpuctl(8) about some additional aarch64 feature bits.
(Descriptions for CSV3 and CSV2 are not very good, but the blurbs in
the arm arm are an entire paragraph long each.  Please fix if you have
a conciser summary!)
2021-05-17 18:43:18 +00:00
martin df9fc8fe01 Do not allow editing of start/size/fs-type for partitions that
are already carved in stone (e.g. defined in an outer MBR while we are
editing the inner disklabel).
2021-05-09 11:06:20 +00:00
martin e2b83173c8 Keep MSDOS partition size and subtype consistent - some u-boot are picky. 2021-05-09 10:39:00 +00:00
martin 43fa2aa1e9 For FS_MSDOS report the MBR type as fs_sub_type. 2021-05-09 10:37:49 +00:00
lukem 5eb596e7f8 postinstall: re-align list output 2021-04-25 06:21:37 +00:00
lukem 31d619c58b postinstall: sort the items. keep obsolete* last
Consistency and quality of life improvements to postinstall:

Order all of the items (including disabled) alphabetically.
Consistent comment style before each item block.
Move other functions used by do_*() before rather than after do_*().
2021-04-25 01:44:55 +00:00
lukem 792fdb70f9 postinstall: comment and usage style
Use NOTE: for comments to be aware of.
Remove double space before "fix|check" in some items.
2021-04-25 01:15:39 +00:00
lukem e314ca6bb1 postinstall: ensure SRC_DIR and DEST_DIR are quoted 2021-04-25 00:36:47 +00:00
lukem 797de592da postinstall: use correct DEST_DIR in obsolete_stand 2021-04-25 00:29:52 +00:00
nia 220adab0b9 wsfontload.8: clean up examples
add an example of loading a larger font since a lot of people ask.
2021-04-24 09:18:44 +00:00
nia 373ad9488f wsfontload: clarify more 2021-04-24 09:03:05 +00:00
nia 779072058e wsfontload: clarify documentation of -l 2021-04-24 08:59:09 +00:00
wiz dfc8604311 wsfontload: make -l mode a separate line in the usage
Document it in the manpage.
2021-04-24 07:52:07 +00:00
macallan 1322e99212 add -l option to dump a list of available fonts 2021-04-24 00:49:26 +00:00
msaitoh 882c1780be - Remove obsolete cltom(9) and mtocl(9).
- Add missing manual page's link of m_adj.
2021-04-16 07:45:41 +00:00
mrg 3cc337c4a3 more -fcommon for sources not ready yet 2021-04-13 08:55:06 +00:00
mrg bf1baa2579 some platforms trip -fcommon here too. we should fix this. 2021-04-13 07:53:19 +00:00
mrg 6274000239 avoid potential uninitialised variable use. 2021-04-13 05:58:45 +00:00
mrg f5c1005436 apply some -Wno- to ignore several new warnings with GCC 10.
ntp: ignore truncation beyond api sizes, and ignore wrongly
guessed underflow

tmux: ignore maybe uninitialised warning for impossible case

libbfd: signed/unsigned variables assigned in the same statement

dri/gallium: -Wno-builtin-declaration-mismatch for u_atomic.c as
it implements backend functions with different in-C-machine but
same-in-real-machine types

libXfont/libXfont2: signed/unsigned variables assigned in the same
statement

i915drm: ignore impossible maybe uninitialised warnings

sysinst: ignore an invalid string truncation issue
2021-04-13 04:58:59 +00:00
mrg 72ccf7c95b apply -fcommon to sources that still rely upon it. 2021-04-13 01:11:05 +00:00
nia 124e280e84 hdaudioctl.8: add missing arguments
pointed out by RVP
2021-04-12 12:22:10 +00:00
mrg 8d689c0cf0 avoid attempting to print NULL. 2021-04-12 09:30:32 +00:00
mrg b6529141f9 use strlcpy() to ensure desired nul termination.
trailing nul bytes are not needed here.
2021-04-12 09:29:53 +00:00
mrg dcf8481a48 fix a buffer size (off by one), and fix all the comments for the
3 other correctly sized buffers with the same comment/context.
2021-04-12 05:11:09 +00:00
mrg a2d1542565 add some new uses of existing GCC_NO_* variables for warning issues.
remove an no longer relevant for gcc7 workaround (works fine in both
gcc9 and gcc 10.)
2021-04-12 02:54:07 +00:00
simonb ba42c78d37 Add a -L option to follow all symbolic links. Useful if you have symlinks
in a makefs directory tree but want to refer to the actual file.
2021-04-03 14:10:56 +00:00
simonb 353a61bfae Deal with the case when a device gets recreated (eg when mtree is called by
MAKEDEV) and the stat buffer contains information about the original device
before checking/setting the owner/group/mode of the new device file.
2021-04-03 13:37:18 +00:00