aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/rpcbind
Commit message (Collapse)AuthorAgeFilesLines
* rpcbind: Code cleanupDag-Erling Smørgrav2025-08-079-454/+469
| | | | | | | Fix a number of style issues and attempt to reduce the diff to NetBSD. Reviewed by: glebius, kib Differential Revision: https://reviews.freebsd.org/D51773
* rpcbind: do not exit abruptly if krpc.ko is not availableKonstantin Belousov2025-06-121-2/+4
| | | | | Reviewed by: glebius, rmacklem Sponsored by: The FreeBSD Foundation
* nfsd, rpcbind: add -P option to support pidfile pathKa Ho Ng2025-06-094-5/+49
| | | | | | | | | | | The -P option, when specified opens a pidfile to a given path. Both daemons also install a default pid file to the corresponding locations, that is, /var/run/nfsd.pid and /var/run/rpcbind.pid. Sponsored by: Juniper Networks, Inc. MFC after: 7 days Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D50624
* rpcbind: Ensure krpc is present.Dag-Erling Smørgrav2025-06-091-14/+21
| | | | | | MFC after: 1 week Reviewed by: rmacklem, glebius Differential Revision: https://reviews.freebsd.org/D50627
* rpcbind: run netlink(4) serviceGleb Smirnoff2025-02-012-27/+43
| | | | | | | | To register RPC bindings coming from the kernel. At the moment, we expect such bindings only from the kernel NLM service. Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D48556
* rpcbind: remove extraneous check for nconf not being unix(4)Gleb Smirnoff2025-01-091-9/+5
| | | | We are already inside an if block with exactly same predicate.
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+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
* rpcbind.8: Fix missing option entry in commit df3f247e4696Rick Macklem2024-07-111-2/+2
| | | | | | | | | | Commit df3f247e4696 added descriptions for the new command line option "-I". However, it failed to update the .Op line. This is a content change. Reviewed by: Alexander Ziaee <concussious.bugzilla@runbox.com> (manpages) Differential Revision: https://reviews.freebsd.org/D45118
* rpcbind.8: Update the man page for -IJoyu Liao2024-07-071-1/+10
| | | | | | | | | | Commit d8a99eaa1f06 added a new command line option "-I". This patch updates the man page for this. This is a content change. Reviewed by: Alexander Ziaee <concussious.bugzilla@runbox.com> (manpages) Differential Revision: https://reviews.freebsd.org/D45118
* rpcbind: Add option to disable local host bindingJoyu Liao2024-07-061-4/+8
| | | | | | | | | | | In our products, we need those options to support our features. Add daemon mode option for mountd, nfsd. Add skip local host binding option for rpcd. Add skip local host binding option for mountd. Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D45118
* usr.sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-273-9/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* usr.sbin: Remove ancient SCCS tags.Warner Losh2023-11-2710-27/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* rpcbind: Remove return statement at the end of void functionsElyes Haouas2023-11-061-4/+0
| | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
* rpcbind: Add flag for foreground modeStephen J. Kiernan2023-09-202-4/+13
| | | | | | | | | | | | | | Added the -N flag to enable foreground mode. It is useful to be able to run rpcbind in foreground mode when starting from launcher applications. The existing debug flag is not sufficient as it enables additional debug messages. Update man page to document the added flag. Reviewed by: imp Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D41674
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-165-5/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-167-7/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-164-4/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* rpcbind: Remove useless return at the end of void functionElyes Haouas2023-03-022-4/+0
| | | | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/656
* rpcbind: get contact addr from xprt membersDmitry Ovsyannikov2022-06-132-14/+13
| | | | | | | | | | | | | | | | Addition to D31491 in order to actually resolve the top root cause. Currently rpcbind gets contact address from connectionless xprt->xp_p2 member of a transport and will fail to get it when working over connection oriented transport, leading to a guess game in terms of contact address on rpcinfo requests like RPCBPROC_GETVERSADDR or RPCBPROC_GETADDRLIST and poor returns which may influence a user of a call and specifically reported on OSX clients, which tend to not provide address hint from rpcinfo request to a server. MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D35220
* RPCBIND: skip ipv6 link local when request is not from link local addressDavid Bright2021-10-042-5/+41
| | | | | | | | | | | | | | | | | | | | | | | RPCINFO on macOS behaves different compared to other linux clients and doesn't provide request address in rpcb structure of the RPCBPROC_GETADDRLIST call which doesn't seem to be forbidden. In this case RPCBIND uses RPC call's source address and picks a closest corresponding local address. If there are no addresses in the same subnet as the source address, return of RPCBIND may vary depending on the order of addresses returned in getifaddrs. If a link local precedes global address it may be returned even if the request comes from neither a link local nor from link local in a different scope, which will prevent services like nfs from working in tpc6 scenario on macOS clients. Issue can be seen only on FreeBSD rpcbind port due to changes in workflow of addrmerge call. Submitted by: Dmitry Ovsyannikov (Dmitry.Ovsyannikov@dell.com) Reviewers: dab Differential Revision: https://reviews.freebsd.org/D31491 Sponsored by: Dell EMC MFC to: stable/12, stable/13 MFC after: 1 week
* Fix MK_TESTS build with MK_ASAN/MK_UBSANAlex Richardson2021-08-021-0/+8
| | | | | Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D31049
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-3/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-111-0/+6
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* Plug a possible memory leak.Xin LI2018-03-191-0/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=331180
* - Remove extra NULL check before free().Hiroki Sato2018-03-051-33/+18
| | | | | | | | - Fix null pointer dereference in netbuffree() and use netbuffree() where applicable. Notes: svn path=/head/; revision=330442
* Partially back out changes in r327464. stdlib.h is used whenHiroki Sato2018-03-051-0/+3
| | | | | | | RPCBIND_DEBUG is enabled. Notes: svn path=/head/; revision=330441
* rpcbind: Fix race in signal terminationConrad Meyer2018-01-023-12/+37
| | | | | | | | | | | | | | | If a signal was delivered while the main thread was not in poll(2) and after check was performed, we could reenter poll and never detect termination. Fix this with the pipefd trick. (This race was introduced very recently, in r327482.) PR: 224503 Reported by: kib Reviewed by: kib, markj Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=327495
* rpcbind: Fix buildConrad Meyer2018-01-021-2/+3
| | | | | | | | | | | | Add missed unistd.h include. Not sure where it was lost; I believe it compiled before I submitted the change. PR: 224503 Reported by: Cy Schubert <Cy.Schubert AT komquats.com> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=327483
* rpcbind: Do not use signal-unsafe functions in SIGTERM handlerConrad Meyer2018-01-023-10/+19
| | | | | | | | | | | | | | syslog(3), routines used in write_warmstart(), and exit(3) are all signal-unsafe. Instead, set a signal-safe flag and check the flag in the rpcbind main loop to shutdown safely. PR: 224503 Reviewed by: kib, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13728 Notes: svn path=/head/; revision=327482
* Remove unused includes.Xin LI2018-01-019-14/+0
| | | | Notes: svn path=/head/; revision=327464
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-209-0/+18
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-312-2/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-021-0/+1
| | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-021-3/+1
| | | | | | | | | | | | | | directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
* * limit size of buffers to RPC_MAXDATASIZEXin LI2017-06-011-1/+3
| | | | | | | | | | | | | | | | | | | * don't leak memory * be more picky about bad parameters From: https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt via NetBSD. Reviewed by: emaste, cem (earlier version) Differential Revision: https://reviews.freebsd.org/D10922 MFC after: 3 days Notes: svn path=/head/; revision=319369
* Add a knob, WITH*_RPCBIND_WARMSTART_SUPPORT, to allow the end-user to buildEnji Cooper2017-04-191-0/+4
| | | | | | | | | | | | | | | rpcbind(8) with/without warmstart support. The knob defaults to off to preserve POLA for the feature. See rpcbind(8) for more details about the warmstart feature. MFC after: 7 weeks Relnotes: yes Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=317168
* Fix indentation per style.Makefile(5)Enji Cooper2017-04-191-3/+3
| | | | | | | | MFC after: 7 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=317164
* rpcbind(8): post-humously document -w (warmstart) support added in r74462Enji Cooper2017-04-191-1/+23
| | | | | | | | | | | warmstart support saves portmap/rpcbind(8) registration state on exit and restores the saved registration state on restart. MFC after: 7 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=317163
* rpcbind(8): add a description for /var/run/rpcbind.sock under the FILES sectionEnji Cooper2017-04-191-0/+1
| | | | | | | | MFC after: 7 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=317162
* rpcbind(8): wordsmith -h description and mention -W in the SYNOPSIS sectionEnji Cooper2017-04-191-3/+3
| | | | | | | | | | | -W was already documented in the OPTIONS section. MFC after: 7 weeks Reported by: igor (-h wordsmith'ing) Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=317155
* Print out the signal number on exit in terminate(..) if WARMSTART is compiledEnji Cooper2017-04-191-2/+3
| | | | | | | | | | | | | into rpcbind. The signal number can provide helpful diagnostic info. MFC after: 1 week Obtained from: Isilon OneFS Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=317154
* usr.sbin: normalize paths using SRCTOP-relative paths or :H when possibleEnji Cooper2017-03-041-1/+1
| | | | | | | | | | This simplifies make logic/output MFC after: 1 month Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314659
* Conditionalize wrap(3) use based on MK_TCP_WRAPPERS instead ofEnji Cooper2017-01-061-3/+6
| | | | | | | | | always building support into rpcbind. MFC after: 2 weeks Notes: svn path=/head/; revision=311470
* Fix usr.sbin/rpcbind ATF tests on 32-bit platformsAlan Somers2016-06-161-3/+3
| | | | | | | | | | | | | | | | | usr.sbin/rpcbind/tests/addrmerge_test.c Fix some sizeof calculations that work only by luck on 64-bit platforms. PR: 210314 Reviewed by: ngie Approved by: re (kib) Reported by: Mark Millard MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6855 Notes: svn path=/head/; revision=301967
* rpcbind(8): Make use of some xdr_* macros.Pedro F. Giffuni2016-06-091-3/+3
| | | | | | | | | xdr_rpcproc, xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD but fixed in r296394. Give them some use hoping they help make the code somewhat more readable. Notes: svn path=/head/; revision=301770
* Bounds check rpcbs_rmtcall(..) to ensure rtype is less than RPCBVERS_STATEnji Cooper2016-06-081-1/+1
| | | | | | | | | | | | | | | | | | | Not returning if rtype == RPCBVERS_STAT will cause us to overrun the inf array, as it's defined to be exactly RPCBVERS_STAT elements in rpcb_prot.x: > include/rpc/rpcb_prot.x:typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; The proposed change also matches the rest of the rtype upper bound checks in the file, so the original change was likely a typo. MFC after: 2 weeks Reported by: Coverity CID: 1007567 Reviewed by: truckman Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=301605