aboutsummaryrefslogtreecommitdiff
path: root/libexec
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-1556-56/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* rtld-elf: Fix signed conversion for %hhWarner Losh2024-07-141-1/+1
| | | | | | | | | | | | | | While char is signed on some of FreeBSD's architecutres, it's unsigned on others. So the naked 'char' cast here needs to be 'signed char' because in this context, we want the signed interpretation. We don't really use %hh conversions in the run time linker, so this is likely a nop. However, for correctness, we need this, like we did in the kernel in fc3e5334ab89. It's a nop on x86 and riscv due to defaults as well, but does fix a bug on arm and powerpc where char is unsigned. Suggested by: kib Sponsored by: Netflix
* tftpd: Code cleanup.Dag-Erling Smørgrav2024-07-051-50/+41
| | | | | | | MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45871
* man filesystems: fix more xrefs after move to s4Alexander Ziaee2024-06-281-1/+1
| | | | | | Fixes: 1a720cbec513 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1282
* nuageinit: check for both user_data and user-dataBaptiste Daroussin2024-06-272-4/+57
| | | | | | | | openstack, ec2 and other implementation of cloudinit disagrees on the name of the file "user-data" or "user_data", test both and use the first found PR: 279876
* rc.subr: improve description for ${name}_offcmdEugene Grosbein2024-06-181-1/+2
| | | | | | Clarify that ${name}_offcmd is for method start. MFC after: 3 days
* rc.subr: add some sanity checks for service jailsAlexander Leidinger2024-06-141-5/+34
| | | | | | | | | | Add some sanity checks when service jails are used in jails: - children.max > 0 - children.max - children.cur > 0 The nesting is too deep at those places to have a sane formatting, so no line wrapping at the usual column. If someone has a better idea how to format this: feel free to go ahead.
* rc.subr: add new sysv option for service jailsAlexander Leidinger2024-06-141-0/+11
| | | | | | | Clarify that the "sysvipc" svcj option inherits from the host / parent. Add "sysvipcnew" which creates a new SysV namespace for the service jail. Sanity check that only one of them is used.
* rtld-elf: Use a proper struct type for tlsdesc entriesJessica Clarke2024-06-051-14/+23
| | | | | | | | | | This clarifies the code and makes it less error-prone. It also makes it easier to extend downstream in CheriBSD (where pointer and integer members no longer have the same representation and an additional member is present). Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D45143
* nuageinit: fix authorized_key testBaptiste Daroussin2024-06-051-7/+7
| | | | | | | | After miss reading the cloudinit spec I ended up writting a wrong test for basic ssh key setup, nuageinit has been fixed, but not the test, here is the actual fix. Reported by: markj
* nuageinit: make addsshkey friendly for testsuiteBaptiste Daroussin2024-06-051-0/+4
|
* nuageinit: use pw(8) instead of getent(1)Baptiste Daroussin2024-06-051-6/+14
| | | | | | | pw(8) allows to seek for users in a custom rootdir, which makes it easier for a testsuite MFC After: 3 days
* rc.subr(8): fix debugging message after previous commitEugene Grosbein2024-06-021-1/+1
| | | | Fixes: 32a579e4fc69a65e8901111ad5f65ec56a97dfab
* rc.subr(8): introduce ${name}_offcmdEugene Grosbein2024-06-022-8/+24
| | | | | | | | | | | | | | New variable ${name}_offcmd may be used to supply commands executed if named service is not enabled. Previously start_precmd could be used for such a task but now rc.subr(8) does not call it if a service is not enabled. Fix devd startup script to use it instead of start_precmd. PR: 279198 MFC after: 2 weeks Reported by: Dmitry S. Lukhtionov Tested by: Dmitry S. Lukhtionov
* export $autoboot var when running from $boottrace_cmdAlex Samorukov2024-05-291-1/+2
| | | | | | | | | | | At the moment, if bootrace profiling is enabled, autoboot is not exported to the rc scripts. This causes fsck to not check the root filesystem. To fix this, pass _boot, rc_fast and autoboot to the boottrace process to mimic what diretly sourcing the rc.d scripts. PR: 278993 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1261
* rc: improve NAME_setup handlingFranco Fichtner2024-05-291-25/+48
| | | | | | | | | | | | | | | | | | | | | | | | | Reload is used for service reconfiguration as well and lacks a NAME_prepend-like mechanism so it makes sense to extend the NAME_reload hook into this action. precmd may use configuration checks and blocks setup from doing its designated work (e.g. nginx). In moving the invoke of the setup script in front allows us to provide custom scripts for config file generation and fixing prior to precmd checking configuration integrity. Also introduce _run_rc_setup to separate the launcher from the main one. Let it run correctly in the case of restart_precmd and block further execution as would be the case in start due to the internal plumbing of restart being split into calling stop and start afterwards. Differential-Revsiion: https://reviews.freebsd.org/D36259 Signed-off-by: Franco Fichtner <franco@opnsense.org> Reviewed by: imp, oshogbo Pull Request: https://github.com/freebsd/freebsd-src/pull/1258
* rc.d: add a service jails config to all base system servicesAlexander Leidinger2024-05-22166-39/+598
| | | | | | | | | | | | | | | | | | | This gives more permissions to services (e.g. network access to services which require this) when they are started as an automatic service jail. The sshd patch is important for the sshd-related functionality as described in the man-page in the service jails part. The location of the added env vars is supposed to allow overriding them in rc.conf, and to hard-disable the use of svcj for some parts where it doesn't make sense or will not work. Only a subset of all of the services are fully tested (I'm running this since more than a year with various services started as service jails). The untested parts should be most of the time ok, in some edge-cases more permissions are needed inside the service jail. Differential Revision: https://reviews.freebsd.org/D40371
* rc: add service jails frameworkAlexander Leidinger2024-05-221-11/+144
| | | | | | | | | | | This takes a rc.d-service and starts it in a jail which shares the same root-path as the host (or parent jail) and may inherit the network from the host (or parent jail). Per service there is the possibility to specify some arguments which give more permissions (e.g. netv4, netv6, sysvipc...). Reviewed by: bcr (man page) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D40370
* Allow DEBUG_SH=rc:all to debug all rc.dSimon J. Gerraty2024-05-221-1/+1
| | | | | Usually a bad idea but there are exceptions to every rule. Allso debugging all rc.d scripts or all with a given arg.
* ftpd: stop using -g flag for /bin/lsAllan Jude2024-05-213-4/+4
| | | | | | | | | | | | | | | In 3bfbb521 the behaviour of ls was changed such that -g was no longer a noop for compatibility with BSD 4.3, but instead changed the output of long mode to exclude the owner of the file and display only the group. Update how FTPd invokes ls to restore the previous behaviour Reported-by: Andrew Fengler <andrew.fengler@scaleengine.com> Reviewed-by: jrtc27, des, imp MFC after: 3 days Sponsored-by: ScaleEngine Inc. Fixes: 3bfbb521fef5 ("ls: Improve POSIX compatibility for -g and -n.")
* fix (nuageinit): SSH keys are not handled in metadata but in userdataJeremy Collin2024-05-211-7/+0
| | | | MFC After: 1 day
* Revert "rtld: Add arm64 variant pcs tests"Andrew Turner2024-05-178-247/+0
| | | | | | It's missing an mtree update This reverts commit 9e48c30e25a743a268d17a6215b9c2d859543547.
* rtld: Move powerpc specific code to powerpc filesAndrew Turner2024-05-176-25/+28
| | | | | | | | | | | There are two variables set by dynamic tags in the powerpc runtime linker. Now we have a way to split out architecture-specific dynamic tags use it to handle these. Reviewed by: kib, jhibbits Obtained from: jhibbits (earlier version) Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45182
* rtld: Add arm64 variant pcs testsAndrew Turner2024-05-178-0/+247
| | | | | | | | | | When marking a function as variant pcs we can use registers not normally used in procedure calls. Add a test that uses this and stores all general purpose registers to a buffer and compare this buffer with the expected value later. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44870
* rtld: Add support for arm64 variant pcsAndrew Turner2024-05-172-5/+51
| | | | | | | | | | | | | | The aarch64 ELF spec has support for a variant of the normal procedure call standard that doesn't follow the normal register convention, e.g. using more registers as arguments, or different register state is preserved. Add support to rtld to handle this. As we don't know which registers need to be preserved disable lazy binding for these functions. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44869
* rtld: Add arch_digest_dynamicAndrew Turner2024-05-178-0/+24
| | | | | | | | This will be used to handle the DT_AARCH64_VARIANT_PCS tag. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45117
* rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_EntryAndrew Turner2024-05-178-0/+16
| | | | | | | | | Add a macro the architectures can use to add per-arch fields to Struct_Obj_Entry. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45116
* nuageinit: by default to not enable nuageinitBaptiste Daroussin2024-05-141-0/+1
| | | | | MFC After: 1 day Reported by: karels@
* Add a build knob for _FORTIFY_SOURCEKyle Evans2024-05-131-0/+4
| | | | | | | | | | | | | | | | | In the future, we will Default to _FORTIFY_SOURCE=2 if SSP is enabled, otherwise default to _FORTIFY_SOURCE=0. For now we default it to 0 unconditionally to ease bisect across older versions without the new symbols, and we'll put out a call for testing. include/*.h include their ssp/*.h equivalents as needed based on the knob. Programs and users are allowed to override FORTIFY_SOURCE in their Makefiles or src.conf/make.conf to force it off. Reviewed by: des, markj Relnotes: yes Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32308
* tftpd: silence gcc overflow warningsDag-Erling Smørgrav2024-05-101-14/+29
| | | | | | | | | | | | | | | | | | | | | | | GCC 13 complains that we might be writing too much to an on-stack buffer when createing a filename. In practice there is a check that filename isn't too long given the time format and other static characters so GCC is incorrect, but GCC isn't wrong that we're potentially trying to put a MAXPATHLEN length string + some other characters into a MAXPATHLEN buffer (if you ignore the check GCC can't realistically evaluate at compile time). Switch to snprintf to populate filename to ensure that future logic errors don't result in a stack overflow. Shorten the questionably named yyyymmdd buffer enough to slience the warning (checking the snprintf return value isn't sufficent) while preserving maximum flexibility for admins who use the -F option. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D45086
* tftpd: Satisfy clang-analyzer.Dag-Erling Smørgrav2024-05-104-16/+12
| | | | | | | | | | | * Replace `random()` with `arc4random()`. * Change some variable types. * Drop some unused assignments. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D45132
* tftpd: Add missing include.Dag-Erling Smørgrav2024-05-101-0/+1
| | | | | | | | | This went unnoticed due to namespace pollution in our headers. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45131
* tftpd: Drop unneeded includes.Dag-Erling Smørgrav2024-05-105-5/+0
| | | | | | | MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D45130
* tftpd: Add missing `-S` option to synopsis.Dag-Erling Smørgrav2024-05-101-3/+3
| | | | | | | MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: imp, markj Differential Revision: https://reviews.freebsd.org/D45129
* at cron file is now in /etc/cron.dPaweł Krawczyk2024-05-101-1/+1
| | | | | | PR: 243380 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1106
* New sysctl to disable NOMATCH until devmatch runsIsaac Cilia Attard2024-05-101-0/+1
| | | | | | | | | | | | | | | | | | | Introduce hw.bus.devctl_nomatch_enabled and use it to suppress NOMATCH until devmatch runs There's a lot of NOMATCH events generated at boot. We also run devmatch once during early boot to load unmatched devices. To avoid redundant work, don't start generating NOMATCH events until after devmatch runs. Set hw.bus.devctl_nomatch_enabled=1 just before we run devmatch. The kernel will suppress NOMATCH events until this is set to true. This saves about 170ms from the boot on aarch64 running atop Apple M-series processors and the VMWare Fusion hypervisor. Reviewed by: imp, cperciva MFC after: 3 days Sponsored by: Google Summer of Code Pull Request: https://github.com/freebsd/freebsd-src/pull/1213
* Remove cross-references to GBDEPoul-Henning Kamp2024-05-071-1/+0
|
* Remove documentation of GBDE rc supportPoul-Henning Kamp2024-05-071-1/+0
|
* Remove GBDE rc supportPoul-Henning Kamp2024-05-072-125/+0
|
* packages: add package for NTPLexi Winter2024-05-041-2/+4
| | | | | Reviewed by: imp, manu Pull Request: https://github.com/freebsd/freebsd-src/pull/1193
* tftpd: Untangle a conditional.Dag-Erling Smørgrav2024-04-301-4/+5
| | | | | | | MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45026
* Remove remnants of portsnap(8)Olivier Certner2024-04-301-7/+4
| | | | | | | | | | | | | | | | | | | This was prompted by noticing that '/var/db/portsnap' still exists on newly-installed machines. With this change, all mentions of portsnap(8) in the tree are gone, except for the historical note in the AUTHORS section of manpage phttpget(8). locate(1) will thus start indexing again '/var/db/portsnap' on machines where this directory still exists, which may be a good way to push administrators to delete it. Reviewed by: cperciva Approved by: emaste (mentor) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45023
* rtld.1: clarify interaction between -u and -oKonstantin Belousov2024-04-301-1/+3
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* rtld direct exec: make -u behavior match the descriptionKonstantin Belousov2024-04-301-1/+4
| | | | | | | | | Instead of only ignoring insecure env vars, clear them all. Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44999
* rtld: add direct-exec option -oKonstantin Belousov2024-04-302-1/+49
| | | | | | | | | | | allowing to set any known LD_ parameter for the current rtld invocation, but without polluting the activated' binary environment. In other words, the set parameter is not exported into the environment. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44988
* package: move OpenBSM auditing into its own packageLexi Winter2024-04-291-1/+1
| | | | | | | | | | | Move auditing runtime (auditd, etc.) into the new FreeBSD-audit package. Also move the runtime OpenBSM manual pages from libbsm into auditd so they get installed with the right package. Add an UPDATING entry noting the new packages. Reviewed by: imp, manu Pull Request: https://github.com/freebsd/freebsd-src/pull/1197
* rtld snprintf: do not erronously skip a char at the buffer boundaryKonstantin Belousov2024-04-281-4/+3
| | | | | | | Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44987
* tftpd: Immediately reject any request shorter than 4 bytes.Dag-Erling Smørgrav2024-04-252-0/+24
| | | | | | | MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44957
* tftpd: Check the server status after each test.Dag-Erling Smørgrav2024-04-251-2/+42
| | | | | | | | | | | | | | | | | * In the setup phase, wait for the server to start (or fail to start) before proceeding with the test. This makes it possible to write test cases that don't expect a response from the server without ending up in a race over the server PID file. * After running each test, wait up to 30 seconds for the server to exit and check that the exit status matches what the test case says to expect (usually 0). * We still kill and collect the server in the cleanup phase, in case the test ended early. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44956
* tftpd: Clean up the tests.Dag-Erling Smørgrav2024-04-251-125/+128
| | | | | | | MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D44955