summaryrefslogtreecommitdiff
path: root/tirpc
Commit message (Collapse)AuthorAgeFilesLines
* rpcb_clnt.c add mechanism to try v2 protocol firstlibtirpc-1-3-3-rc3Roberto Bergantinos Corpas2022-07-161-0/+2
| | | | | | | | | | | | | | | | | | | | There have been previous attempts to revert protocol tryout algorithm from v4,v3,v2 to previous v2,v4,v3 : https://www.spinics.net/lists/linux-nfs/msg89228.html Apart from GETADDR/NAT issue originating that proposed change, its possible that some legacy custom applications still use v2 of protocol with libtirpc. The change proposed here, introduces an environment variable "RPCB_V2FIRST" so that, if defined, old behaviour is used. This is more flexible and allow us to selectively pick what application reverts to old behaviour instead of a system-wide change. Signed-off-by: Roberto Bergantinos Corpas <rbergant@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc/types.h: fix android buildHsia-Jun(Randy) Li2022-01-201-0/+5
| | | | | | | Android bionic doesn't those glibc defined types. Signed-off-by: Hsia-Jun(Randy) Li <randy.li@synaptics.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Replace the final SunRPC licenses with BSD licenseslibtirpc-1-3-2-rc3Tom 'spot' Callaway2021-05-102-60/+60
| | | | | | | | | It was noticed there was a couple SunRPC licenses were left from the work that was done in 2009-2010 (ea26246^..ba3945e). This converts them to BSD licenses. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1955239 Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc: disallow calling auth_refresh from clnt_call with RPCSEC_GSSlibtirpc-1-3-2-rc1Scott Mayhew2021-03-151-0/+2
| | | | | | | | | Disallow calling auth_refresh from clnt_{dg,vc}_call if the client is using RPCSEC_GSS. Doing so can recurse back into clnt_{dg,vc}_call, where we'll self-deadlock waiting on the condition variable. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove AUTH_DES interfaces from auth_des.h.libtirpc-1-2-7-rc5Steve Dickson2020-12-011-15/+0
| | | | | | | | | | | | | | | The unsupported AUTH_DES authentication has be compiled out since commit d918e41d889 (Wed Oct 9 2019) replaced by API routines that return errors. To maintain a stable API and to cause future apps to fail to build, this patch removes the functions declaration from the header file. This also has the side effect of not changing the SONAME which always causes pain. Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc: replace array with list for per-fd lockslibtirpc-1-2-7-rc3Jaime Caamano Ruiz2020-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Currently per-fd locks for the clients are pre-allocated up to the soft limit of maximum allowed open file desciptors per process as defined in __rpc_dtbsize(): if (getrlimit(RLIMIT_NOFILE, &rl) == 0) { return (tbsize = (int)rl.rlim_cur); } This limit can be arbitrarily large for any given process resulting in unreasonable memory allocation. For example, for systemd PID1 process this limit is set to 1073741816 since version 240. systemd is an indirect user of this library as it fetches information about users, groups, etc... This patch proposes a list implementation of per-fd locks based on glibc doubly linked lists. It also includes support for a fixed array based pre-allocation up to a compile-time defined limit of locks for equivalence to the previous implementation. Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc/types.h: fix musl buildFabrice Fontaine2019-10-071-1/+1
| | | | | | | | | | | | | From: Fabrice Fontaine <fontaine.fabrice@gmail.com> Don't redefine existing typedef (u_char, u_long, ...) on musl Fixes: - http://autobuild.buildroot.net/results/dbc07e383605a84eb19a2fd1899668612212518a Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Commit e45bf420983e fixed issue for uclibc-ng, but on uclibc thisPetr Vorel2019-06-111-2/+3
| | | | | | | | | | | | | depends on __UCLIBC_HAS_RPC__. This is old patch from Buildroot commit c54af0a294 ("libtirpc: handle the case where uClibc may have RPC support") by Thomas Petazzoni. Fixes: 6d8d4b5a7bf6 ("Include string.h for memset") Fixes: e45bf420983e ("Fix struct rpcent for uclibc-ng") Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add includes to pmap_clnt.hlibtirpc-1-0-3-rc1Thorsten Kukuk2017-11-141-0/+4
| | | | | | | | | | | When disabling the deprecated sunrpc code in glibc and build openSUSE Tumbleweed completly with libtirpc, I found some programs including rpc/pmap_clnt.h without all needed header files before. Since the list is uncommon and a surprise (sunrpc did include them in that header), I added them to the tirpc header, too: Signed-off-by: Thorsten Kukuk <kukuk@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add some typedefs to rpc/types.h to allow applications be compiled with ↵Thorsten Kukuk2017-11-141-0/+22
| | | | | | | | | | | | -std=iso9899:1990 When disabling the deprecated sunrpc code in glibc and build openSUSE Tumbleweed completly with libtirpc, I found some programs using non-standard -std= options. The following patch fixes the compile problems (Patch is taken from glibc): Signed-off-by: Thorsten Kukuk <kukuk@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix struct rpcent for uclibc-nglibtirpc-1-0-2-rc4Joshua Kinard2017-07-051-1/+1
| | | | | | | | | | | | Commit 6d8d4b5a7bf6 addresses an issue for musl, based on a description of an earlier patch at https://patchwork.kernel.org/patch/5499671/. That description notes uncertainty with uclibc, which also defines __GLIBC__. This patch fixes the uclibc case by also checking for __UCLIBC__. Fixes: 6d8d4b5a7bf6 ("Include string.h for memset") Signed-off-by: Joshua Kinard <kumba@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com> Cc: Natanael Copa <ncopa@alpinelinux.org>
* Remove des*.c dependencies to glibclibtirpc-1-0-2-rc3Thorsten Kukuk2016-04-041-1/+1
| | | | | | | | | Our des_impl.c has dependencies to glibc header files and different arguments then our header file has. Bring our own code in sync. Signed-off-by: Thorsten Kukuk <kukuk@thkukuk.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Don't declare setrpcent/endrpcent on glibc based systemsThorsten Kukuk2016-02-021-1/+2
| | | | | | | | | | | | rpc/rpcent.h declares structs and functions, which are also declared by glibc. Some of them are protected by "#if !defined(__GLIBC__)", but setrpcent/endrpcent were not. Move them into the #if statement. Else compilation of applications including netdb.h will fail, since the TIRPC declaration is slightly different from glibc. Signed-off-by: Thorsten Kukuk <kukuk@thkukuk.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Drop the xp_auth member of SVCXPRTPeter Rosin2015-10-301-1/+0
| | | | | | | | | | Internally, the xp_auth pointer is no longer needed. Nor should new authenticators rely on it in the future. No other libtirpc has this field. For better RPC application portability, remove it. Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix SVCAUTH lifetime issues and move towards SolarisPeter Rosin2015-10-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | There are lifetime problems with the current handling of SVCAUTH and the core library has no business ever destroying an SVCAUTH. These lifetime problems leads to the gss authenticator leaking a SVCAUTH when interleaved calls on the transport arrive with non-gss credential flavors. So, plagiarize the Solaris solution and keep an inlined SVCAUTH struct to make it obvious that the core library is not managing the life of SVCAUTH. Then point the old xp_auth pointer to the inlined SVCAUTH by default. This makes it possible to match the Solaris macro SVC_XP_AUTH, while still remaining compatible with any old external xp_auth pointer users. Adjust the gss authenticator to keep track of its own gss data per SVCXPRT. This is still not a good gss implementation, but it is at least better than before. Tested-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Peter Rosin <peda@lysator.liu.se> Signed-off-by: Steve Dickson <steved@redhat.com>
* Align with Solaris in the process.Peter Rosin2015-10-302-0/+51
| | | | | | | Move the SVC_VERSQUIET flag from xp_p3 into a extendable struct Signed-off-by: Peter Rosin <peda@lysator.liu.se> Signed-off-by: Steve Dickson <steved@redhat.com>
* Handle gss auth reference counting internallyBrendan Heading2015-10-301-28/+4
| | | | | | | | | | | | | | | | | The previous implementation of auth_get and auth_put used atomic builtins to allow thread-safe updating of a reference count for the AUTH object. This causes libtirpc not to build on a number of non-mainstream architectures which don't support the atomic builtins. In addition it exposed the feature as macros through a header file, rather than through the ABI, preventing the underlying implementation from being updated. This patch removes the API calls and handles the reference counting/ deallocation of the AUTH object internally. Signed-off-by: Brendan Heading <brendanheading@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Use poll() instead of select() in svc_run()Thorsten Kukuk2015-08-281-4/+2
| | | | | | | | | | | | | | | | | | | TI-RPC is using select() in svc_run(), while glibc and Solaris are using poll(). This has two drawbacks: poll() is much more efficient then select(), and with select() we are limited to 1024 open filehandles. And applications replacing svc_run on Linux don't work, since they expect svc_pollfd and svc_max_pollfd. Attached patch changes this. It's full backward compatible, API and ABI, so e.g. current rpcbind will continue to work and compile. The only problem could arrive, that we can have more than 1024 open filehandles and applications ignoring higher ones. Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Thorsten Kukuk <kukuk@thkukuk.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add sunrpc compat define for xp_sockThorsten Kukuk2015-07-101-0/+1
| | | | | | | | SunRPC is using xp_sock in SVCXPRT, while TI-RPC is using xp_fd. For compatibility reasons, we should add this define: Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add authdes_pk_createThorsten Kukuk2015-07-101-0/+2
| | | | | | | | | when porting the glibc libnsl library to TI-RPC, there were missing compat functions. This patch contains the fixes from authdes_create: Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove g_OID_equal()Chuck Lever2015-07-101-5/+0
| | | | | | | | Clean up: g_OID_equal() is not part of the RPC GSS API on FreeBSD Solaris, or in the legacy glibc API. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* enable xdr_sizeofThorsten Kukuk2015-07-101-0/+1
| | | | | | | | xdr_sizeof is not enabled in TI-RPC. But this function is needed to port the glibc libnsl library to TI-RPC: Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove vestiges of AUTH_KERBChuck Lever2015-06-162-196/+0
| | | | | | | | | | | | | | | | | AUTH_KERB is described only briefly in the ONC+ Developer's Guide. However, xdr_authkerb_cred(), for example, is declared in Linux's tirpc/rpc/auth.h, but does not appear in Solaris 11's RPC headers. It is not provided by glibc, so there isn't any backward compatibility requirement. The libtirpc implementation of AUTH_KERB here on Linux and in FreeBSD seems to be incomplete and inoperative. Seems like the scattered pieces of it can be removed safely. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* Enable rtime() API for backward compatibility with glibc's SunRPCChuck Lever2015-06-161-1/+1
| | | | | | | | | | Note that TI-RPC redefines rtime() to use TI-RPC-style arguments. libtirpc on Linux has never provided rtime(), but glibc does. Since rtime() is something of a legacy anyway, just make our version of rtime() look and work like the glibc version. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* Enable key_prot API for backward compatibility with glibc's SunRPCChuck Lever2015-06-162-0/+548
| | | | | | | | The only missing file was key_prot.h. I copied the SunRPC-licenced version of key_prot.x from glibc, and generated key_prot.h using rpcgen. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* Revert commit 4ba9ce277dd6 ('configure.ac: Allow for disabling auth DES')Chuck Lever2015-06-162-12/+0
| | | | | | | | | | AUTH_DES is a part of legacy glibc SunRPC, and cannot be optional. Adding an autoconf macro (HAVE_AUTHDES) into libtirpc source files is OK, but adding such a macro into installed header files is wrong. Reported-by: Thorsten Kukuk <kukuk@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* Revert commit ddf99776a7a9 ('auth.h: Remove unsupported routine . . .')Chuck Lever2015-06-162-0/+34
| | | | | | | | These are part of glibc backward compatibility, and cannot be removed yet. Reported-by: Thorsten Kukuk <kukuk@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
* Commit 7228a9482b92 missed tirpc/rpc/rpcsec_gss.h .libtirpc-0-3-1-rc1Chuck Lever2015-06-011-3/+8
| | | | | | | Fixes: 7228a9482b92 ('Avoid use of internal glibc sys/cdefs.h . . .') Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Expose legacy svcauth_gss APIsChuck Lever2015-06-011-0/+50
| | | | | | | | | | | | | | svcauth_gss_set_svc_name() and svcauth_gss_get_principal() are part of the legacy U-M API that some RPC server applications may expect to be present. The trick is leaving these out when --disable-gssapi is specified. A new public header file is created to keep GSS-API dependencies separate. Reported-by: Thorsten Kukuk <kukuk@suse.de> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Do not include rpc/auth_gss.h in rpc/rpc.hChuck Lever2015-06-011-4/+0
| | | | | | | | | | | | | | | | <rpc/auth_gss.h> includes <gssapi/gssapi.h>, which isn't always available. In <rpc/rpc.h>, "#include <rpc/auth_gss.h>" is stuck behind a conditional that is true when libtirpc itself is built. But it's unlikely that RPC API consumers would ever set HAVE_RPCSEC_GSS. If they need <rpc/auth_gss.h> they include it explicitly already. Therefore, that include is not effective when the header is installed and can be removed safely. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove requirement for gssapi/gssapi.h in svc_auth.hChuck Lever2015-06-011-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When --disable-gssapi is specified and gssapi.h is not installed on the build system, making libtirpc fails: CC libtirpc_la-bindresvport.lo In file included from ../tirpc/rpc/svc_auth.h:44:0, from ../tirpc/rpc/rpc.h:68, from bindresvport.c:46: ../tirpc/rpc/rpcsec_gss.h:38:27: fatal error: gssapi/gssapi.h: No such file or directory #include <gssapi/gssapi.h> ^ compilation terminated. Commit d5259e751111 added "#include <rpc/rpcsec_gss.h>" to <rpc/svc_auth.h> . That tries to include <gssapi/gssapi.h>, which is missing in this case. Remove the fields added in SVCAUTH that require including <rpc/rpcsec_gss.h>. These are not part of the TI-RPC public API as far as I can tell. Then "#include <rpc/rpcsec_gss.h>" can be safely removed from <rpc/svc_auth.h> . Reported-by: Thorsten Kukuk <kukuk@suse.de> Fixes: d5259e751111 ('Add header definitions for rpc_gss_*() APIs') Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Revert "Fix Build w/gssapi disabled"Steve Dickson2015-06-013-21/+1
| | | | This reverts commit 7b7337b7e6541649a82b09a5c268c7fe6404fbf4.
* Fix Build w/gssapi disabledThorsten Kukuk2015-05-073-1/+21
| | | | | | | | | | | A regression was introduced by commit d5259e75 that broke the --disable-gssapi configuration flag causing numerous compile errors. This patch fixes those errors but then the config flag is used it breaks API with previous releases. Signed-off-by: Steve Dickson <steved@redhat.com>
* auth.h: Remove unsupported routine declarationsSteve Dickson2015-04-302-34/+0
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix xdr_rpc* defines in xdr.hThorsten Kukuk2015-04-291-9/+5
| | | | | | | | | The defines for xdr_rpc* in xdr.h are wrong. It could be very well that Solaris did strip the '_t' from xdr_u_int32_t, but Solaris has a xdr_u_int32 function, we don't have this. So all of this defines will lead to an unresolved symbol. Signed-off-by: Steve Dickson <steved@redhat.com>
* configure.ac: Allow for disabling auth DESBernhard Reutner-Fischer2015-04-292-0/+12
| | | | | | | DES encryption might not be available. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add header definitions for rpc_gss_*() APIsChuck Lever2015-04-292-0/+144
| | | | | | | | | | | | | This patch describes the API defined in Solaris and FreeBSD to provide RPCSEC GSS support for user space TI-RPC consumers. The header file is based on the API provided in Solaris, but was written from scratch. The man page was written by Doug Rabson for the FreeBSD implementation of this API, and updated by me where needed. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* configure.ac: Check for features.hlibtirpc-0-2-6-rc3Bernhard Reutner-Fischer2015-04-231-0/+2
| | | | | | | | | | | Fixes http://sourceforge.net/p/libtirpc/bugs/34/ The netconfig header attempts to include features.h which is only available in glibc. This is necessary for backporting the package for FreeBSD. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Include string.h for memsetNatanael Copa2015-04-231-1/+1
| | | | | | | This fixes warning: implicit declaration of function 'memset' Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Avoid use of internal glibc sys/cdefs.h headerNatanael Copa2015-04-2321-150/+363
| | | | | | | | | | | | 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>
* Pre-register server side RPCSEC GSS supportlibtirpc-0-2-5-rc2Chuck Lever2014-04-092-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | When --enable-gss is specified on the ./configure command line, have the library automatically register server-side support for the RPCSEC_GSS auth flavor. The complication is that specific interaction is required with the RPC client if GSS authentication fails. GSS authentication sometimes has to squelch the normal reply done by svc_getreq(), and substitute its own. _svcauth_gss() already has a boolean argument to do this. But _authenticate() is an official API (see rpc/svc_auth.h). We can't alter its synopsis. Instead of adding a "no_dispatch" argument to our existing _authenticate() API, preserve its synopsis for backwards compatibility, and introduce a second external authentication API for the dispatcher. This matches a similar API change done in the Solaris libtirpc. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Add a pthread key initializer constantChuck Lever2014-01-231-0/+2
| | | | | | | | | | | | | 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>
* libtirpc: remove tirpc/fpmath.hChuck Lever2013-12-091-63/+0
| | | | | | | No libtirpc source files include this header, so remove it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc: remove tirpc/nss_tls.hChuck Lever2013-12-091-0/+0
| | | | | | | No libtirpc source files include this header, so remove it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc: remove tirpc/spinlock.hChuck Lever2013-12-091-41/+0
| | | | | | | No libtirpc source files include this header, so remove it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc: remove tirpc/misc/event.hChuck Lever2013-12-091-201/+0
| | | | | | | No libtirpc source file includes this header, so remove it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc: remove tirpc/misc/socket.hChuck Lever2013-12-091-62/+0
| | | | | | | No libtirpc source files include this header, so remove it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc: remove tirpc/misc/queue.hChuck Lever2013-12-091-6/+0
| | | | | | | The contents of this header are unneeded on Linux, so remove the header. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libtirpc: remove tirpc/namespace.hChuck Lever2013-12-091-33/+0
| | | | | | | This header is empty, so remove it. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* glibc rpcgen compatibilityChuck Lever2013-12-091-0/+2
| | | | | | | | | | | xdr_quad_t() and xdr_u_quad_t() call sites are generated by glibc's rpcgen, which uses them to marshal 64-bit integers. Since we want libtirpc to maintain glibc compatibility, introduce xdr_quad_t() and xdr_u_quad_t() to libtirpc. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>