Skip to content

Commit

Permalink
Add the TI-RPC Library
Browse files Browse the repository at this point in the history
We require enhancements to the stock Linux TI-RPC implementation. In
particular we need notification when the client disconnects in order
to free up resources. The Oracle/Sun ONC-RPC has these enhancements, but
it is not part of  Linux.
  • Loading branch information
tom95858 committed Jul 20, 2021
1 parent e73f340 commit b3eed8b
Show file tree
Hide file tree
Showing 176 changed files with 40,392 additions and 0 deletions.
52 changes: 52 additions & 0 deletions libtirpc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# files generated by autoconf, automake, autoheader and libtoolize
aclocal.m4
autom4te.cache
compile
config.guess
config.log
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
Makefile.in
missing
config.h.in
m4/*
libtirpc-*.tar.gz
# files generated by configure
confdefs.h
config.status
conftest
conftest.c
conftest.cpp
conftest.er1
conftest.err
.deps
Makefile
config.h
stamp-h1
libtirpc.pc
# file generated during compilation
*.o
.libs
lib*.a
src/libtirpc.la
src/libtirpc_la-*.lo
tirpc/stamp-h2
tirpc/tirpc-features.h

# generic editor backup et al
*~
.stgitmail.txt
# cscope database files
cscope.*
# files generated by patches
*.patch
*.rej
*.orig
# files generated by debugging
.gdb_history
.gdbinit
core
3 changes: 3 additions & 0 deletions libtirpc/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Gilles Quillard <[email protected]>
Antoine Fraticelli <[email protected]>

25 changes: 25 additions & 0 deletions libtirpc/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright (c) Copyright (c) Bull S.A. 2005 All Rights Reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

206 changes: 206 additions & 0 deletions libtirpc/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
2008-11-19 Steve Dickson <[email protected]>

* Version 0.1.10 released.

commit 32ec5931e3debf208972d5146578f08dc113a9b6
Merge: 338af7f... 92cf0dd...
Author: Steve Dickson <[email protected]>
Date: Mon Nov 17 12:26:22 2008 -0500

Merge branch 'master' of git://git.infradead.org/~steved/libtirpc

commit 92cf0dde310ca341a2f29ff66b19eeb9994a649a
Author: Ian Kent <[email protected]>
Date: Tue Oct 28 11:19:07 2008 -0400

Fixed a warings the IPV6 client routines

Signed-off-by: Steve Dickson <[email protected]>

commit 338af7f9f00e096b65a6d823f885c4eeaf1d1f8c
Author: Steve Dickson <[email protected]>
Date: Mon Oct 27 12:46:54 2008 -0400

__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.

Signed-off-by: Steve Dickson <[email protected]>

commit d9a5ae7079d001a9e3b9b384f9153f591a7158bd
Author: Olaf Kirch <[email protected]>
Date: Tue Sep 30 15:10:43 2008 -0400

Fix __rpc_getconfip

__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 <[email protected]>
Signed-off-by: Steve Dickson <[email protected]>

commit 6c487efe74adb5c29f7bee5bd51b3ebef4968f7d
Author: Olaf Kirch <[email protected]>
Date: Tue Sep 30 15:09:06 2008 -0400

Fix getpeereid

getpeereid fails because it uses an incorrect getsockopt call to obtain
the peer credentials on a AF_LOCAL socket. This in turn will cause all
RPC services to be registered with rpcbind to show up as having been
registered by "unknown".

This has a serious impact on security - a service owned by "unknown"
can essentially be unregistered (and thus replaced) by anyone.

Signed-off-by: Olaf Kirch <[email protected]>
Signed-off-by: Steve Dickson <[email protected]>

commit 851b0f5c6dca22d634603f03f0a5e3e35c6db867
Author: Olaf Kirch <[email protected]>
Date: Tue Sep 30 15:08:07 2008 -0400

svc_getcaller_netbuf macro seems broken

I haven't found any documentation, but the comment in the header
file seems to suggest that svc_getcaller_netbuf should return the
xp_rtaddr netbuf. Returning the address of the socket descripor
seems to be wrong at any rate.

Signed-off-by: Olaf Kirch <[email protected]>
Signed-off-by: Steve Dickson <[email protected]>

commit d94b92d5125242ce595c1baf42a1e6d1004b7756
Author: Olaf Kirch <[email protected]>
Date: Tue Sep 30 15:06:54 2008 -0400

Introduce __rpc_set_netbuf helper

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 <[email protected]>
Signed-off-by: Steve Dickson <[email protected]>

commit da5f9861ea3bae59c8eead26d38334721caa9f0a
Author: Olaf Kirch <[email protected]>
Date: Tue Sep 30 15:05:20 2008 -0400

Kill map_ipv4_to_ipv6

After the change to svc_vc.c performed in the previous patch,
this function is no longer needed.

Signed-off-by: Olaf Kirch <[email protected]>
Signed-off-by: Steve Dickson <[email protected]>

commit 59c374c4b507aeca957ed0096d98006edf601375
Author: Olaf Kirch <[email protected]>
Date: Tue Sep 30 15:04:17 2008 -0400

Fix xp_raddr handling in svc_fd_create etc

Currently svc_fd_create tries to do some clever tricks
with IPv4/v6 address mapping.

This is broken for several reasons.
1. We don't want IPv4 based transport to look like IPv6
transports. Old applications compiled against tirpc
will expect AF_INET addresses, and are not equipped
to deal with AF_INET6.
2. There's a buffer overflow.
memcpy(&sin6, &ss, sizeof(ss));
copies a full struct sockaddr to a sockaddr_in6 on
the stack. Unlikely to be exploitable, but I wonder
if this ever worked....

Signed-off-by: Olaf Kirch <[email protected]>
Signed-off-by: Steve Dickson <[email protected]>

commit 628788c1cc84c86ee4cb36ee5d4fe8954e90fca5
Author: Steve Dickson <[email protected]>
Date: Tue Sep 16 11:32:31 2008 -0400

- Fixed version-info in src/Makefile.am to reflect the correct version
- Fixed some of warnings in: src/auth_time.c, src/clnt_dg.c and
src/clnt_raw.c
- Added some #ifdef NOTUSED around some code in src/rpbc_clnt.c
that was not being used...

Signed-off-by: Steve Dickson <[email protected]>

commit 9e7ba0c7a02031294fefadfbca42b3dd5f2d841f
Author: Olaf Kirch <[email protected]>
Date: Tue Sep 16 08:46:29 2008 -0400

Fix for taddr2addr conversion bug of local addresses

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: [email protected]
Signed-off-by: Steve Dickson <[email protected]>

commit ea9f048761d0b9a2ab6310bffa07351f0b04d8c5
Author: Olaf Kirch <[email protected]>
Date: Tue Sep 2 12:11:15 2008 -0400

Always make IPv6 sockets V6ONLY

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 <[email protected]>
Signed-off-by: Steve Dickson <[email protected]>

commit 95c8f7227e6b15f2e430d7b87dadc95b2acd4a61
Author: Olaf Kirch <[email protected]>
Date: Tue Sep 2 12:09:39 2008 -0400

Fix incorrect sizeof() in __rpc_getbroadifs

__rpc_getbroadifs returns bad broadcast addresses on 32bit
machines because when copying the broadcast addresses, ite
applies the sizeof() operator to a pointer to a sockaddr,
rather than the sockaddr itself.

Signed-off-by: Olaf Kirch <[email protected]>
Signed-off-by: Steve Dickson <[email protected]>

2004-10-13 Antoine Fraticelli <[email protected]>

* Version 0.1 released.

2005-01-07 Gilles Quillard <[email protected]>

* Version 0.1.5 Fix problems links to the use of Kerberos.
2 changes: 2 additions & 0 deletions libtirpc/HACKING
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Patches can be sent to [email protected] with a CC
to [email protected]
Loading

0 comments on commit b3eed8b

Please sign in to comment.