summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2018-05-09Fix (include file ) line number counting by keeping track of the ungetOtto Moerbeek
buffer per file; also use that buffer to expand macros. ok sashan@ dennis@ krw@
2018-05-07Add the logging parameters to mousecfg.c, and make the 'param' fieldUlf Brosziewski
available for all wsmouse devices.
2018-05-05document unit value for pltime and vltime;Jason McIntyre
from paul de weerd ok kn
2018-05-02sort;Jason McIntyre
2018-05-01Mention RFC 7217 and RFC 7772Florian Obser
2018-05-01The -d flag should be a no-op in monitor mode since it does not modifyFlorian Obser
the routing table. However, if -d is provided route monitor lists all interfaces and their associated addresses and exits. This is confusing, unexpected and no longer needed (if ever). Make -d a proper no-op for route monitor and get rid of the interfaces function which didn't use the correct sysctl idiom anyway. OK benno
2018-05-01Sync p_rttables() to netstat(1) version. Pointed out by claudio andFlorian Obser
mpi. Remaining differences are pledge and priority handling which only route(8) has. While here switch flushroutes to get_sysctl() function. OK benno
2018-04-30* simplify code by no longer calling getnetbyname(3)Ingo Schwarze
* avoid double lookups for unresolvable names without -net * more fitting error message for unresolvable names after -net OK florian@
2018-04-30tableid is either initialized to the current routing table or to theFlorian Obser
one specified by the T flag. No need to pass a flag around if the tableid is valid. It always is. This code is now in sync between flushroutes() and p_rttables(). OK benno, no objection claudio
2018-04-30No need to get the whole routing table from the kernel if we areFlorian Obser
filtering by address family and / or priority; similar to what p_rttables() is doing. (At the time of writing we need to copy about 150MB for the whole table on a router that is in the default free zone). OK benno
2018-04-30Fix route monitor -AF filter.Florian Obser
While here make and to see that this is correct and not touching any global state make af a local variable and pass it around. Input & OK benno
2018-04-28remove references to /etc/networks; reminded by jmc@Ingo Schwarze
2018-04-28Improve / simplify pledges.Florian Obser
1) after schwarze@'s rampage (thanks!) we can drop rpath since asr is no longer opening /etc/networks behind our back 2) we have the "route" pledge for the NET_RT_DUMP sysctl so we can pledge earlier in main; flushroutes() and p_rttables() now tighten the pledge instead of being the first pledge 3) the pledge in monitor() was just a repeat of the main() pledge, it can go. OK schwarze, deraadt
2018-04-28Ignore SIGPIPE in case a TCP client resets the connectPhilip Guenther
ok otto@
2018-04-27Add getnumber() to extract simple deciaml values from theKenneth R Westerback
user. Doesn't handle units, '*', etc. Replace the more complex getuint64 when getting things like the number of tracks per cylinder. ok otto@
2018-04-27Create and use a couple of #defines for the magic returnKenneth R Westerback
values of getuint64 that indicate errors. Suggested by & ok otto@
2018-04-27Restore mode on symlinksPhilip Guenther
ok deraadt@
2018-04-26Cast a multiplicand to ino_t to avoid overflow in 32*32=64 calculationsPhilip Guenther
ok pirofti@ krw@
2018-04-26Add error handling to unconfuse myself when playing with pledgepath().Florian Obser
2018-04-26The frontend tells the main process when the startup is finished soFlorian Obser
that we can drop the sendfd pledge.
2018-04-26Hoist initialisations up; while here tighten not yet working pledge.Florian Obser
2018-04-26Prefer <fcntl.h> over <sys/fcntl.h> in userlandPhilip Guenther
While here, delete some extra #includes and apply style(9) sort rules. ok deraadt@ krw@ mpi@
2018-04-26No need for two copies of tricky user input gathering code. Just useKenneth R Westerback
getstring() to get the string and then parse that in getuint64(). Fix a mis-use of %lld and some whitespace while passing. ok otto@
2018-04-26Add some range checks to make sure we don't attempt to store valuesKenneth R Westerback
too large for the receiving fields. Change a couple of do{}while() to for(;;) for consistancy. Tweaks & ok otto@
2018-04-26Plug leak in error case of the common 'varset' implementations.Kenneth R Westerback
ok benno@
2018-04-26Fix previous. Adding "offset" to "maxval" was required.YASUOKA Masahiko
ok otto krw
2018-04-26net80211: stub SIOCS80211SCAN, make ifconfig scan instant.Paul Irofti
The following removes the functionality of the SIOCS80211SCAN ioctl. After long discussions with stps@, mpi@, and deraadt@ we decided that this was the correct way of fixing ifconfig scan from blocking the network stack. The kernel will continue scanning in the background and filling the nodes array, but ifconfig scan commands will now basically do just a SIOCG80211ALLNODES and pretty print the array. So the output stays the same but is instant. In fact, when the interface is freshly brought up, if you type fast enough, you can see the array being filled by running multiple ifconfig scans in sequence. The SIOCS80211SCAN ioctl stays for now as wi(4), pgt(4) and malo(4) still need it around. But not for long... Another change that this introduces is the fact that ifconfig scan no longer plays with UP and DOWN. If the interface is down it complains and exits. This is needed in order to maintain the nodes list. Works on iwm(4), iwn(4), urtwn(4), run(4) and athn(4). Tested by mpi@, landry@, florian@, thanks! OK mpi@.
2018-04-26Do not try getnetbyname(3) if gethostbyname(3) returns no result.Ingo Schwarze
This is part of the project to delete /etc/networks support. OK deraadt@
2018-04-26Consolidate duplicate error messages, 'return' is not a function soKenneth R Westerback
space before '(', eliminate extraneous '{}'. Start of cleaning up user input processing. No intentional functional change. ok otto@ give or take a few '{}' removals.
2018-04-26Add a '-tunneldomain' ifconfig(8) option as shorthand for 'tunneldomain 0'akoshibe
to be consistent with the '-rdomain' option. Suggested by dlg OK benno, jca, kn, phessler, jmc
2018-04-24Make dhclient show imsg pipe poll error messages in debug output only.Stefan Sperling
ok krw@
2018-04-23While privacy addresses do just expire and never get renewed we needFlorian Obser
to solicit a router advertisment shortly before their pltime runs out so that we generate a new one. Reported by naddy@. OK benno@
2018-04-17Document how to avoid isakmpd(8) source IP address pitfalls by usingStefan Sperling
the Listen-on directive in isakmpd.conf(5). This directive can be necessary in multi-homed situations, and if isakmpd(8) is used with carp(4). ok sthen@ mpi@
2018-04-11Two fixes in ping:Vadim Zhukov
1. Stop telling our PID to the world: the ident values could overlap anyway since PID space is larger than 16 bits for some time already. 2. No need for htons/ntohs dance with ident in IPv6 case. okay benno@ deraadt@ florian@
2018-04-07Display local timezone in all deadline estimates.cheloha
Admins don't necessarily reside in the same timezone as the machine. If an admin mistakenly schedules downtime for a machine at the wrong time this could be quite bad. Users, too, don't necessarily reside in the same timezone as the machine. Saying the box is going down at "15:40" is potentially ambiguous. So, display the local timezone in all logs, broadcasts, printouts, messages, etc. Give the admin a chance to correct the mistake; give the user a better idea of when the box is actually going down. This also updates the process' understanding of the present time before printing estimates. The system's wall clock could have changed after the shutdown was scheduled, making subsequent broadcasts potentially misleading for users. ok deraadt@
2018-04-06Round user input to cylinder boundaries more betterer.Kenneth R Westerback
Improve emitted verbiage while there. tweaks & ok otto@
2018-03-31The rarely used '-L' option does not need a PATH_MAX staticKenneth R Westerback
array. Just point at the provided optarg like '-l' does. Also, no need to initialize a static pointer to NULL.
2018-03-31Fix '-i' to discard previously defined values for the options to beKenneth R Westerback
ignored.
2018-03-31Move 'require' declaration into 'DHCP Options' sectionKenneth R Westerback
alongside 'request'.
2018-03-22The iked(8) fuzzer did not fuzz encrypted payloads. With that changedPatrick Wildt
the regression test uncovered code paths in the TS and CP payload parser that can trigger access to invalid memory locations. This changes the TS and CP payload parsing to add additional length checks. With hshoexer@ and markus@; OK sthen@
2018-03-20pretty_print_option() returns a pointer to a 0 length string, notKenneth R Westerback
NULL, on failure. Eliminates possible "option = ;' lines in lease files.
2018-03-19Disallow "++minutes".cheloha
strtonum(3) accepts a single leading '+', so if we increment timearg we allow input with two leading pluses. If we don't increment, we still have a valid input for strtonum(3). While here, use errstr to say what was wrong with timearg. Don't increase the range for offsets yet: it exposes segfaults elsewhere in the program that need to be addressed. ok millert@ tb@
2018-03-16clarify what the route priority does and what defaults are used.Sebastian Benoit
with suggestions from jmc and ok mpi@
2018-03-16improve markup quality in the cases found by the new "--" style messageIngo Schwarze
2018-03-16Consistently spell "IPsec" in comments and debug outputs.Martin Pieuchot
From Raf Czlonka, ok sthen@
2018-03-13RFC 7217 states (section 5, page 9):Florian Obser
| The Interface Identifier is finally obtained by taking as many | bits from the RID value (computed in the previous step) as | necessary, starting from the least significant bit. Copy bits from the end of the digest array, not from the beginning. While here initialize iid. Problem that IPv6 addresses change while they should not pointed out by semarie@. OK sthen, phessler
2018-03-10Avoid a race when populating an mfs fs by using a tmp dir and splitOtto Moerbeek
out the "wait for mount" code into a function to see more easily what is going on. ok visa@ tedu@
2018-03-08Check required partition size against the size of the largest freeKenneth R Westerback
chunk, not the total amount of free space on the disk. Removes need for 'totsecs'. ok otto@ as part of larger diff now completely committed
2018-03-08Calculate chunk size after adjusting both the chunk offset and chunkKenneth R Westerback
end in SUN_CYLCHECK case. Fixes potential off-by-one in calculating the number of cylinders available in a chunk. ok otto@ as part of larger diff
2018-03-08Instead of a SUN_CYLCHECK block in both parts of an if/else, with aKenneth R Westerback
goto from one to the other, just move the logic after the if/else. One less #ifdef. Decrements total_secs in either case. ok otto@ as part of larger diff