aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
Commit message (Collapse)AuthorAgeFilesLines
* cron(8): set the environment variables of the user and/or login classKyle Evans2020-02-052-8/+31
| | | | | | | | | | | | | | | Prior to processing environment variable set in the crontab file as those should be of higher precedent, pull in the user or login class environment. This is another supporting feature for allowing one to configure system-wide settings that may affect both regular cron jobs as well as services. This is the final part of D21481. Submitted by: Andrew Gierth <andrew_tao173.riddles.org.uk> Notes: svn path=/head/; revision=357565
* service(8): set the environment of the "daemon" class before invokingKyle Evans2020-02-051-1/+1
| | | | | | | | | | | | | As mentioned in r357562, this gives the user a single place to configure environment variables that need to be used for various services -- the "daemon" class -- for, e.g., configuring a system-wide HTTP proxy. This is a part of D21481. Submitted by: Andrew Gierth <andrew_tao173.riddles.org.uk> Notes: svn path=/head/; revision=357564
* Remove simple_httpdKyle Evans2020-02-044-676/+0
| | | | | | | | | | | | | | simple_httpd was granted a reprieve from the picobsd removal based on having some reported user; it turns out this user isn't actually using the version in base and merging their changes would be difficult at this point, so the version in base will simply continue to rot. Retire it now, it may make a comeback to ports with the improved version. No notice issued because its current visibility has only been for ~3 months, and a notice has been previously issued about picobsd removal. Notes: svn path=/head/; revision=357543
* services: Add PROFInet and EtherCAT.Pedro F. Giffuni2020-01-311-0/+8
| | | | | | | | | Both are used in industrial networks. MFC after: 1 week Notes: svn path=/head/; revision=357343
* Merge r357339 from the clang1000-import branch:Dimitry Andric2020-01-311-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] return (-1); ^ usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here } else ^ The intent was to group the return statement with the previous syslog() call. MFC after: 3 days Notes: svn path=/head/; revision=357340
| * Fix the following -Werror warning from clang 10.0.0 in bsnmpd:Dimitry Andric2020-01-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1661:4: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation] return (-1); ^ usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c:1658:5: note: previous statement is here } else ^ The intent was to group the return statement with the previous syslog() call. MFC after: 3 days Notes: svn path=/projects/clang1000-import/; revision=357339
* | Fix an indentation bug in r357169.Brooks Davis2020-01-301-1/+1
|/ | | | Notes: svn path=/head/; revision=357303
* Fix the following -Werror warning from clang 10.0.0 in bsnmpd:Dimitry Andric2020-01-291-2/+2
| | | | | | | | | | | | | usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] begemotBridgeStpPortEnable_enabled || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Work around it by casting the enum values to the type of val->v.integer. MFC after: 3 days Notes: svn path=/projects/clang1000-import/; revision=357271
* ypldap(8): Fix absent va_end() in 'goto fail' pathConrad Meyer2020-01-291-0/+1
| | | | | | | | | | | | | | | | In this path, we used va_start() without pairing it with va_end(). Add the va_end(). (va_start() without paired va_end() is undefined behavior per the C standard.) "In many implementations, [va_end] is a do-nothing operation; but those implementations that need it probably need it badly." - Rationale for the ANSI C Programming Language, ยง 4.8.1.3. Reported by: Coverity CID: 1340539 Notes: svn path=/head/; revision=357249
* bsdinstall: Provide help text for partitioning optionsBen Woods2020-01-271-11/+28
| | | | | | | | | | | | | | | Includes commentary of when ZFS works well by default (>= 8GB RAM), and where to go for information on ZFS tuning if required. Also hoist the options text to the top of script as variables (will help with future international translations). Reviewed by: philip, dteske, karels, imp, emaste Approved by: rgrimes Differential Revision: https://reviews.freebsd.org/D23224 Notes: svn path=/head/; revision=357185
* Allow bootstrapping makefs on older FreeBSD hosts and Linux/macOSAlex Richardson2020-01-272-4/+4
| | | | | | | | | | | | | | | | | | | | | | In order to do so we need to install the msdosfs headers to the bootstrap sysroot and avoid includes of kernel headers that may not exist on every host (e.g. sys/lockmgr.h). This change should allow bootstrapping of makefs on FreeBSD 11+ as well as Linux and macOS. We also have to avoid using the IO_SYNC macro since that may not be available. In makefs it is only used to switch between calling bwrite() and bdwrite() which both call the same function. Therefore we can simply always call bwrite(). For our CheriBSD builds we always bootstrap makefs by setting LOCAL_XTOOL_DIRS='lib/libnetbsd usr.sbin/makefs' and use the makefs binary from the build tree to create a bootable disk image. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D23201 Notes: svn path=/head/; revision=357169
* [ntp] Don't compile in the ssl routines into libevent if MK_OPENSSL is noAdrian Chadd2020-01-241-1/+7
| | | | | | | | | | | Most of ntpd still handles MK_OPENSSL ok, but the libevent import brought in the SSL bufferevent routines without checking MK_OPENSSL. This doesn't completely fix WITHOUT_CRYPTO=YES building, but hey, it's one less broken thing. Notes: svn path=/head/; revision=357068
* Fix build when WITHOUT_WPA_SUPPLICANT_EAPOL option used.Cy Schubert2020-01-211-14/+20
| | | | | | | | | | | | The build failure was discoved by Michael Dexter's recent Build Options Survey run, at https://callfortesting.org/results/bos-2020-01-16/\ WITHOUT_WPA_SUPPLICANT_EAPOL-small.txt. Reported by: Michael Dexter <editor@callfortesting.org> via emaste MFC after: 2 weeks Notes: svn path=/head/; revision=356949
* Fix regression in bsdinstall post r356740 - partedit errno(2) 21 EISDIRBen Woods2020-01-171-1/+1
| | | | | | | | | | | | | | | | This resulted in the partitioning step failing if either of the "Auto (UFS)" or "Manual" options were selected. Reason: partedit was attempting to open a directory (TMPDIR) read/write, which resulted in errno(2) 21 - EISDIR - Is a directory. Reported by: Clay Daniels <clay.daniels.jr@gmail.com> Reviewed by: Ryan Moeller <ryan@freqlabs.com> Approved by: emaste, bcran Differential Revision: https://reviews.freebsd.org/D23232 Notes: svn path=/head/; revision=356855
* Fix pfdenied not returning any resultsKristof Provost2020-01-161-1/+1
| | | | | | | | | | | | | When _a is empty we end up with an invalid invocation of pfctl, and no output. We must add quotes to make it clear to pfctl that we're passing an empty anchor name. PR: 224415 Submitted by: sigsys AT gmail.com MFC after: 2 weeks Notes: svn path=/head/; revision=356816
* setextattr: Increase stdin buffer size to 4096Alan Somers2020-01-161-1/+1
| | | | | | | | | | | | | | | | | | Extended attribute values can potentially be quite large. One test for ZFS is supposed to set a 200MB xattr. However, the buffer size for reading values from stdin with setextattr -i is so small that the test times out waiting for tiny chunks of data to be buffered and appended to an sbuf. Increasing the buffer size should help alleviate some of the burden of reallocating larger sbufs when writing large extended attributes. Submitted by: Ryan Moeller <ryan@freqlabs.com> MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D23211 Notes: svn path=/head/; revision=356809
* Fix a spacing error from the previous commit for -ll mode. Add a littleScott Long2020-01-151-3/+4
| | | | | | | more space padding to that mode to give the columns a consistent offset. Notes: svn path=/head/; revision=356762
* bsdinstall: Change "default" (first) Partitioning method to ZFSBen Woods2020-01-152-6/+6
| | | | | | | | | Reported by: Ruben Schade (during his talk at linux.conf.au) Approved by: philip Differential Revision: https://reviews.freebsd.org/D23173 Notes: svn path=/head/; revision=356758
* bsdinstall: Use TMPDIR if setRebecca Cran2020-01-1510-22/+50
| | | | | | | | | Submitted by: Ryan Moeller <ryan@freqlabs.com> Reviewed by: bcran, Nick Wolff <darkfiberiru@gmail.com> Differential Revision: https://reviews.freebsd.org/D22979/ Notes: svn path=/head/; revision=356740
* fstyp hammer2: remove dead codeEric van Gyzen2020-01-131-5/+0
| | | | | | | | | | | | | best_i will always be >= 0, so remove code to test otherwise. Reported by: Coverity CID: 1412244 MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23159 Notes: svn path=/head/; revision=356709
* fstyp hammer: use strlcpyEric van Gyzen2020-01-131-2/+2
| | | | | | | | | | | | | | Use strlcpy to guarantee NUL termination. Due to this, there is no need for strncmp; simply use strcmp. Reported by: Coverity CID: 1412242 MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D23159 Notes: svn path=/head/; revision=356708
* Unbound's config.h is manually maintained, using a ./configure producedCy Schubert2020-01-135-0/+1342
| | | | | | | | | | | | config.h as a guide. In practice contributed software maintains a copy of config.h within its build directory tree containing its Makefile. usr.sbin/unbound is the home for its config.h. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D22983 Notes: svn path=/head/; revision=356676
* camdd: initialize devs earlierKyle Evans2020-01-101-2/+2
| | | | | | | | | | | | GCC9 points out that devs may be used initialized after the bailout label; in-fact, if num_io_opts != 2 then it is. Move the initialization up a little bit. Reviewed by: ken MFC after: 3 days Notes: svn path=/head/; revision=356617
* inetd: two more nitsKyle Evans2020-01-101-6/+7
| | | | | | | | | | Use __COPYRIGHT for copyright to simply either embed it via .ident or have it properly marked __unused Move an ipsec reference to IPSEC Notes: svn path=/head/; revision=356602
* inetd: free WITHOUT_INET6_SUPPORT build of warningsKyle Evans2020-01-101-2/+13
| | | | | | | | | | | | | | | If inetd is compiled without inet6 support, we need to error out on rpc+inet6 services rather than attempting to call into rpc bits with an uninitialized netid. v4bind is only used with INET6 support, so move it under the proper #ifdefs with v6bind. Reported by: Pavel Timofeev <timp87 gmail com> MFC after: 3 days Notes: svn path=/head/; revision=356601
* arp(8): avoid segfaulting due to out-of-bounds memory accessEugene Grosbein2020-01-091-2/+1
| | | | | | | | | | | Fix obvious mistake that sometimes results in reading memory past end of an array. PR: 240825 MFC after: 1 week Notes: svn path=/head/; revision=356551
* bhyve: add wrapper for debug printf statementsVincenzo Maffione2020-01-0834-588/+667
| | | | | | | | | | | | | | | Add printf() wrapper to use CR/CRLF terminators depending on whether stdio is mapped to a tty open in raw mode. Try to use the wrapper everywhere. For now we leave the custom DPRINTF/WPRINTF defined by device models, but we may remove them in the future. Reviewed by: grehan, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22657 Notes: svn path=/head/; revision=356523
* o Spell "Redundancy" and "Remember" correctly.Maxim Konovalov2020-01-081-3/+3
| | | | | | | | PR: 243187 Submitted by: mikael.urankar@gmail.com (partially) Notes: svn path=/head/; revision=356488
* inetd: fix WITHOUT_TCP_WRAPPERS build after r356248Ed Maste2020-01-031-0/+2
| | | | | | | | | | | | After increasing WARNS, building WITHOUT_TCP_WRAPPERS failed because of some unused variables. Reported by: Cirrus-CI (against my WIP branch) MFC with: r356248 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=356318
* Add a compact columnar output format, available by specifying a second '-l'Scott Long2020-01-022-18/+46
| | | | | | | | | | command line option. Thanks to the removal of unnecessary information and the organization into columns, this helps the output be more legible on both 80 column displays and non-80 column displays. imp@ provided the idea on this. Notes: svn path=/head/; revision=356267
* inetd: final round of trivial cleanup, NFCKyle Evans2020-01-011-34/+21
| | | | | | | | | | | | | | Highlights: - Use MAX() for maxsock raising; small readability improvement IMO - malloc(3) + memset(3) -> calloc(3) where appropriate - stop casting the return value of malloc(3) - mallloc(3) -> reallocarray(3) where appropriate A future change may enter capability mode when forking for some of the built-in handlers. Notes: svn path=/head/; revision=356254
* inetd: convert remaining bzero(3) to memset(3), NFCKyle Evans2020-01-012-4/+3
| | | | | | | | | | | | This change is purely in the name of noise reduction from static analyzers that want to complain that bzero(3) is obsolete in favor of memset(3). With this, clang-analyze at least is now noise free. WARNS= 6 also appears to have been OK for some time now, so drop the current setting and opt for the default. Notes: svn path=/head/; revision=356248
* inetd: track all child pids, regardless of maxchild specKyle Evans2020-01-012-29/+40
| | | | | | | | | | | | | | | | Currently, child pids are only tracked if maxchildren is specified. As a consequence, without a maxchild limit we do not get a notice in syslog on children aborting abnormally. This turns out to be a great debugging aide at times. Children are now tracked in a LIST; the management interface is decidedly less painful when there's no upper bound on the number of entries we may have at the cost of one small allocation per connection. PR: 70335 Notes: svn path=/head/; revision=356247
* inetd: add some macros for checking child limits, NFCKyle Evans2020-01-012-5/+9
| | | | | | | | | The main point here is capturing the maxchild > 0 check. A future change to inetd will start tracking all of the child pids so that it can give proper and consistent notification of process exit/signalling. Notes: svn path=/head/; revision=356246
* inetd: prefer strlcpy to strlen(3) check + strcpy(3), NFCKyle Evans2019-12-311-6/+9
| | | | | | | This is again functionally equivalent but more concise. Notes: svn path=/head/; revision=356218
* inetd: prefer strtonum(3) to strspn(3)+atoi(3), NFCKyle Evans2019-12-311-2/+8
| | | | | | | | strtonum(3) does effectively the same validation as we had, but it's more concise. Notes: svn path=/head/; revision=356217
* inetd: knock out some clang analyze warningsKyle Evans2019-12-312-8/+16
| | | | | | | | | | | | | | | | | chargen_dg: clang-analyze is convinced that endring could be non-NULL at entry, and thus wants to assume that rs == NULL. Just independently initialize rs if it's NULL to appease the analyzer. getconfigent: policy leaks on return free_connlist: reorganize the loop to make it clear that we're not going to access `conn` after it's been freed. cpmip/hashval: left-shifts performed will result in UB as we take signed 0xABC3D20F and left shift it by 5. Notes: svn path=/head/; revision=356215
* inetd: don't leak `policy` on returnKyle Evans2019-12-301-4/+3
| | | | | | | | | | | | | sep->se_policy gets a strdup'd version of policy, so we don't need it to stick around afterwards. While here, remove a couple of NULL checks prior to free(policy). CID: 1006865 MFC after: 3 days Notes: svn path=/head/; revision=356204
* powerd(8): Fix a memory leak when we fail to read frequency levels.Mark Johnston2019-12-291-1/+3
| | | | | | | | | PR: 242967 Submitted by: Hans Christian Woithe <chwoithe@yahoo.com> MFC after: 3 days Notes: svn path=/head/; revision=356184
* Make this compile under external gcc toolchain if WITH_ICONV isn't defined.Adrian Chadd2019-12-291-1/+4
| | | | | | | This quietens a bunch of unused variable warnings that are treated as errors. Notes: svn path=/head/; revision=356169
* Implement dump_stats command for usbconfig(8).Hans Petter Selasky2019-12-274-3/+50
| | | | | | | | | | This command is useful when debugging USB device issues. MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=356137
* cron(8): use proper variable to determine mailer process statusKyle Evans2019-12-261-4/+6
| | | | | | | | | | | | | | | | | | | | | | | While the mailer is normally opened/set if the mailto is set, this is not the case if the grandchild actually didn't produce any output. This change corrects the situation to only attempt to kill/close the mail process if it was actually opened in the first place. The reporter initially stumbled on the -n (suppress mail on success) flag leading to a SIGKILL of the process group, but simultaneously discovered/reported the behavior with !-n jobs if MAILTO was set and no output happened. All of these places that are checking mailto should actually be checking whether mail is set, so do that for consistency+correctness. This set of bugs were introduced by r352668. Submitted by: sigsys@gmail.com Reported by: sigsys@gmail.com Notes: svn path=/head/; revision=356103
* sbin/fstyp: recgonize Dragonfly's hammer and hammer2.Pedro F. Giffuni2019-12-248-2/+2842
| | | | | | | | | | | | This is based on DragonFly's implementation from about 2019-09-13. It only contains the basic code and header information to identify the disks. Relnotes: yes Differential Revision: https://reviews.freebsd.org/D13369 Notes: svn path=/head/; revision=356060
* fstyp(8): Fix WITHOUT_ICONV buildConrad Meyer2019-12-236-2/+20
| | | | | | | Reported by: olivier Notes: svn path=/head/; revision=356041
* fstyp(8): Detect APFS containersConrad Meyer2019-12-234-1/+111
| | | | | | | | APFS NXSBs are more like slices (or zvols?) than individual filesystem, but go ahead and detect them nicely as well. Notes: svn path=/head/; revision=356034
* fstyp(8): Detect HFS+ / HFSX volumesConrad Meyer2019-12-234-1/+129
| | | | Notes: svn path=/head/; revision=356033
* fstyp(8): Use iconv(3) to convert NTFS vol labels correctlyConrad Meyer2019-12-233-24/+50
| | | | | | | | Rather than hackily extracting only the ASCII subset of UTF-16LE, go ahead and convert the label to the user's locale correctly. Notes: svn path=/head/; revision=356032
* fstyp(8): Show exFAT volume labels with -l flagConrad Meyer2019-12-224-12/+347
| | | | | | | | | | | | | | | | | | | | | exfat is fundamentally the same design as fat32. The superblock differs marginally, and there are some additional optional features irrelevant to fstype(8); the structure of dirents has changed slightly to enable, among other things, larger files; the directory entries are no longer DOS 8.3 ASCII or local 8-bit encoding, but instead explicitly UCS-2-LE. (As a result, this change uses iconv to convert a found exfat volume label to the user's locale.) Locating the volume label is identical to FAT32: locate the root directory and walk through dirents until you find a volume label. Like FAT32, follow the FAT chain between root directory clusters as necessary. PR: 242225 Reported by: Victor Sudakov <vas AT sibptus.ru> Notes: svn path=/head/; revision=355996
* Update the man page to reflect the addition of NFSv4.2 (r355677).Rick Macklem2019-12-201-15/+26
| | | | | | | | | | | Update all the references to NFSv4.1, so that they apply to NFSv4.1 and NFSv4.2. Also, change the MDS->DS mounts to use NFSv4.2, so that both versions of the protocol can be used against the server with pNFS enabled. This is a content change. Notes: svn path=/head/; revision=355960
* Update the man page to reflect the addition of NFSv4.2 (r355677).Rick Macklem2019-12-201-22/+28
| | | | | | | | | | | | Include references to NFSv4.2 and Flexible File layout, plus clarify when vfs.nfsd.flexlinuxhack needs to be set for Linux pNFS clients. Also update the man page to reflect the addition of SpaceUsed to the attributes stored in the extended attribute on the MDS (r354158). This is a content change. Notes: svn path=/head/; revision=355958