aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
...
* tftp: Use printf0 attribute for options_set_request/reply.John Baldwin2022-11-221-2/+2
| | | | | | | These functions accept a NULL format argument so should use the printf0 attribute rather than plain printf. Reported by: GCC -Wformat
* Add dnctl rc.d serviceGoran Mekic2022-11-223-1/+32
| | | | | | | | As PF now also supports dummynet but can not configure it on its own, the service which configures pipes, queues and schedulers is needed. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D37451
* tftpd: type nitDag-Erling Smørgrav2022-11-181-1/+1
| | | | Sponsored by: Klara, Inc.
* tftpd: Plug memory leaks in option handling code.Dag-Erling Smørgrav2022-11-183-14/+72
| | | | | Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37423
* tftpd: whitespace cleanupDag-Erling Smørgrav2022-11-1711-62/+62
|
* tftpd: cleanupDag-Erling Smørgrav2022-11-156-9/+11
| | | | Sponsored by: Klara, Inc.
* othermta: remove leftover from 20 years agoBaptiste Daroussin2022-11-143-24/+0
| | | | | | | | othermta (along with mta_start_script configuration entry in rc.conf) was a mechanism used to be able to run another mta than sendmail(8) before "rcng" time 20 years ago. othermta has not been used since.
* rtld: add support for the $LIB tokenKonstantin Belousov2022-11-113-1/+16
| | | | | | | | | similar to the same token in glibc. Requested and reviewed by: bapt Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D37329
* rc.sendmail: remove unused scriptBaptiste Daroussin2022-11-093-281/+1
| | | | | | | | 20 years ago the use of rc.sendmail script was dropped in favor of /etc/rc.d/sendmail, it is time to retire the script entirely now. MFC after: 1 week
* sendmail: Add back a comment about "NONE"Jose Luis Duran2022-11-091-0/+1
| | | | Differential Revision: https://reviews.freebsd.org/D37315
* sendmail: do not use NONEBaptiste Daroussin2022-11-091-4/+4
| | | | | NONE is deprecated, instead of using NONE, switch to "NO" all the sendmail_*_enable which sendmail_enable=NONE would have done
* sendmail: document that sendmail_enable can be set to NONEBaptiste Daroussin2022-11-081-1/+1
| | | | | | | setting sendmail_enable to NONE (which is now the default) turns all the sendmail_*_enable variables to NO Reported by: many
* mail: make The Dragonfly Mail Agent (dma) the default mta.Baptiste Daroussin2022-11-072-6/+1
| | | | | | | | | | | | | | | | | | | dma accepts mail from a local Mail User Agent (MUA) and delivers it locally or to a smarthost for delivery. dma does not accept inbound mail (i.e., it does not listen on port 25) and is not intended to provide the same functionality as a full MTA like postfix or sendmail. It is intended for use cases such as delivering cron(8) mail. which is the default configuration and usage of sendmail in the default setup of the base system. In order to switch the default from sendmail to dma, we teach mailwrapper to fallback on dma directly if the mailer.conf file cannot be opened. We install by default a mailer.conf file which points at dma We install a mailer.conf file for sendmail in the examples. Relnotes: yes Differential Revision: https://reviews.freebsd.org/D37035
* rc(8): Add a zpoolupgrade rc.d scriptLi-Wen Hsu2022-11-073-0/+28
| | | | | | | | | | | If a zpool is created by makefs(8), its version is 5000, i.e., all feature flags are off. Introduce an rc script to run `zpool upgrade` over the assigned zpools on the first boot. This is useful to the ZFS based VM images built from release(7). Reviewed by: imp, markj, mav Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37282
* getty: Avoid NULL deref if stdin is not a tty.Dag-Erling Smørgrav2022-11-041-3/+8
| | | | | | Sponsored by: Klara, Inc. Obtained from: Apple OSS Distributions Differential Revision: https://reviews.freebsd.org/D37265
* getty: code cleanup, part 2Dag-Erling Smørgrav2022-11-044-79/+79
| | | | | | | * Clean up whitespace * Reindent Sponsored by: Klara, Inc.
* getty: code cleanup, part 1Dag-Erling Smørgrav2022-11-045-26/+26
| | | | | | | | | | | | * Avoid unnecessary use of `unsigned char *` * Use explicit casts when assigning `unsigned char *` to `char *` or vice versa * Drop unused global variables (and fix memory leak in `gettable()`) * Use `snprintf()` instead of `strcpy()` + `strcat()` * Drop spurious braces in switch Sponsored by: Klara, Inc. Obtained from: Apple OSS Distributions (in part) Differential Revision: https://reviews.freebsd.org/D37263
* rtld: remove unused macro FPTR_TARGETKonstantin Belousov2022-10-221-4/+0
| | | | | | | It is a remnant from the ia64 removal Sponsored by: The FreeBSD Foundation MFC after: 3 days
* rtld: fix typo in commentKonstantin Belousov2022-10-171-1/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days
* Put OPIE to rest.Dag-Erling Smørgrav2022-10-024-45/+5
| | | | Differential Revision: https://reviews.freebsd.org/D36592
* manpages: Remove telnetd referencesBrooks Davis2022-09-291-3/+2
| | | | | | | | | | Mostly remove from the SEE ALSO section, adding a mention of the port where not removed. Elsewhere, remove as appropriate and change from .Xr to .Nm where a mention of telnetd continues to make sense (or removing it would require significant reworking of the surrounding text). Reviewed by: imp, delphij, emaste Differential Revision: https://reviews.freebsd.org/D36785
* Remove telnetdBrooks Davis2022-09-284-81/+0
| | | | | | | | | | | | | | The telnetd codebase is unmaintained and has a number of quality issues. Telnet has been largely supplanted by ssh. If needed, a port is available (net/freebsd-telnetd), but a more maintained implementation should be prefered. While the telnet client suffers from the same issues, it is deemed to be of lower risk and is required to connect to legacy devices, so it remains. Reviewed by: emaste, imp Differential Revision: https://reviews.freebsd.org/D36620
* ldd: remove '[preloaded]' marker for the preloaded objectsKonstantin Belousov2022-09-221-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | for the default output. For '-a' (per-object needed printout) the [preloaded] banner is kept. Instead, use special format2 for printing the preloaded objects (and vdso), which does not include DT_NEEDED, since there is no object needing the printed one. In this way, the output is more compatible with glibc. Example: LD_PRELOAD=/lib/libthr.so.3 LD_TRACE_LOADED_OBJECTS=1 /libexec/ld-elf.so.1 /bin/ls libutil.so.9 => /lib/libutil.so.9 (0x801099000) libncursesw.so.9 => /lib/libncursesw.so.9 (0x8010b0000) libc.so.7 => /lib/libc.so.7 (0x801123000) [vdso] (0x7ffffffff000) /lib/libthr.so.3 (0x80106c000) Note the absense of the part before and including '=>' for preloaded libthr.so.3, and for vdso. PR: 265750 Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D36616
* rc.d/var_run: Add needed "shutdown" keywordCy Schubert2022-09-201-0/+1
| | | | | | | | | | The "shutdown" keyword invokes rcorder with the -k flag, for rc scripts with the keyword at shutdown. Reported by: bdrewery Fixes: 27b9777c28b4 MFC after: 3 days Differential Revision:
* rtld-elf/libmap.c: correct commentKonstantin Belousov2022-09-181-2/+2
| | | | | | | There is no intent to support TLS for rtld. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* rtld-elf/libmap.h: style declarationsKonstantin Belousov2022-09-181-3/+3
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* rtld-elf/libmap.h: add include guardKonstantin Belousov2022-09-181-0/+5
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* rtld: teach LD_SHOW_AUXV about AT_USRSTACK*Konstantin Belousov2022-09-161-0/+2
| | | | | | | | Reviewed by: brooks, imp (previous version) Discussed with: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36540
* bootptest: Fix a typo in a source code commentGordon Bergling2022-09-151-1/+1
| | | | | | - s/avaible/available/ MFC after: 3 days
* libexec/rc: Add var_run rc scriptCy Schubert2022-09-053-0/+54
| | | | | | | | | | | | | | | | | | Users with a tmpfs /var/run will lose the directory tree state of /var/run at reboot. This rc script will optionally (by default) capture the state of the directory structure in /var/run prior to shutdown and recreate it at system boot. Alternatively a user can save the state of the /var/run directories manually using service var_run save and disable the autosaving of /var/run state using the var_run_autosave variable, for those paranoid SSD users. PR: 259585, 259699 Reported by: freebsd@walstatt-de.de, Reviewed by: philip, gbe (previous version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36386
* ntpd(8): Correct a typo in comment of the rc scriptGordon Bergling2022-09-041-1/+1
| | | | | | - s/the the/the/ MFC after: 3 days
* rtld.c: remove extra blank lineKonstantin Belousov2022-09-041-1/+0
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36396
* rtld: style the rest of rtld_lock.cKonstantin Belousov2022-09-041-30/+31
| | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36396
* rtld: mask signals for default read locksKonstantin Belousov2022-09-041-24/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rtld locks from libthr defer signals delivery, which means that binding is not possible while a signal handler is executed. Binding might upgrade read-locked rtld_bind_lock to write-lock, if symbol resolution requires loading filters. If a signal would be delivered while rtld is in read-locked section, and signal handler needs binding which upgrades the lock, for non-threaded image that uses default rtld locks, we get the rtld data structures modified under the top-level active rtld frame. To correct the problem, mask signals for read-locking of default locks in addition to the write-locking. It is very cheap now with sigfastblock(2). Note that the global state is used to track pre-locked state of either sigfastblock(2) or signal mask (if sigfastblock(2) is administratively disabled). It is fine for non-threaded images since there are no other threads. But I believe that it is fine for threaded images using libc_r as well, since masking signals disables preemption (I did not tested it). NetBSD PR: https://gnats.netbsd.org/56979 Reported by: tmunro Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D36396
* rtld(1): Fix a typo in a source code commentGordon Bergling2022-09-031-1/+1
| | | | | | - s/interger/integer/ MFC after: 3 days
* rc.conf: Fix a typo in a commentGordon Bergling2022-09-031-1/+1
| | | | | | - s/overriden/overridden/ MFC after: 3 days
* local_unbound: rc: allow to overwrite pid file pathBjoern A. Zeeb2022-09-011-0/+2
| | | | | | | | | Certain configurations need to use a different path for pidfile. Allow rc.conf to overwrite it. Reviewed by: cy, 0mp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D36141
* rc.conf(5): add <service>_umask to run the service using this valueEugene Grosbein2022-08-281-1/+9
| | | | | | | | | | | None of tools working with login classes change umask(1) and we had no ways to specify non-default umask for a service not touching its startup script. This change makes in possible. Some file-sharing services that create new files may benefit from it. Differential: https://reviews.freebsd.org/D36309 MFC-after: 3 days
* rc: add ${name}_setup script supportFranco Fichtner2022-08-151-3/+11
| | | | | | | Run a service-based setup script before running the start command. Useful for automatic configuration file generation. Reviewed by: https://reviews.freebsd.org/D36006
* rtld: fix display of the mapbase for the traced objectsKonstantin Belousov2022-08-141-1/+1
| | | | | | | | | | | | | | | | | | | Commit 24d0c9c1f565bab6e introduced the following regression: % ldd /bin/ls /bin/ls: libutil.so.9 => /lib/libutil.so.9 (0x1021000) libncursesw.so.9 => /lib/libncursesw.so.9 (0x1021000) libc.so.7 => /lib/libc.so.7 (0x1021000) Note that the base address is the same for all displayed libraries. Fix it by passing correct object to trace_print_obj(). Fixes: 24d0c9c1f565bab6e Reviewed by: jrtc27 MFC after: 3 days Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D36198
* rc.d/hostid: Skip warning on systems w/o smbiosColin Percival2022-08-131-1/+10
| | | | | | | | | | | | | | | | | | | | | The first time a FreeBSD system boots, it obtains a hostuuid and hostid from the smbios.system.uuid kernel environment variable. If this value is found to be invalid, a warning is printed and the boot pauses for two seconds to give the user a chance to read it. If the FreeBSD kernel is launched directly in a virtual machine rather than via the FreeBSD boot loader, the smbios.system.uuid environment variable might not be set; in this case, there's no need to alert the user and delay the boot process since the lack of a "hardware" uuid is entirely expected. Distinguish between the cases of "invalid UUID" and "no UUID", warning and delaying the boot only in the former case. In both cases we still generate a random UUID in software. Reviewed by: delphij Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D36185
* rc: Start testing the rc(8) framework (beginning with *_oomprotect)Mateusz Piotrowski2022-07-263-0/+109
| | | | | | | | | | | | | This change adds 2 tests to make sure that the *_oomprotect variable sets the protection against OOM killer properly within rc(8) scripts. This is also adding the first tests for the rc(8) framework. More tests will be added as we go. PR: 256148 Approved by: des MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35745
* rtld-elf: Fix leaks and wild frees in origin_substJessica Clarke2022-07-121-1/+1
| | | | | | | | | | | | | | | | | 55abf23dd36b inverted the value passed to origin_subst_one when rolling up the existing code into a loop. If the first token is found ($ORIGIN), this results in a wild free of part of strtab. Processing the second token works fine and will act how the first should have regardless of whether found, allocating memory for the string without freeing. Processing subsequent tokens however will then leak, regardless of whether found, as they will also believe they need to allocate memory and can't free the string. Found by: CHERI Reviewed by: kib, markj Fixes: 55abf23dd36b ("rtld: make token substitution table-driven") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D35792
* rc.subr: Fix a typoMateusz Piotrowski2022-07-081-1/+1
| | | | MFC after: 3 days
* rc.subr: Make sure oomprotect protects existing childrenMike Walker2022-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | The rc(8) framework support protecting services from OOM killer. The current implementation applies the protection after the service has already started. This works fine if only the main process is to be protected (*_oomprotect=yes). However, the current implementation fails to protect existing children when children are also to be protected (*_oomprotect=all). This patch fixes that. Note: it is not easy to apply the protectoin earlier because we want to support both the services which use the "command" variable and those that use the "start_cmd" variable. PR: 256148 Approved by: adrian, osogbo Tested by: Jamie Landeg-Jones <jamie@catflap.org> Fixes: 3bead71e959d - Add a global option where we can protect MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D35747
* testing: provide meaningful error when pytest is not availableAlexander V. Chernikov2022-07-061-3/+20
| | | | | | | | | atf format does not provide any way of signalling any error message back to the atf runner when listing tests. Work this around by reporting "__test_cases_list_pytest_binary_not_found__" test instead. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D35721
* mountd startup: enable NFSv4 if needed on restartMike Karels2022-07-041-1/+3
| | | | | | | | | | | The mountd script in rc.d sets vfs.nfsd.server_max_nfsvers correctly when it is run at system startup, relying on the kernel default. However, if NFSv4 was enabled in /etc/rc.conf later, and the script was re-run to restart mountd, the sysctl was still set to 3. Set the sysctl to the right value in all cases. Reviewed by: rmacklem MFC after: 1 week
* ftp: Use /var/spool/ftp as ftp's home consistentlyMateusz Piotrowski2022-06-281-2/+5
| | | | | | | The home directory of the ftp user is /var/spool/ftp according to hier(7). Update the manual page of ftpd(8) to reflect that. MFC after: 2 weeks
* testing: pass ATF vars to pytest via env instead of arguments.Alexander V. Chernikov2022-06-281-7/+22
| | | | | | | | | | | | | | This change is a continuation of 9c42645a1e4d workaround. Apparently pytest argument parser is not happy when parsing values with spaces or just more than one --atf-var argument. Switch wrapper to send these kv pairs as env variables. Specifically, use _ATF_VAR_key=value format to distinguish from the other vars. Add the `atf_vars` fixture returning all passed kv pairs as a dict. Reviewed by: lwhsu Differential Revision: https://reviews.freebsd.org/D35625 MFC after: 2 weeks
* testing: workaround pytest parser bug in pytest-atf-wrapper.Alexander V. Chernikov2022-06-271-4/+6
| | | | | | Reviewed by: lwhsu, kp Differential Revision: https://reviews.freebsd.org/D35614 MFC after: 2 weeks