summaryrefslogtreecommitdiff
path: root/src/rpc_generic.c
Commit message (Collapse)AuthorAgeFilesLines
* __rpc_dtbsize: rlim_cur instead of rlim_maxlibtirpc-1-2-7-rc1Steve Dickson2020-04-271-1/+1
| | | | | | | | | | | | | | | | | | In the client code, rlim_max is used to allocate two arrays used for multithread locking. These arrays are indexed with open file descriptors. With some recent changes to systemd, the rlim_max is now a very large number and no longer represents the max number of open file descriptors allowed causing the locking arrays to be huge resulting in processes being OOM killed. It turns out the max number opens allowed in a process is still fairly small (1023) which means rlim_cur (1024) can be used instead of rlim_max. Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc_generic.c: resource_leakSteve Dickson2018-09-111-0/+1
| | | | | | Variable "handle" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix for CVE-2017-8779Guido Vranken2017-05-151-0/+8
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix: IPv6 and old SunRPC-functionsThorsten Kukuk2015-06-051-3/+3
| | | | | | | | | | | | | | | | | | | If you have the IPv4 functions in /etc/netconfig the first entries, everything is fine. But if you modify /etc/netconfig to have the IPv6 entries first (udp6,tcp6), svc_register will fail. The reason is in pmap_set frompmap_clnt.c: nconf = __rpc_getconfip(protocol == IPPROTO_UDP ? "udp" : "tcp"); snprintf(buf, sizeof buf, "0.0.0.0.%d.%d", (((u_int32_t)port) >> 8) & 0xff, port & 0xff); na = uaddr2taddr(nconf, buf); __rpc_gtconfigip will return a IPv6 entry, uaddr2taddr gets a IPv4 address and a IPv6 nconf entry and fails. This patch changes __rpc_getconfip to ignore IPv6 entries. Signed-off-by: Steve Dickson <steved@redhat.com>
* Avoid use of internal glibc sys/cdefs.h headerNatanael Copa2015-04-231-1/+0
| | | | | | | | | | | | This header was never intended to be used by programs. Expand the macros used, __BEGIN_CDECLS, __END_CDECLS and __P() The __THROW macro is a non-portable hint for optimization so we simply remove those. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* tirpc: fix taddr2uaddr for AF_LOCALThorsten Kukuk2014-12-161-6/+6
| | | | | | | | | | | taddr2uaddr would return trailing garbage for AF_LOCAL addresses taddr2uaddr assumed that the sun_path field of an AF_LOCAL address was always NULL terminated, but that is not necessarily the case, especially if the buffer was allocated using the correct SUN_LEN(). Signed-off-by: Olaf Kirch <okir@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add a pthread key initializer constantChuck Lever2014-01-231-4/+4
| | | | | | | | | | | | | Clean up: replace the naked "-1" with a symbolic constant that helps document what is going on. The name matches the name of the other pthread initializer constants. Also, since pthread_key_t is an unsigned integer, use a type cast to eliminate the implicit cast that occurs every time foo_key is compared to -1. This eliminates a number of compiler warnings. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add missing INET6 conditionalThomas Petazzoni2012-11-131-0/+2
| | | | | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Automount with nis maps crashes and generates a coreUlrich Drepper2010-05-181-2/+8
| | | | | | | | | | | | | I think I added the appropriate backward compatibility support to handle old kernels. And certainly the existing libtirpc functions are unchanged. Only one additional extenal interface (__libc_clntudp_bufcreate) is added. The remaining changes are necessary to implement it. The changes are straightforward. See https://bugzilla.redhat.com/show_bug.cgi?id=519430 Signed-off-by: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Cleaned up some "break strict-aliasing rules" warningsSteve Dickson2009-07-091-6/+11
| | | | | | as well as some other warnings. Signed-off-by: Steve Dickson <steved@redhat.com>
* Replace the Sun RPC license with the BSD license, with the explicitTom "spot" Callaway2009-05-281-26/+25
| | | | | | | permission of Sun Microsystems Signed-off-by: Tom "spot" Callaway <tcallawa@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc-0.1.10 - tsd destory at unloadIan Kent2009-04-201-1/+1
| | | | | | | | | | | | | | | | | If tsd keys are created that use a function local to the library and are not destroyed at library unload this can lead to a SEGV if the library is unloaded before the last thread is unloaded. Also, calling free() on an address previously belonging to the now unloaded library might not be very good either. I'm not to clear about what happens to data areas used by shared libraries in terms of their presence or otherwise in the lifcycle of a shared library. This patch assumes that all threads using the library have exited prior to the library being unloaded but may be worth more thought. Signed-off-by: Ian Kent <ikent@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* __rpc_taddr2uaddr_af() assumes the netbuf to always have aSteve Dickson2008-10-271-0/+3
| | | | | | | | 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. Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix __rpc_getconfipOlaf Kirch2008-09-301-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 patch fixes this issue. Signed-off-by: Olaf Kirch <okir@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Introduce __rpc_set_netbuf helperOlaf Kirch2008-09-301-0/+19
| | | | | | | | | | The RPC code contains a number of places where a netbuf is initialized with some data. All the mem_alloc/memcpy stuff is open-coded. Introduce a helper function and convert the code. Signed-off-by: Olaf Kirch <okir@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix for taddr2addr conversion bug of local addressesOlaf Kirch2008-09-161-1/+1
| | | | | | | | | | When converting af_local socket addresses in taddr2uaddr, an incorrect sizeof() would result in a truncated path string. As a result, rpcbind will report the local /var/lib/rpcbind address to clients as "/v" on a 32bit machine. Signed-off-by: okir@suse.de Signed-off-by: Steve Dickson <steved@redhat.com>
* Always make IPv6 sockets V6ONLYOlaf Kirch2008-09-021-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assume you have a netconfig file looking like this: udp tpi_clts v inet udp - - udp6 tpi_clts v inet6 udp - - ... a call to svc_tli_create(... &someaddr, "udp") will fail to create an IPv6 server socket. The problem is that on Linux, passive IPv6 sockets will also accept packets/connections from IPv4, and will simply map the sender's address to an IPv6 mapped IPv4 address. So if you want to bind both a UDPv4 and UDPv6 socket to the same port, this will fail with EADDRINUSE. The way to avoid this behavior is to change the socket to V6ONLY, which tells the kernel to avoid the autmatic mapping. The change proposed in the patch below does this. I *think* this is a good place to do this, as it will also fix applications that do not use svc_tli_create() - such as rpcbind, which creates the sockets on its own using __rpc_nconf2fd. I think this also improves portability, as BSD code assumes BSD behavior, where this mapping does not occur either. Signed-off-by: Olaf Kirch <okir@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Initial commit of libtirpc 0.1.7Steve Dickson2007-04-201-0/+828
Signed-off-by: Steve Dickson <steved@redhat.com>