Enable TIRPC support for Linux

This is enabled by default.  To disable, add:

in the config/cf/site.def or host.def file.

You will need to have the libtirpc-dev package installed.

The benefit is that you will no longer need to run rpcbind in insecure
mode (the -i option).  There are other benefits we may be able to take
advantage of in the future, like supporting IPV6 for ToolTalk.
This commit is contained in:
Jon Trulson
2018-04-11 18:48:53 -06:00
parent 13d3e1db50
commit 17101b6f4c
25 changed files with 53 additions and 29 deletions

View File

@@ -5,5 +5,7 @@ XCOMM $TOG: Imakefile /main/7 1998/08/10 18:01:46 mgreess $
SUBDIRS = mini_isam lib slib bin
LINTSUBDIRS = mini_isam lib slib bin
INCLUDES = $(TIRPCINC)
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))

View File

@@ -5,6 +5,8 @@ XCOMM $TOG: Imakefile /main/8 1999/08/30 14:33:22 mgreess $
SUBDIRS = dbck shell scripts tt_type_comp \
ttauth ttdbserverd ttsession tttar tttrace
INCLUDES = $(TIRPCINC)
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
LintSubdirs($(SUBDIRS))

View File

@@ -9,7 +9,7 @@ EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I. -I../../slib -I../../lib -I../../mini_isam
INCLUDES = $(TIRPCINC) -I. -I../../slib -I../../lib -I../../mini_isam
DEPLIBS = ../../slib/libstt.a TtClientDepLibs ../../mini_isam/libisam.a
LOCAL_LIBRARIES = ../../slib/libstt.a TtClientLibs ../../mini_isam/libisam.a

View File

@@ -5,6 +5,7 @@ XCOMM $XConsortium: Imakefile /main/4 1996/04/21 19:11:31 drk $
/* Any shell scripts shipped as part of ToolTalk are collected here. */
PROGRAMS = ttce2xdr
INCLUDES = $(TIRPCINC)
all:: $(PROGRAMS)

View File

@@ -9,7 +9,7 @@ EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I. -I../../lib
INCLUDES = $(TIRPCINC) -I. -I../../lib
DEPLIBS = TtClientDepLibs
LOCAL_LIBRARIES = TtClientLibs

View File

@@ -9,7 +9,7 @@ EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I../../lib -I../../slib
INCLUDES = $(TIRPCINC) -I../../lib -I../../slib
DEPLIBS = ../../slib/libstt.a TtClientDepLibs
LOCAL_LIBRARIES = ../../slib/libstt.a TtClientLibs

View File

@@ -5,7 +5,7 @@ XCOMM $TOG: Imakefile /main/1 1999/08/30 10:44:56 mgreess $
DEFINES =
CONN_DEFINES = ConnectionFlags
INCLUDES = -I. -I../../slib -I../../lib
INCLUDES = $(TIRPCINC) -I. -I../../slib -I../../lib
DEPLIBS = TtClientDepLibs
LOCAL_LIBRARIES = TtClientLibs

View File

@@ -8,8 +8,8 @@ EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I. -I../../slib -I../../lib -I../../mini_isam
DEFINES = $(TIRPC_DEFINES)
INCLUDES = $(TIRPCINC) -I. -I../../slib -I../../lib -I../../mini_isam
DEPLIBS = ../../slib/libstt.a TtClientDepLibs ../../mini_isam/libisam.a
LOCAL_LIBRARIES = ../../slib/libstt.a TtClientLibs ../../mini_isam/libisam.a

View File

@@ -2105,12 +2105,13 @@ bool_t msg_q_lock(int isfd, const char *record, int length, SVCXPRT *transp)
// (with a 16 byte key, the rec length must be at least 31)
if ((length > 30) && !memcmp(record+16, "_TT_QUEUED_MSGS", 15)) {
// Get the address of the client
#if defined(OPT_TLI)
#if defined(OPT_TLI) || defined(OPT_TIRPC)
netbuf *client_address = svc_getrpccaller(transp);
_Tt_string client_id(client_address->len);
memcpy((char *)client_id, client_address->buf, client_address->len);
#else
struct sockaddr_in *client_address = svc_getcaller(transp);
_Tt_string client_id(sizeof(struct in_addr));
memcpy( (char *)client_id, &client_address->sin_addr,
sizeof(struct in_addr) );
@@ -2129,7 +2130,7 @@ bool_t msg_q_lock(int isfd, const char *record, int length, SVCXPRT *transp)
// (with a 16 byte key, the rec length must be at least 27)
else if ((length > 26) && !memcmp(record+16, "_TT_MSG_", 8)) {
// Get the address of the client
#if defined(OPT_TLI)
#if defined(OPT_TLI) || defined(OPT_TIRPC)
netbuf *client_address = svc_getrpccaller(transp);
_Tt_string client_id(client_address->len);
(void)memcpy((char *)client_id, client_address->buf, client_address->len);

View File

@@ -9,7 +9,7 @@ EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I. -I../../slib -I../../lib
INCLUDES = $(TIRPCINC) -I. -I../../slib -I../../lib
DEPLIBS = ../../slib/libstt.a TtClientDepLibs
LOCAL_LIBRARIES = ../../slib/libstt.a TtClientLibs

View File

@@ -9,7 +9,7 @@ EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I. -I../../lib
INCLUDES = $(TIRPCINC) -I. -I../../lib
DEPLIBS = ../../slib/libstt.a TtClientDepLibs ../../mini_isam/libisam.a
LOCAL_LIBRARIES = ../../slib/libstt.a TtClientLibs ../../mini_isam/libisam.a

View File

@@ -9,7 +9,7 @@ EXTRA_LOAD_FLAGS = ExtraLoadFlags $(UNSHARED_CXXLIB)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I. -I../../lib
INCLUDES = $(TIRPCINC) -I. -I../../lib
DEPLIBS = TtClientDepLibs
LOCAL_LIBRARIES = TtClientLibs

View File

@@ -31,7 +31,7 @@ DependSubdirs($(SUBDIRS))
#include "../tooltalk.tmpl"
DEFINES =
INCLUDES = -I.
INCLUDES = $(TIRPCINC) -I.
#ifdef RsArchitecture
REALPATHC = realpath.c

View File

@@ -5,6 +5,8 @@ XCOMM $TOG: Imakefile /main/6 1998/08/10 18:00:37 mgreess $
SUBDIRS = c dnd
DONES = c/DONE dnd/DONE
INCLUDES = $(TIRPCINC)
MakeSubdirs($(SUBDIRS))
ForceSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))

View File

@@ -19,7 +19,7 @@ DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
#include "../../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I../../../lib
INCLUDES = $(TIRPCINC) -I../../../lib
/*** NOTE!
*** Every time a .o is added below it needs to be added to

View File

@@ -13,7 +13,7 @@ XCOMM $XConsortium: Imakefile /main/6 1996/04/21 19:12:16 drk $
#include "../../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I../..
INCLUDES = $(TIRPCINC) -I../..
/*** NOTE!
*** Every time a .o is added below it needs to be added to

View File

@@ -16,7 +16,7 @@ DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(ISAM_INCLUDES) $(DEPENDDEFINES)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I../../lib
INCLUDES = $(TIRPCINC) -I../../lib
ISAM_INCLUDES = -I../../mini_isam
/*** NOTE!

View File

@@ -16,7 +16,7 @@ DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(ISAM_INCLUDES) $(DEPENDDEFINES)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I../../lib
INCLUDES = $(TIRPCINC) -I../../lib
ISAM_INCLUDES = -I../../mini_isam
/* Use BSD-compatible accept() call */

View File

@@ -19,7 +19,7 @@ DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I../../lib
INCLUDES = $(TIRPCINC) -I../../lib
/*** NOTE!
*** Every time a .o is added below it needs to be added to

View File

@@ -16,7 +16,7 @@ DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
#include "../../tooltalk.tmpl"
DEFINES =
INCLUDES = -I../../lib
INCLUDES = $(TIRPCINC) -I../../lib
#ifdef RsArchitecture
/* To get definitions of iswprint and iswspace */

View File

@@ -12,7 +12,7 @@ XCOMM $XConsortium: Imakefile /main/4 1996/04/21 19:12:37 drk $
#include "../tooltalk.tmpl"
DEPEND_DEFINES = $(DEPENDDEFINES)
INCLUDES = -I.
INCLUDES = $(TIRPCINC) -I.
SRCS = isaddindex.c isamaddindex.c isopen.c isamopen.c \
isdelcurr.c isdelrec.c isamdelrec.c isbuild.c \

View File

@@ -15,7 +15,7 @@ DEPEND_DEFINES = $(CXXDEPENDINCLUDES) $(DEPENDDEFINES)
#include "../tooltalk.tmpl"
DEFINES =
INCLUDES = -I. -I../lib
INCLUDES = $(TIRPCINC) -I. -I../lib
SRCS = \
mp_ce_attrs.C mp_observer.C mp_observer_utils.C \

View File

@@ -19,6 +19,17 @@ DEPTTLIB_AND_MAYBE_XLIB = $(DEPTTLIB)
/* put EXTRA_DEFINES and EXTRA_INCLUDES below */
/* For linux with TIRPC, set this so the right bits can/will be used. */
XCOMM Enable TIRPC for linux hosts with the option enabled
#ifdef LinuxArchitecture
# if HasTIRPCLib
TIRPC_DEFINES = -DOPT_TIRPC
# else
TIRPC_DEFINES =
# endif
#endif
#ifdef SunArchitecture
LAST_LOAD_FLAGS = -Bstatic -lC -Bdynamic -lm -lc -Bstatic
#endif