aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* rc: ignore .pkgsave filesMina Galić2023-03-152-4/+20
| | | | | | | | | | | The local parts of rc already skip .sample files; we add .pkgsave to the list, and add logic for base. Thanks to @RhodiumToad for getting this started. Differential Revision: https://reviews.freebsd.org/D27962 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/662
* rc.d: Fix NFS server startup scripts to enable vnet prison useRick Macklem2023-03-125-6/+6
| | | | | | | | | | | | | | | | | Now that commit cbbb22031f9b is in main, it is possible to run nfsd(8), nfsuserd(8), mountd(8), gssd(8) and rpc.tlsservd(8) in an appropriately configured vnet prison if the "allow.nfsd" option is specified in jail.conf. This patch fixes the rc scripts for this. Mostly just replaces the "nojail" KEYWORD with "nojailvnet", but also avoids setting vfs.nfsd.srvmaxio in a prison, since it must be set outside of the prisons and applies to all nfsd(8) instances. Reviewed by: jamie MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D38809
* tftpd: Gracefully skip tests if networking is not enabled.Dag-Erling Smørgrav2023-03-101-1/+7
| | | | | | Sponsored by: Klara, Inc. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D39012
* tftpd: Don't forget to close stderr on startup.Dag-Erling Smørgrav2023-03-101-2/+3
| | | | | | | | Just like stdin and stdout, stderr is a copy of the listen socket inherited from inetd. We need to close it so inetd can process further requests, be restarted, etc. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38968
* tftpd: Don't consume arbitrary requests when failing to fork.Dag-Erling Smørgrav2023-03-101-40/+12
| | | | | | | | We've already consumed one request, which is sufficient to prevent inetd from endlessly restarting us in this particular and extremely unlikely case. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38967
* tftpd: Use poll() instead of alarm() + setjmp().Dag-Erling Smørgrav2023-03-102-29/+11
| | | | | | | | While there, don't log an error when timing out waiting for a possible retransmit after a successful transfer. Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38966
* tftpd: Make the -d option behave as documented.Dag-Erling Smørgrav2023-03-101-2/+4
| | | | | | Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38965
* tftpd: Make the transfer functions return success / failure.Dag-Erling Smørgrav2023-03-102-22/+20
| | | | | | Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38957
* tftpd: Ensure that tftp_log() preserves errno.Dag-Erling Smørgrav2023-03-101-0/+4
| | | | | | Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38956
* tftpd: Fix max block size calculation.Dag-Erling Smørgrav2023-03-101-0/+1
| | | | | | Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38953
* rc.conf: update comment referring to /etc/motdCeri Davies2023-03-091-1/+1
|
* rc.d: Generate machine-id from hostid_saveTijl Coosemans2023-03-094-46/+21
| | | | | | | | | | | | | | | | rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid. Store the same UUID, without hyphens, in /etc/machine-id. The hypĥens are removed with a shell function because hostid_save runs before file systems are mounted so other tools may not be available yet. This eliminates some duplication between hostid and machine-id and for virtual machines machine-id now contains the UUID configured in the hypervisor like it does on Linux. Reviewed by: delphij Discussed with: bapt MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D38811
* hostid: Generate random UUID by defaultTijl Coosemans2023-03-092-1/+2
| | | | | | | This way MAC addresses are no longer exposed. Discussed with: bapt MFC after: 3 days
* machine-id: generate a compact version of the uuidBaptiste Daroussin2023-03-011-1/+1
| | | | | | | dbus and other actually expect an uuid without hyphens Reported by: tijl MFC After: 3 days
* rc.conf(5): describe what unbound(8) doesTom Hukins2023-02-281-1/+1
| | | | | Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/650
* growfs_fstab startup script: set dumpdev to AUTOMike Karels2023-02-281-8/+3
| | | | | | | | | | | | | | The growfs_fstab script has been testing dumpdev, and if it is AUTO, enables dumps on the newly-added swap device for the initial boot. However, dumpdev defaults to AUTO on main, but NO on stable/13 and release branches. On the other hand, bsdinstall adds dumpdev="AUTO" by default (controlled by a menu item). bsdinstall is not used when booting an SD card or other disk image. Adopt the default from bsdinstall, and set dumpdev to AUTO in /etc/rc.conf in the growfs_fstab script if a swap partition has been added, along with the explanatory comment added by bsdinstall. Differential Revision: https://reviews.freebsd.org/D38751
* sys/param.h: Add _WANT_P_OSRELKonstantin Belousov2023-02-152-0/+2
| | | | | | | | | | | Use it instead of defining IN_RTLD by base sources that want P_OSREL_ defines in userspace, but are not rtld. This allows to remove abuse of IN_RTLD from userspace. Reviewed by: dchagin, markj, imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38585
* cleanvar: Be more careful when cleaning up /var.Xin LI2023-02-131-3/+3
| | | | | | | | | | | | | | | The cleanvar script uses find -delete to remove stale files under /var, which could lead to unwanted removal of files in some unusual scenarios. For example, when a mounted fdescfs(5) is present under /var/run/samba/fd, find(1) could descend into a directory that is out of /var/run and remove files that should not be removed. To mitigate this, modify the script to use find -x, which restricts the find scope to one file system only instead of descending into mounted file systems. PR: 269213 MFC after: 1 week
* rc: syscons: Add UEFI special caseEmmanuel Vadot2023-02-081-28/+55
| | | | | | | | | | Changing cursor, screenmap and setting blanktime doesn't work when booted with vt(4) and UEFI so add a special case for those depending on machdep.bootmethods. I have no way to test if this can work with vt(4) and bios boot so just in case keep calling those for this. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38293
* utx: Allow disabling user accountingEmmanuel Vadot2023-02-082-0/+2
| | | | | | | | Make it possible to not run utx at boot. Default to yes so this is a no-op for everyone. Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38292
* pkgbase: Create a FreeBSD-console-tools packageEmmanuel Vadot2023-02-081-2/+4
| | | | | | | | | | | | | | | And put in it: - kbdcontrol - vidcontrol - moused - kbdmap Those aren't useful in a jail or for a modern desktop. While here, split the devd.conf part into some new files. Reviewed by: bapt Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38321
* hyperv: Build and install where supportedWarner Losh2023-02-013-10/+5
| | | | | | | | | | Remove the hard-coded dependency on HYPERV being only x86. Instead, 100% rely on MK_HYPERV. It's always right (since it's marked BROKEN (so set to "no") on architectures we don't support). Sponsored by: Netflix Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D38306
* Revert "rc.d: Put growfs script in FreeBSD-ufs"Emmanuel Vadot2023-01-271-4/+2
| | | | | | | | The growfs script also support zfs. This reverts commit 36a7fa1e16a0b4446f2cb618fc84a6bc1a2cbf86. Reported by: emaste, Mina Galić
* rc.d: Put resolv script in FreeBSD-resolvconfEmmanuel Vadot2023-01-271-1/+4
| | | | Differential Revision: https://reviews.freebsd.org/D37190
* rc.d: Put growfs script in FreeBSD-ufsEmmanuel Vadot2023-01-271-2/+4
| | | | Differential Revision: https://reviews.freebsd.org/D37189
* rc.d: Put ggated script in FreeBSD-ggateEmmanuel Vadot2023-01-271-1/+4
| | | | Differential Revision: https://reviews.freebsd.org/D37188
* rc.d: Put dhclient script in FreeBSD-dhclientEmmanuel Vadot2023-01-271-1/+4
| | | | Differential Revision: https://reviews.freebsd.org/D37187
* rc.d: Put devmatch script in FreeBSD-devmatchEmmanuel Vadot2023-01-271-1/+4
| | | | Differential Revision: https://reviews.freebsd.org/D37192
* rc.d: Put devd script in FreeBSD-devd packageEmmanuel Vadot2023-01-271-1/+4
| | | | Differential Revision: https://reviews.freebsd.org/D37186
* rc.initdiskless: Fix a typo in a commentGordon Bergling2023-01-191-1/+1
| | | | | | - s/attemping/attempting/ MFC after:5 days
* dma: dma.conf.5 as MLINK to dma.8Ed Maste2023-01-061-0/+1
| | | | | | | | | | There's no separate man page for dma.conf, but the format is documented in dma.8. Reviewed by: bapt MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37944
* rtld: Revert "When loading dso without PT_GNU_STACK phdr, only call"John Baldwin2023-01-049-23/+2
| | | | | | | | | | | After the removal of ia64 and sparc64, all current architectures support executable stacks at an architectural level. This reverts commit 1290d38ac50b3afa7e5781d9d97346a1042c736c. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D37904
* growfs script: fix config-dependent errorsMike Karels2023-01-041-3/+3
| | | | | | | | | | | | | | - awk sometimes formatted swapbase as floating point, which gpart does not accept; force int. - Fix typo in code for checking vm.max_swap_pages. - While here, do not set kernel env if "gpart add" fails. - Add "gpart show" before modification to verbose output. Reported by: marklmi at yahoo dot com Tested by: marklmi at yahoo dot com
* network.subr: Fix infinite loopCy Schubert2023-01-021-0/+3
| | | | | | | | | | | | When setting up carp tunnel, using a password consisting of only the characters used as hexadecimal characters, i.e. abc-def, there will be an infinite loop in the shell function ifalias_af_common_handler(). To circumvent this we test for " pass ". PR: 268378 Reported by: jyoung15@gmail.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37748
* network.subr: Add missing braceCy Schubert2023-01-021-1/+1
| | | | | | | PR: 268378 Submitted by: jyoung15@gmail.com Reported by: jyoung15@gmail.com MFC after: 3 days
* network.subr: Replace "\ " with "[[:space:]]"Cy Schubert2023-01-021-20/+20
| | | | | | | | | "[[:space:]]" is easier to read than "\ " and is conisitent with clone_up(). Reported by: eugen MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D37748
* rc.subr: Minor formatting fix for ac102a2a6David E. O'Brien2022-12-291-2/+2
|
* atf_pytest_wrapper: fix pytest output truncationJose Luis Duran2022-12-281-27/+28
| | | | | | | | Pass `-vv` to pytest in order to always get the full output. While here, enforce the modeline. Differential Revision: https://reviews.freebsd.org/D37894 MFC after: 2 weeks
* growfs script: fixesMike Karels2022-12-262-1/+2
| | | | | | | Cannot use single quote in comment in awk script; add growfs_fstab to Makefile Fixes: 4a30d7bb373c,d670a8f7c596
* Add new rc: machine_id to generate /etc/machine-idTobias C. Berner2022-12-233-0/+38
| | | | | | | | | | | | | | | | | | | | | This new default-enabled rc will generate a /etc/machine-id file if it does not exist, and pre-fill it with a newly generated UUID of version 4 [2]. The file is generated in /var/db/machine-id and symlinked to /etc/machine-id to allow for read-only root partitions. This file is amongst other things used by libraries like GLib. Bump FreeBSD version 1400076 to be able to easily add support for older version of FreeBSD via a package. [1] Linux machine-id(5): https://www.man7.org/linux/man-pages/man5/machine-id.5.html [2] f176fe8e7f638e585afcd2f4dd52a522c4648f63 Approved by: bapt MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37722
* dma mailer.conf: add comments, including pointer for sendmailMike Karels2022-12-161-0/+5
| | | | | | | | Add comments analogous to those that are in the sendmail mailer.conf, including a pointer to /usr/share/examples/sendmail/mailer.conf. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D37711
* default rc.conf: Add new growfs_swap_size variableMike Karels2022-12-101-0/+2
| | | | | | | | Add new growfs_swap_size variable with a default value of the empty string, along with comments on other settings. Used by the growfs script. Differential Revision: https://reviews.freebsd.org/D37464
* growfs_fstab: add new /etc/rc.d script to add swap to fstabMike Karels2022-12-101-0/+67
| | | | | | | | | | | | | The growfs_fstab script is a helper for the growfs script to add any new swap partition to /etc/fstab on first boot. If growfs adds a swap partition, it sets growfs_swap_pdev in the kenv. In this case, after the root file system is read/write, if there is no swap partition in the fstab, growfs_fstab adds growfs_swap as a swap partition to the fstab. Also, it runs dumpon to add the swap partition (as this happened earlier in the startup sequence). Discussed with: cperciva Differential Revision: https://reviews.freebsd.org/D37463
* growfs script: add swap partition as well as growing rootMike Karels2022-12-101-6/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ability to create a swap partition in the course of growing the root file system on first boot, enabling by default. The default rules are: add swap if the disk is at least 15 GB (decimal), and the existing root is less than 40% of the disk. The default size is 10% of the disk, but is limited by the memory size. The limit is twice memory size up to 4 GB, 8 GB up to 8 GB memory, and memory size over 8 GB memory. Swap size is clamped at vm.swap_maxpages/2 as well. The new swap partition is labeled as "growfs_swap". The default behavior can be overridden by setting growfs_swap_size in /etc/rc.conf or in the kernel environment, with kenv taking priority. A value of 0 inhibits the addition of swap, an empty value specifies the default, and other values indicate a swap size in bytes. By default, addition of swap is inhibited if a swap partition is found in the output of the sysctl kern.geom.conftxt before the current root partition, usually meaning that there is another disk present. Swap space is not added if one is already present in /etc/fstab. The root partition is read-only when growfs runs, so /etc/fstab can not be modified. That step is handled by a new growfs_fstab script, added in a separate commit. Set the value "growfs_swap_pdev" in kenv to indicate that this should be done, as well as for internal use. There is optional verbose output meant for debugging; it can only be enabled by modifying the script (in two places, for sh and awk). This should be removed before release, after testing on -current. Discussed with: cperciva Reviewed by: imp (previous version) Differential Revision: https://reviews.freebsd.org/D37462
* dma(8): add newaliases to mailer.confBaptiste Daroussin2022-12-061-2/+3
| | | | | Reported by: karels MFC After: 3 days
* sendmail: revert to use use NONEBaptiste Daroussin2022-12-051-4/+4
| | | | | | | | The NONE parameter has been deprecated for more than 20 years but was never removed, its useful to simplify the sendmail management. This reverts commit 7cadc5263887374c50c3e3f500ef6fb7b7c3dd98.
* Explicitly set CXXSTD to c++11 for old C++ code using std::auto_ptr<>.John Baldwin2022-12-051-0/+1
| | | | | | | | | GCC 12 defaults to C++17 which removes (not just deprecates) std::auto_ptr<>. Trying to use CXXSTD of c++03 doesn't work with libc++ headers, but c++11 does. Reviewed by: brooks, imp, emaste Differential Revision: https://reviews.freebsd.org/D37531
* flua: chown(2) binding, fix bad copy/pasteBaptiste Daroussin2022-11-251-1/+1
|
* flua: add a chown(2) bindingBaptiste Daroussin2022-11-251-0/+59
| | | | | | | | | The main difference with the chown in luaposix, is that it checks and reports if a user or a group do exist when a string is passed as arguments Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D37479
* tftpd: Disable -Wformat-nonliteral for GCC.John Baldwin2022-11-221-0/+2
| | | | | | GCC warns about the non-literal format string passed to strftime(). A warning here seems a bit odd as strftime() does not take varargs so there is not a risk of missing args.