aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/rpcbind
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Follow up to r300932Enji Cooper2016-05-291-1/+2
| | | | | | | | | | | | | | | | | | In the event MK_INET6 != no in userspace, but is disabled in the kernel, or if there aren't any IPv6 addresses configured in userspace (for lo0 and all physical interfaces), rpcbind would terminate immediately instead of silently failing on Skip over the IPv6 block to its respective cleanup with freeifaddrs if creating the socket failed instead of terminating rpcbind immediately MFC after: 6 days X-MFC with: r300932 Reported by: O. Hartmann <ohartman@zedat.fu-berlin.de> Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300973
* Fix rpcbind init after r300941.Mark Johnston2016-05-291-1/+2
| | | | | | | | | | | | | - getaddrinfo() sets res = NULL on failure and freeaddrinfo() always dereferences its argument, so we should only free the address list after a successful call. - Address a second potential leak caused by getaddrinfo(AF_INET6) overwriting the address list returned by getaddrinfo(AF_INET). X-MFC-With: r300941 Notes: svn path=/head/; revision=300972
* Staticize variables only used in rpcbind.cEnji Cooper2016-05-291-7/+7
| | | | | | | | | | This is some low hanging fruit necessary for making this WARNS?= 6 clean MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300947
* Remove unnecessary caller_uaddr != NULL test before calling free on itEnji Cooper2016-05-291-2/+1
| | | | | | | | MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300945
* Remove a useless if (x != NULL) check before calling free on allocated_uaddrEnji Cooper2016-05-291-2/+1
| | | | | | | | MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300942
* Don't leak res in network_init(..)Enji Cooper2016-05-291-0/+1
| | | | | | | | | | | | Call freeaddrinfo on it after it's been used MFC after: 1 week Reported by: Coverity CID: 1225050 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300941
* Plug leak with ifp by calling freeifaddrs after calling getifaddrsEnji Cooper2016-05-291-0/+1
| | | | | | | | | MFC after: 1 week Obtained from: NetBSD v1.18 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300934
* Catch malloc(3) errors and socket(2) errorsEnji Cooper2016-05-291-0/+7
| | | | | | | | | | | | | | - malloc failing will result in a delayed segfault - socket failing will result in delayed failures with setsockopt Exit in the event that either of these high-level conditions are met. Reported by: Coverity CID: 976288, 976321, 976858 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300932
* Only expose `hint_uaddr` in the ND_DEBUG caseEnji Cooper2016-05-271-0/+6
| | | | | | | | | | | This fixes a -Wunused-but-set-variable warning with gcc MFC after: 1 week Reported by: gcc 5 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300867
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
* rpcbind: use our roundup() macro when available through <sys/param.h>.Pedro F. Giffuni2016-05-021-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298914
* MFHGlen Barber2016-03-101-0/+21
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+21
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | First pass to fix the 'tests' packages.Glen Barber2016-02-021-0/+4
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295171
* Fix Coverity warnings regarding r293229Alan Somers2016-01-132-5/+28
| | | | | | | | | | | | | | | | | | | rpcbind/check_bound.c Fix CID1347798, a memory leak in mergeaddr. rpcbind/tests/addrmerge_test.c Fix CID1347800 through CID1347803, memory leaks in ATF tests. They are harmless because each ATF test case runs in its own process, but they are trivial to fix. Fix a few other leaks that Coverity didn't detect, too. Coverity CID: 1347798, 1347800, 1347801, 1347802, 1347803 MFC after: 2 weeks X-MFC-With: 293229 Sponsored by: Spectra Logic Corp Notes: svn path=/head/; revision=293833
* "source routing" in rpcbindAlan Somers2016-01-066-49/+979
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on two separate subnets, and a client on the first subnet contacted rpcbind at the address on the second subnet, rpcbind would advertise addresses on the first subnet. This is a bug, because it should prefer to advertise the address where it was contacted. The requested service might be firewalled off from the address on the first subnet, for example. usr.sbin/rpcbind/check_bound.c If the address on which a request was received is known, pass that to addrmerge as the clnt_uaddr parameter. That is what addrmerge's comment indicates the parameter is supposed to mean. The previous behavior is that clnt_uaddr would contain the address from which the client sent the request. usr.sbin/rpcbind/util.c Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr, if one is found. Refactor the relevant portion of the function for clarity, and to reduce the number of ifdefs. etc/mtree/BSD.tests.dist usr.sbin/rpcbind/tests/Makefile usr.sbin/rpcbind/tests/addrmerge_test.c Add unit tests for usr.sbin/rpcbind/util.c:addrmerge. usr.sbin/rpcbind/check_bound.c usr.sbin/rpcbind/rpcbind.h usr.sbin/rpcbind/util.c Constify some function arguments Reviewed by: imp MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4690 Notes: svn path=/head/; revision=293229
* Reallocate a maxlen-long buffer only when the current maxlen isHiroki Sato2015-10-061-4/+6
| | | | | | | | shorter than the required length. Note that it rarely happens because maxlen is almost always 128 which covers struct sockaddr_storage. Notes: svn path=/head/; revision=288915
* Fix a regression with SA-15:24 patch that prevented NIS fromXin LI2015-10-021-4/+7
| | | | | | | working. Notes: svn path=/head/; revision=288510
* The Sun RPC framework uses a netbuf structure to represent theXin LI2015-09-291-5/+19
| | | | | | | | | | | | | | | | | | | | | | transport specific form of a universal transport address. The structure is expected to be opaque to consumers. In the current implementation, the structure contains a pointer to a buffer that holds the actual address. In rpcbind(8), netbuf structures are copied directly, which would result in two netbuf structures that reference to one shared address buffer. When one of the two netbuf structures is freed, access to the other netbuf structure would result in an undefined result that may crash the rpcbind(8) daemon. Fix this by making a copy of the buffer that is going to be freed instead of doing a shallow copy. Security: FreeBSD-SA-15:24.rpcbind Security: CVE-2015-7236 Notes: svn path=/head/; revision=288383
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+23
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-2/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-191-2/+2
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219