aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Use compat.linux.emul_path instead of hardcoded path in /etc/rc.d/linuxEdward Tomasz Napierala2021-02-021-5/+5
| | | | | | | | | | | In /etc/rc.d/linux the mounting paths of procfs, sysfs and devfs are hardcoded to "/compat/linux". Switching to the content of compat.linux.emul_path sysctl would allow to switch linuxulator to different place. Submitted by: freebsdnewbie_freenet.de Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27807
* rtld: Fix null-pointer dereferenceDavid Chisnall2021-02-021-2/+4
| | | | | | | | | | | When a library is opened via fdlopen, it has a null pointer for its path and so _rtld_bind can crash as a result of passing the null pointer to basename() (which passes it to strrchr(), which doesn't do a null check). PR: 253081 Submitted by: theraven MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28442
* stand: lua: enhance lfs.dir() to speed up kernels_autodetectKyle Evans2021-01-291-1/+27
| | | | | | | | | | | | | | | | This eliminates a lot of stat() calls that happen when lualoader renders the menu with the default settings, and greatly speeds up rendering on my laptop. ftype is nil if loader/loader.efi hasn't been updated yet, falling back to lfs.attributes() to test. This is technically incompatible with lfs, but not in a particularly terrible way. Reviewed-by: cem MFC-after: 4 days Differential Revision: https://reviews.freebsd.org/D27542
* rc.d/auditd: set pidfileAlex Richardson2021-01-281-0/+1
| | | | | | | | | auditd creates a pidfile so we should use it for status checks. This also seems to speed up the frequent onestatus checks used in tests/sys/audit. Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D28389
* Remove dependency on files in /usr/binStefan Eßer2021-01-191-5/+12
| | | | | | | | | | | | | | | | | | | | | In order to reduce the pre-requisites of this file, implement the pattern matching and creation of a temporary test directory without use of grep respectively mktemp. The new version makes it possible to provide a writable /tmp in any case and independently of other local or remote file systems (except / and /dev) being mounted. The use of "dd if=/dev/random" has the same dependency on /dev/random being operational as the previous version that used "mktemp". If this is found to be an issue on platforms that do not have gathered sufficient entropy at the time when this scriot is run, I suggest to replace the "dd" command with "ps lauxww" to get a somewhat random test directory name. Approved by: rgrimes, glebius, cy MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D28209
* bluetooth: remove support for bt3c(4)Marius Strobl2021-01-161-11/+0
| | | | The latter has been removed in 23e124c78bcb46ac78d9f06449c4454f43732805.
* Add 'tmp' to the list of FILESYSTEMS dependencies. Some scripts thatGleb Smirnoff2021-01-151-1/+1
| | | | | | | | | depend on FILESYSTEMS run mktemp(1). For systems that have read-only root this is broken until memory disk based /tmp is instantiated. At least 'os-release' and 'motd' are subject to this problem. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D28097
* Revert 97ec6eba653a07. There shouldn't be a dependency of 'tmp' onGleb Smirnoff2021-01-151-1/+1
| | | | | | | | | | remote filesystems. Discussed this with Brooks and he can't find evidence that provoked the change in 2005. If anything gets broken I will fix it in a different way, not via rc sequence change. Discussed with: brooks Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D28097
* Follow-up on 51da4b19be1. When booting a system with WITHOUT_IPFILTERGleb Smirnoff2021-01-112-1/+2
| | | | | | | | | the following warning printed at boot time: rcorder: requirement `ipfs' in file `/etc/rc.d/netif' has no providers. Close that using BEFORE rather than REQUIRE for writing down dependencies of optional components.
* Add missing rcvar name for os-release.Gleb Smirnoff2021-01-111-0/+1
|
* Retire obsolete a.out rtldEd Maste2021-01-074-493/+0
| | | | | | | This was disconnected from the build in 2001 in commit 66422f5b7a1a with a comment that it was long overdue even then. Sponsored by: The FreeBSD Foundation
* rtld: map without PROT_EXEC for relocationEd Maste2021-01-051-1/+2
| | | | | | | | | This makes text segment relocation work under W^X. Submitted by: Greg V <greg@unrelenting.technology> (original version) Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27953
* pkgbase: Put the last rc files in the rc packageEmmanuel Vadot2021-01-041-0/+2
| | | | | Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D27718
* pkgbase: Install atf and kyua in the tests packageEmmanuel Vadot2021-01-042-0/+3
| | | | | | | While here make sure that all tests dirs are taggued correctly. Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D27714
* rtld: call close(2) after errno is savedKonstantin Belousov2021-01-021-6/+11
| | | | | | | | | to prevent obliteration of error value from the original syscall. Also improve error message for short read. Submitted by: Konrad Sewiłło-Jopek MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27864
* rtld-elf: link libcompiler_rt on all architecturesRyan Libby2020-12-283-17/+8
| | | | | | | | | | | | | | | | | | | | | Statically link rtld-elf with libcompiler_rt on all architectures so that we don't need to try to pick and choose the bits we need from it for each architecture (we now leave that to the linker). Compilers may emit calls to support functions in this library, but because of the use of the linker flag -nostdlib for rtld's special needs, the library is not linked as normal. Previously we had two different solutions. On some architectures, we were able to extract reimplementations of the necessary builtin functions from our special build of libc. On ARM, we just linked libcompiler_rt. This is motivated by the same issue as D26199 and D27665, but should be a simpler solution that will apply to all architectures. Reviewed by: arichardson, kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27736
* Revert "rtld-elf: link udivmoddi4 from compiler_rt"Ryan Libby2020-12-281-6/+1
| | | | | | This reverts commit bce2cff0bc0ee3ab5b7a66c19920e7cfe3400f6f. Revert D27665 in favor of a more general fix coming in D27736.
* rtld-elf(1): remove obsolete pre_init() hookMarius Strobl2020-12-2510-55/+0
| | | | | It's no longer used since 600ee699ed2805894f5972c6ac2c3d17dca7f6ce and r358358 respectively.
* rtld-elf: link udivmoddi4 from compiler_rtRyan Libby2020-12-191-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the gcc9 build of rtld-elf32 on amd64, which needed an implementation of udivmoddi4. rtld-elf uses certain functions normally found in libc, and so it includes certain files from libc in its own build. It has two mechanisms to include files from libc: one that rebuilds source files in the rtld-elf environment, and one that extracts object files from a purpose-built no-SSP PIC archive. In addition to libc functions, rtld-elf may need to link functions normally found in libcompiler_rt (formerly libgcc). Now, add an ability to rebuild libcompiler_rt source files in the rtld-elf environment. We don't yet have a need for an object file extraction mechanism. libcompiler_rt could also supply udivdi3 and umoddi3, but leave them alone for now. Reviewed by: arichardson, kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27665 Notes: svn path=/head/; revision=368789
* rtld-libc: fix incremental buildRyan Libby2020-12-191-1/+2
| | | | | | | | | | | | | | ar cr is an update of an archive, not a creation of a new one. During incremental builds (e.g. with meta mode) the archive was not getting cleaned, and so could retain now-deleted objects from previous builds. Now, delete the archive before creating/updating it. Reviewed by: arichardson, bdrewery, kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27663 Notes: svn path=/head/; revision=368788
* Fix the ipfw service status output when ipfw.ko isn't loadedMark Johnston2020-12-181-1/+3
| | | | | | | | | | Reported by: lme Reviewed by: lme MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27657 Notes: svn path=/head/; revision=368762
* Make mountcritremote dependent upon nfscbd.Rick Macklem2020-12-171-1/+1
| | | | | | | | | | | | | | | | | Although it is not often needed, the nfscbd(8) should be running when NFSv4 mounts are done if callback functionality is required. Callback functionality is required for the NFSv4 server to issue delegations or pNFS layouts. This patch adds nfscbd to the mountcritremote's REQUIRED line to ensure it is started before NFS mounts specified in /etc/fstab are done. Reviewed by: 0mp Differential Revision: https://reviews.freebsd.org/D27506 Notes: svn path=/head/; revision=368710
* When receiving a file having a length, which is a mulitple of the blocksize,Michael Tuexen2020-12-151-2/+2
| | | | | | | | | | close the file once it is received. Reported by: Timo Voelker MFC after: 1 week Notes: svn path=/head/; revision=368657
* Improve the counting of blocks used to transfer a file from theMichael Tuexen2020-12-141-1/+1
| | | | | | | | | | server to the client in case of not using an OACK: Don't miss the first block in case of it is not also the last one. MFC after: 1 week Notes: svn path=/head/; revision=368647
* Fix the TFTP client when performing a RRQ for files smaller than 512 bytesMichael Tuexen2020-12-101-0/+2
| | | | | | | | | | | and the server not sending an OACK: * Close the file. * Report the correct the number of received blocks. MFC after: 1 week Notes: svn path=/head/; revision=368521
* When dropping packets (RRQ or WRQ) for debugging, report the sendMichael Tuexen2020-12-061-2/+2
| | | | | | | | | | operation as successful. Reporting a failure stops the transfer instead of using timeouts. MFC after: 1 week Notes: svn path=/head/; revision=368394
* Add CFI start/end proc directives to arm64, i386, and ppcConrad Meyer2020-12-053-9/+8
| | | | | | | | | | | | | | Follow-up to r353959 and r368070: do the same for other architectures. arm32 already seems to use its own .fnstart/.fnend directives, which appear to be ARM-specific variants of the same thing. Likewise, MIPS uses .frame directives. Reviewed by: arichardson Differential Revision: https://reviews.freebsd.org/D27387 Notes: svn path=/head/; revision=368354
* Revert r366857.Cy Schubert2020-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | r366857 created a number of problems, tearing down interfaces too early in shutdown. This resulted in: - hung ssh sessions when shutting down or rebooting remotely using shutdown (I've used exec shutdown, for years, as apposed to simply shutdown). - NFS mounted filesystems "disappear" prior to unmount. - dhclient attached to a VLAN on an interface who's parent interface has already shut down prints errors. The path forward is to teach lagg(4) and vlan(4) about WOL. PR: 251531, 251540 PR: 158734, 109980 are broken again Reported by: jhb, emaste, jtl, Helge Oldach<freebsd_oldach.net> Martin Birgmeier <d8zNeCFG_aon.at> MFC after: Immediately Discussion at: https://reviews.freebsd.org/D27459 Notes: svn path=/head/; revision=368345
* rtld: bump r_debug.r_version to 1 from current 0.Konstantin Belousov2020-12-011-0/+2
| | | | | | | | | | | | Add r_ldbase. Requested and reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D27429 Notes: svn path=/head/; revision=368260
* IPv6: set ifdisabled in the kernel rather than in rcBjoern A. Zeeb2020-11-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | Enable ND6_IFF_IFDISABLED when the interface is created in the kernel before return to user space. This avoids a race when an interface is create by a program which also calls ifconfig IF inet6 -ifdisabled and races with the devd -> /etc/pccard_ether -> .. netif start IF -> ifdisabled calls (the devd/rc framework disabling IPv6 again after the program had enabled it already). In case the global net.inet6.ip6.accept_rtadv was turned on, we also default to enabling IPv6 on the interfaces, rather than disabling them. PR: 248172 Reported by: Gert Doering (gert greenie.muc.de) Reviewed by: glebius (, phk) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27324 Notes: svn path=/head/; revision=368031
* Revert r367291 (KEYWORD: shutdown for rc.d/zfs)Mateusz Piotrowski2020-11-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that zfs is asked to stop too early in the shutdown sequence. Other services, such as syslog may still be running and have some files open (e.g., under /var/log). This of course causes the messages like: cannot unmount '/var/run': umount failed cannot unmount '/var/log': umount failed cannot unmount '/var': umount failed cannot unmount '/usr/home': umount failed cannot unmount '/usr': umount failed cannot unmount '/': umount failed For now, let's remove the shutdown KEYWORD from the zfs service, as people are reporting problems in their setups: https://lists.freebsd.org/pipermail/freebsd-current/2020-November/077559.html In the future, we may think of stopping zfs on shutdown after all the other services and just before init(8) exits. Another interesting option might be to a new rcorder(8) KEYWORD like "shutdownjail", but this idea would need to be discussed a bit. Reported by: Johan Hendriks <joh.hendriks gmail.com> Reported by: Yasuhiro KIMURA <yasu utahime.org> Reported by: Tomoaki AOKI <junchoon dec.sakura.ne.jp> Approved by: kevans (src) MFC: 3 days Differential Revision: https://reviews.freebsd.org/D27263 Notes: svn path=/head/; revision=367893
* Fix startup of gssd when /usr is a separately mounted local file system.Rick Macklem2020-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | meowthink@gmail.com reported that the gssd daemon was not starting, because /etc/rc.d/gssd was executed before his local /usr file system was mounted. He fixed the problem by adding mountcritlocal to the REQUIRED line. This fix seems safe and works for a separately mounted /usr file system on a local disk. The case of a separately mounted remote /usr file system (such as NFS) is still broken, but there is no obvious solution for that. Adding mountcritremote would fix the problem, but it would cause a POLA violation, because all kerberized NFS mounts in /etc/fstab would need the "late" option specified to work. Submitted by: meowthink@gmail.com Reported by: meowthink@gmail.com Reviewed by: 0mp MFC after: 2 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27203 Notes: svn path=/head/; revision=367660
* Add support for the new mountd -R option.Rick Macklem2020-11-063-6/+30
| | | | | | | | | | | | | | | | | | | | r376026 added a new "-R" option to mountd, which tells it to not support the Mount protocol (not used by NFSv4) and not register with rpcbind. Rpcbind is considered a security issue by some sites now. This patch adds a new yes/no variable called nfsv4_server_only. When that is set, make vfs.nfsd.server_min_vers=4 and set "=R" for mountd. Setting vfs.nfsd.server_min_vers=4 tells nfsd to not register with rpcbind. While here, add a check for "load_kld nfsd" failing to nfsd. Reviewed by: 0mp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26938 Notes: svn path=/head/; revision=367423
* Replace literal uses of /usr/local with a variableStefan Eßer2020-11-032-7/+12
| | | | | | | | | | | | | | | | | | The variable defaults to "/usr/local", unless sysctl returns some other value for "user.localbase". The value of user.localbase defaults to _PATH_LOCALBASE as defined in paths.h and thus this commit has no immediate effect. The purpose of this change is to make /etc/defaults/rc.conf automatically use the value of _PATH_LOCALBASE when not set to the default value. Reviewed by: imp, scottl MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27014 Notes: svn path=/head/; revision=367294
* rc.d/zfs: Add shutdown to KEYWORDSMateusz Piotrowski2020-11-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that Without walling /etc/rc.d/zfs on shutdown, resources associated with ZFS mounts are not freed and the jails will remain in dying state. In addition, the dataset is now in a dangling state, as the jail it is attached to is dying. A known workaround for jails was to add the following lines to /etc/jail.conf, to make sure that "service zfs stop" is run when the jail is stopped: exec.stop = "/bin/sh /etc/rc.shutdown"; exec.stop += "/usr/sbin/service zfs stop || /usr/bin/true"; While the workaround seems to be okay-ish for the jail situation, it is still unclean. However, for physical hosts this may wreak havoc with the pool if shared spares are used, as "zfs unshare" is never invoked on shutdown. PR: 147444 Submitted by: Markus Stoff <markus__stoffdv_at> Reported by: Mykah <mburkhardt__exavault_com> Reviewed by: cy Approved by: cy (src) MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27039 Notes: svn path=/head/; revision=367291
* rc.d/syscons: remove spaces before tabEd Maste2020-10-251-1/+1
| | | | Notes: svn path=/head/; revision=367043
* Destroy cloned interfaces at netif stop, netif restart and shutdown.Cy Schubert2020-10-191-1/+1
| | | | | | | | | | | | | | | | This is especially important during shutdown because a child interface of lagg with WOL enabled will not enable WOL at interface shutdown and thus no WOL to wake up the device (and machine). PR: 158734, 109980 Reported by: Antonio Huete Jimenez <tuxillo at quantumachine.net> Marat N.Afanasyev <marat at zealot.ksu.ru> reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26797 Notes: svn path=/head/; revision=366857
* Fix a few mandoc issuesGordon Bergling2020-10-091-1/+1
| | | | | | | | | | | | - whitespace at end of input line - skipping paragraph macro: Pp at the end of Sh - new sentence, new line - consider using OS macro: Fx - AUTHORS section without An macro - skipping paragraph macro: Pp before Ss Notes: svn path=/head/; revision=366575
* [pf] /etc/rc.d/pf should REQUIRE routingPawel Biernacki2020-10-081-2/+1
| | | | | | | | | | | | | | | | | | | | | When a system with pf_enable="YES" in /etc/rc.conf uses hostnames in /etc/pf.conf, these hostnames cannot be resolved via external nameservers because the default route is not yet set. This results in an empty (all open) ruleset. Since r195026 already put netif back to REQUIRE, this change does not affect the issue that the firewall should rather have been setup before any network traffic can occur. PR: 211928 Submitted by: Robert Schulze Reported by: Robert Schulze Tested by: Mateusz Kwiatkowski No objections from: kp MFC after: 3 days Notes: svn path=/head/; revision=366537
* Do a sweep and remove most WARNS=6 settingsKyle Evans2020-10-015-5/+0
| | | | | | | | | | | | | | | Repeating the default WARNS here makes it slightly more difficult to experiment with default WARNS changes, e.g. if we did something absolutely bananas and introduced a WARNS=7 and wanted to try lifting the default to that. Drop most of them; there is one in the blake2 kernel module, but I suspect it should be dropped -- the default WARNS in the rest of the build doesn't currently apply to kernel modules, and I haven't put too much thought into whether it makes sense to make it so. Notes: svn path=/head/; revision=366304
* [PowerPC64LE] Use a shared LIBC_ARCH for powerpc64le.Brandon Bergren2020-09-232-4/+4
| | | | | | | | | | | | | | | Given that we have converted to ELFv2 for BE already, endianness is the only difference between the two ARCHs. As such, there is no need to differentiate LIBC_ARCH between the two. Combining them like this lets us avoid needing to have two copies of several bits for no good reason. Sponsored by: Tag1 Consulting, Inc. Notes: svn path=/head/; revision=366039
* ftpd: Add missing braces around a statfd checkMark Johnston2020-09-221-1/+2
| | | | | | | | | | This was harmless but looked incorrect. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=366003
* tftpd: Check for errors from chdir()Mark Johnston2020-09-221-1/+4
| | | | | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=366002
* loader: zfs should support bootonce an nextbootToomas Soome2020-09-212-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bootonce feature is temporary, one time boot, activated by "bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag. By default, the bootonce setting is reset on attempt to boot and the next boot will use previously active BE. By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will be set permanently active. bootonce dataset name is recorded in boot pool labels, bootenv area. in case of nextboot, the nextboot_enable boolean variable is recorded in freebsd:nvstore nvlist, also stored in boot pool label bootenv area. On boot, the loader will process /boot/nextboot.conf if nextboot_enable is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf processing on next boot. bootonce and nextboot features are usable in both UEFI and BIOS boot. To use bootonce/nextboot features, the boot loader needs to be updated on disk; if loader.efi is stored on ESP, then ESP needs to be updated and for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated (gpart or other tools). At this time, only lua loader is updated. Sponsored by: Netflix, Klara Inc. Differential Revision: https://reviews.freebsd.org/D25512 Notes: svn path=/head/; revision=365938
* ftpd: Exit during authentication if an error occurs after chroot().Mark Johnston2020-09-151-4/+11
| | | | | | | | admbug: 969 Security: CVE-2020-7468 Notes: svn path=/head/; revision=365771
* Only set WARNS if not definedKyle Evans2020-09-112-2/+2
| | | | | | | | | | | | | This would allow interested parties to do experimental runs with an environment set appropriately to raise all the warnings throughout the build; e.g. env WARNS=6 NO_WERROR=yes buildworld. Not currently touching the numerous instances in ^/tools. MFC after: 1 week Notes: svn path=/head/; revision=365631
* phttpget: move out of portsnapKyle Evans2020-09-095-0/+847
| | | | | | | | | | | | | | | | | | | | Currently, WITHOUT_PORTSNAP forces WITHOUT_FREEBSD_UPDATE because the latter relies on phttpget, which lives inside the portsnap build bits. Remove the dependency between these two options by moving phttpget out into ^/libexec and building/installing it if either WITH_PORTSNAP or WITH_FREEBSD_UPDATE. Future work could remove the conditional if it's decided that users will use it independently of either the current in-base consumers. Reported by: swills Reviewed by: jilles, emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26255 Notes: svn path=/head/; revision=365490
* rtld: pass argc/argv/env to dso inits.Konstantin Belousov2020-09-071-1/+1
| | | | | | | | | | | | | | | This is consistent with how array inits are called, and also makes us more compatible with glibc environment. Requested by: Alex S <iwtcex@gmail.com> PR: 249162 Reviewed by: dim, emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26351 Notes: svn path=/head/; revision=365432
* Undo 'fix off by one' part of r365360.Konstantin Belousov2020-09-051-1/+1
| | | | | | | | | Noted by: emaste Sponsored by: The FreeBSD Foundation MFC after: 6 days Notes: svn path=/head/; revision=365370
* rtld: do not refuse to relocate objects without dynamic symtabs.Konstantin Belousov2020-09-051-5/+2
| | | | | | | | | | | | | Such objects can still have valid relocations not requiring symbolic references. PR: 249121 Reported by: wsh@riski.sh Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=365369