summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc
Commit message (Collapse)AuthorAgeFilesLines
* libc: spelling fixes.pfg2016-04-307-11/+11
| | | | Mostly on comments.
* libc: do not include <sys/types.h> where <sys/param.h> was already includedavos2016-04-183-3/+0
| | | | | | According to style(9): > normally, include <sys/types.h> OR <sys/param.h>, but not both. (<sys/param.h> already includes <sys/types.h> when LOCORE is not defined).
* libc: cleanup unnecessary semicolons (part 2).pfg2016-04-112-2/+2
| | | | Found with devel/coccinelle.
* libc: replace 0 with NULL for pointers.pfg2016-04-104-13/+13
| | | | | | | | | While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle. Reviewed by: bde (previous version - all new bugs are mine)
* Stray tabs and spaces.pfg2016-03-051-8/+8
| | | | No functional change.
* Work around aliasing issues detected in modern GCC.pfg2016-03-041-16/+20
| | | | | | | Avoid casting gymnastics that lead to pointer aliasing by introducing an inline function as done in NetBSD (but without #if0'd WIP code). Obtained from: NetBSD (CVS Rev. 1.24, 1.25)
* RPC: update the getrpcbyname() definition to include a const qualifier.pfg2016-02-262-3/+3
| | | | | | | Add const qualifier making getrpcbyname() and getrpcbyname_r() prototypes match those used in latest Sun RPC code (TI-RPC 2.3). Obtained from: NetBSD
* rpc: fix failure to clear string by passing the wrong size to memset.pfg2016-02-261-1/+1
| | | | | | | Noted by NetBSD's PR/21014 Obtained from: NetBSD (CVS Rev. 1.24, 1.25) MFC after: 1 month
* Fix a mismerge from NetBSD in r162194 with `xdr_rpcb_entry_list_ptr(..)`ngie2016-01-121-2/+2
| | | | | | | | | | | This fixes the potential NULL pointer dereference properly, and also fixes memory leaks encountered in the process of iterating through `*rp`. MFC after: 1 week Found by: Valgrind Reported by: Dan Roberts <dan.roberts@isilon.com> Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> Sponsored by: EMC / Isilon Storage Division
* Similar to r293704, fix theoretical leak of netconfig(3) resources inngie2016-01-111-2/+2
| | | | | | | | | | | __rpcbind_is_up(..) if getnetconfig(3) is partly successful in allocating resources, but not completely successful by moving the endnetconfig(3) call up before we return from the function if nconf == NULL. MFC after: 1 week Reported by: Coverity Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> Sponsored by: EMC / Isilon Storage Division
* Fix theoretical leak of netconfig(3) resources in svcunix_create(..)ngie2016-01-111-1/+1
| | | | | | | | | | | | | In the event that the getconfig(3) call in svcunix_create is partly successful, some of the netconfig(3) resources allocated might be leaked if the call returns NULL as endnetconfig(3) wasn't called explicitly in that case. Ensure that the resources are fully cleaned up by going to the `done` label, which will call endnetconfig(3) for us. MFC after: 1 week Reported by: Coverity Submitted by: Miles Ohlrich <miles.ohlrich@isilon.com> Sponsored by: EMC / Isilon Storage Division
* RPC: populate local address for rendezvous transporter.stas2015-12-101-2/+16
| | | | | | | | | | | When accepting a connection on underlying tcp socket rpc vc transporter fails to populate local address. This change rectifies this problem by modifying rendezvous_request() to fill out the xptr structure member with appropriate information. Submitted by: Alex Burlyga <alex.burlyga.ietf@gmail.com> MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4206
* Remove unnecessary `if (x)` tests before calling `free(x)`; free(3)ngie2015-11-0210-49/+25
| | | | | | | already employs this check MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Use proper function prototypes.rodrigc2015-10-072-4/+4
| | | | Eliminates -Wstrict-prototypes warning
* Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.rodrigc2015-09-2235-409/+235
|
* Use ANSI C prototypes.rodrigc2015-09-201-69/+31
| | | | Eliminates gcc 4.9 warnings.
* Use unsigned variable.rodrigc2015-09-011-1/+1
| | | | Eliminates gcc 4.9 compiler warning.
* Use ANSI C prototypes.rodrigc2015-09-015-12/+12
| | | | Eliminates gcc 4.9 warnings.
* Use correct function prototype for signal handler.rodrigc2015-09-011-2/+2
| | | | Eliminates gcc 4.9 warning.
* Use ANSI C prototypes.rodrigc2015-09-011-21/+7
| | | | Eliminates gcc 4.9 warnings.
* Mark unused parameters to reduce gcc 4.9 warnings.rodrigc2015-09-011-2/+2
|
* Use ANSI C prototypes.rodrigc2015-09-0115-395/+180
| | | | Eliminates gcc 4.9 warnings.
* mdoc: fix functions declarationsbapt2015-04-261-1/+1
|
* libc: clean some set-but-not-used errors.pfg2015-02-182-4/+1
| | | | | | | These were found by gcc 5.0 on Dragonfly BSD, however I made no attempt to silence the false positives. Obtained from: DragonFly (cf515c3a6f3a8964ad592e524442bc628f8ed63b)
* rpc: Uninitialized pointer readpfg2015-02-021-1/+1
| | | | | | | | | Initialize *xprt to avoid exposing a random value in cleanup_svc_vc_create. CID: 1018723 Phabric: D1749 Reviewed by: alfred
* Resource leakpfg2015-02-011-0/+1
| | | | | CID: 1016703 Reviewed by: alfred
* mdoc: improvements to SEE ALSO.joel2014-12-272-2/+2
|
* Remove an unused variable that would be better spelled __func__.brooks2014-10-241-1/+0
| | | | Sponsored by: DARPA, AFRL
* Properly free resources in case of error.brueffer2014-05-021-8/+6
| | | | | | CID: 1007032 Found with: Coverity Prevent(tm) MFC after: 2 weeks
* Move definitions out of rpc_com so that the linker doesn't complain abouttheraven2014-04-062-2/+5
| | | | | | multiple definitions. Reported by: sbruno
* Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}marcel2014-03-041-3/+3
| | | | | | | | | | | if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc.
* There is no file under SISSL after license replacement in r258581.hrs2013-11-251-335/+0
|
* Replace Sun Industry Standards Source License for Sun RPC code with ahrs2013-11-252-89/+48
| | | | | | 3-clause BSD license as specified by Oracle America, Inc. in 2010. This license change was approved by Wim Coekaerts, Senior Vice President, Linux and Virtualization at Oracle Corporation.
* Replace Sun RPC license in TI-RPC library with a 3-clause BSD license,hrs2013-11-2551-1333/+1305
| | | | with the explicit permission of Sun Microsystems in 2009.
* Assign the len field of the netbuf structure to the current length ofkevlo2013-03-011-1/+1
| | | | | | a sockaddr. Obtained from: NetBSD
* rpc: convert all uid and gid variables to u_int.pfg2012-10-044-7/+8
| | | | | | | | | | | After further discussion, instead of pretending to use uid_t and gid_t as upstream Solaris and linux try to, we are better using u_int, which is in fact what the code can handle and best approaches the range of values used by uid and gid. Discussed with: bde Reviewed by: bde
* rpc: convert all uid and gid variables of the type uid_t and gid_t.pfg2012-10-031-3/+3
| | | | | | | | | | The previous change (based on Solaris) doesn't work properly either as the casting only has the effect of quieting the compiler. Move back to the previous solution but adjust the sizeof() type in xdr_array(). This should mostly work (by accident). Reported by: bde
* rpc: convert all uid and gid variables of the type uid_t and gid_t.pfg2012-10-031-5/+5
| | | | | | | | | | | | | | As part of the previous commit, uses of xdr_int() were replaced with xdr_u_int(). This has undesired effects as the second argument doesn't match exactly uid_t or gid_t. It also breaks assumptions in the size of the provided types. To work around those issues we revert back to the use of xdr_int() but provide proper casting so the behaviour doesn't change. While here fix a style issue in the affected lines. Reported by: bde
* libtirpc: be sure to free cl_netid and cl_tppfg2012-10-021-0/+4
| | | | | | | | | | | | | When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. This change matches the reference (OpenSolaris) implementation. Tested by: David Wolfskill Obtained from: Bull GNU/Linux NFSv4 Project (libtirpc) MFC after: 2 weeks
* Fix __rpc_getconfippfg2012-10-021-2/+4
| | | | | | | | | | | | | | __rpc_getconfip is supposed to return the first netconf entry supporting tcp or udp, respectively. The code will currently return the *last* entry, plus it will leak memory when there is more than one such entry. This change matches the reference (OpenSolaris) implementation. Tested by: David Wolfskill Obtained from: Bull GNU/linux NFSv4 Project (libtirpc) MFC after: 1 week
* RPC: Convert all uid and gid variables of the type uid_t and gid_t.pfg2012-10-024-11/+9
| | | | | | | | This matches what upstream (OpenSolaris) does. Tested by: David Wolfskill Obtained from: Bull GNU/Linux NFSv4 project (libtirpc) MFC after: 3 days
* Complete revert of r239963:pfg2012-09-278-41/+19
| | | | | | | | | | | | | | | The attempt to merge changes from the linux libtirpc caused rpc.lockd to exit after startup under unclear conditions. After many hours of selective experiments and inconsistent results the conclusion is that it's better to just revert everything and restart in a future time with a much smaller subset of the changes. ____ MFC after: 3 days Reported by: David Wolfskill Tested by: David Wolfskill
* Partial revert of r239963:pfg2012-09-241-4/+0
| | | | | | | | | | | | | | | | | The following change caused rpc.lockd to exit after startup: ____ libtirpc: be sure to free cl_netid and cl_tp When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. ____ MFC after: 3 days Reported by: David Wolfskill Tested by: David Wolfskill
* Rework all non-contributed files that use `struct timezone'.ed2012-09-012-2/+2
| | | | | | | | | | | | | | This structure is not part of POSIX. According to POSIX, gettimeofday() has the following prototype: int gettimeofday(struct timeval *restrict tp, void *restrict tzp); Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is not used). Remove dead error handling code. Also use NULL for a nul-pointer instead of integer 0. While there, change all pieces of code that only use tv_sec to use time(3), as this provides less overhead.
* Bring some changes from Bull's NFSv4 libtirpc implementation.pfg2012-09-019-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We especifically ignored the glibc compatibility changes but this should help interaction with Solaris and Linux. ____ Fixed infinite loop in svc_run() author Steve Dickson Tue, 10 Jun 2008 12:35:52 -0500 (13:35 -0400) Fixed infinite loop in svc_run() ____ __rpc_taddr2uaddr_af() assumes the netbuf to always have a non-zero data. This is a bad assumption and can lead to a seg-fault. This patch adds a check for zero length and returns NULL when found. author Steve Dickson Mon, 27 Oct 2008 11:46:54 -0500 (12:46 -0400) ____ Changed clnt_spcreateerror() to return clearer and more concise error messages. author Steve Dickson Thu, 20 Nov 2008 08:55:31 -0500 (08:55 -0500) ____ Converted all uid and gid variables of the type uid_t and gid_t. author Steve Dickson Wed, 28 Jan 2009 12:44:46 -0500 (12:44 -0500) ____ libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed These fields in the rpcbind GETADDR call are being passed uninitialized to CLNT_CALL. In the case of x86_64 at least, this usually leads to a segfault. On x86, it sometimes causes segfaults and other times causes garbage to be sent on the wire. rpcbind generally ignores the r_owner field for calls that come in over the wire, so it really doesn't matter what we send in that slot. We just need to send something. The reference implementation from Sun seems to send a blank string. Have ours follow suit. author Jeff Layton Fri, 13 Mar 2009 11:44:16 -0500 (12:44 -0400) ____ libtirpc: be sure to free cl_netid and cl_tp When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. author Jeff Layton Fri, 13 Mar 2009 11:47:36 -0500 (12:47 -0400) Obtained from: Bull GNU/Linux NFSv4 Project MFC after: 3 weeks
* Jump to the failed label instead of doing cleanup ourselves.brueffer2012-07-151-2/+1
| | | | | Obtained from: DragonFly BSD MFC after: 2 weeks
* General mdoc(7) and typo fixes.gjb2012-05-111-2/+2
| | | | | | PR: 167734 Submitted by: Nobuyuki Koganemaru (kogane!jp.freebsd.org) MFC after: 3 days
* Plug a leak.kib2012-05-081-2/+5
| | | | | Submitted by: Greg Bednarek <gbednarek averesystems com> MFC after: 1 week
* Fix several memory and lock leaks on the out of memory condition.kib2012-04-282-2/+22
| | | | | Reported by: Matt Miller <matt matthewjmiller net> MFC after: 1 week
* Remove unnecessary Xo/Xc.joel2012-03-291-10/+5
| | | | Reviewed by: brueffer
OpenPOWER on IntegriCloud