Move daemon.c into a new library of utility routines for linking our programs
authorKen Raeburn <raeburn@mit.edu>
Tue, 24 Feb 2004 19:24:25 +0000 (19:24 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 24 Feb 2004 19:24:25 +0000 (19:24 +0000)
against but which we don't want to install as a separate library.

Change Kerberos and application servers to link against the library if they
might need the replacement daemon() function.

Add a dummy file to the library in case daemon() is not needed, so we don't
have an empty library, which we may not handle properly.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16118 dc483132-0cff-0310-8789-dd5450dbe970

24 files changed:
src/ChangeLog
src/aclocal.m4
src/appl/bsd/ChangeLog
src/appl/bsd/Makefile.in
src/config/ChangeLog
src/config/post.in
src/config/pre.in
src/configure.in
src/kadmin/server/ChangeLog
src/kadmin/server/Makefile.in
src/kdc/ChangeLog
src/kdc/Makefile.in
src/krb524/ChangeLog
src/krb524/Makefile.in
src/lib/krb5/posix/ChangeLog
src/slave/ChangeLog
src/slave/Makefile.in
src/util/ChangeLog
src/util/Makefile.in
src/util/apputils/ChangeLog [new file with mode: 0644]
src/util/apputils/Makefile.in [new file with mode: 0644]
src/util/apputils/configure.in [new file with mode: 0644]
src/util/apputils/daemon.c [moved from src/lib/krb5/posix/daemon.c with 100% similarity]
src/util/apputils/dummy.c [new file with mode: 0644]

index 7306fd01e5188915af2b19c4dd0114483e87de2c..b8e1472466668c82aadc27cedc9bfbb83fbdb068 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * aclocal.m4 (KRB5_AC_NEED_DAEMON): Don't use AC_REPLACE_FUNCS.
+       * configure.in: Configure util/apputils.
+
 2004-02-13  Ken Raeburn  <raeburn@mit.edu>
 
        * aclocal.m4 (TRY_PEER_INT): Deleted.
index 0bcefa3b9eca658d2d21c5a48f44ba683b0b2e0e..030925f950ec20fa6590d4344b3c3ff4186e7c87 100644 (file)
@@ -657,7 +657,6 @@ AC_HELP_STRING([--with-netlib=LIBS], use user defined resolver library),
 dnl
 dnl
 AC_DEFUN(KRB5_AC_NEED_DAEMON, [
-AC_REPLACE_FUNCS(daemon)
 KRB5_NEED_PROTO([#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif],daemon,1)])dnl
index 253439c5241e1aa86675618bf4aaeee41af59534..5ccedd292e0a0c00a83f6e5ccb98080f75b84ed6 100644 (file)
@@ -1,3 +1,7 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * Makefile.in (kshd, klogind): Link against apputils lib.
+
 2003-08-29  Ken Raeburn  <raeburn@mit.edu>
 
        * configure.in: Call KRB5_AC_NEED_DAEMON instead of checking
index 5abbaba5e20af4e850bc74212491dd391a99dbdc..a806db507ef8e2a62c699c416b17213f267b5c97 100644 (file)
@@ -66,11 +66,11 @@ install::
                ${DESTDIR}$(CLIENT_MANDIR)/`echo $$f|sed '$(transform)'`.1; \
        fi
 
-kshd: krshd.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_DEPLIB) $(KRB4COMPAT_DEPLIBS)
-       $(CC_LINK) -o kshd krshd.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(KRSHDLIBS) $(PTY_LIB) $(KRB4COMPAT_LIBS)
+kshd: krshd.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_DEPLIB) $(KRB4COMPAT_DEPLIBS) $(APPUTILS_DEPLIB)
+       $(CC_LINK) -o kshd krshd.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(KRSHDLIBS) $(PTY_LIB) $(KRB4COMPAT_LIBS) $(APPUTILS_LIB)
 
-klogind: krlogind.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_DEPLIB) $(KRB4COMPAT_DEPLIBS)
-       $(CC_LINK) -o klogind krlogind.o  kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_LIB) $(KRB4COMPAT_LIBS)
+klogind: krlogind.o kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_DEPLIB) $(KRB4COMPAT_DEPLIBS) $(APPUTILS_DEPLIB)
+       $(CC_LINK) -o klogind krlogind.o  kcmd.o forward.o compat_recv.o $(SETENVOBJ) $(LIBOBJS) $(PTY_LIB) $(KRB4COMPAT_LIBS) $(APPUTILS_LIB)
 
 install::
        for f in kshd klogind; do \
index 2b0ff32d436cac82dde2a0782aaefd92e25251ef..20a11c3309eb02fca5407440b9d333580472c935 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * pre.in (APPUTILS_DEPLIB, APPUTILS_LIB): New vars.
+       * post.in (daemon.c): Delete rule for copying source file.
+
 2004-02-18  Tom Yu  <tlyu@mit.edu>
 
        * shlib.conf (alpha-*-dec-osf*, mips-sgi-irix*): Use $(CC) instead
index 1401a80ef1643b9f315c7985bcd20e6ec40e7444..85f6bb9827c5f35c5758efe4794e7c6cc4796d89 100644 (file)
@@ -193,12 +193,6 @@ $(RECURSE_TARGETS):
        fi;\
        exit $$status
 
-# Some servers need "daemon", but we're not providing it directly
-# through a library.  We used to provide it through the krb5 library,
-# and the source is still there.
-daemon.c: $(SRCTOP)/lib/krb5/posix/daemon.c
-       $(CP) $(SRCTOP)/lib/krb5/posix/daemon.c daemon.c
-
 ##
 ## end of post.in
 ############################################################
index 34f91b7e09e0fb27f17c63d2bed882c942d4fec0..4881e294aa11c8ca5a3e8265ee9190666101d11d 100644 (file)
@@ -296,6 +296,7 @@ SS_DEPLIB   = $(SS_DEPLIB-@SS_VERSION@)
 SS_DEPLIB-k5   = $(TOPLIBD)/libss.a
 SS_DEPLIB-sys  =
 PTY_DEPLIB     = $(TOPLIBD)/libpty.a
+APPUTILS_DEPLIB        = $(TOPLIBD)/libapputils.a
 
 KRB5_BASE_DEPLIBS      = $(KRB5_DEPLIB) $(CRYPTO_DEPLIB) $(COM_ERR_DEPLIB)
 KRB4COMPAT_DEPLIBS     = $(KRB4_DEPLIB) $(DES425_DEPLIB) $(KRB5_BASE_DEPLIBS)
@@ -371,6 +372,10 @@ KADMCLNT_LIBS      = -lkadm5clnt $(KADM_COMM_LIBS)
 # need fixing if ever used on Mac OS X!
 PTY_LIB                = -lpty
 
+# Misc stuff for linking server programs (and maybe some others,
+# eventually) but which we don't want to install.
+APPUTILS_LIB   = -lapputils
+
 #
 # some more stuff for --with-krb4
 KRB4_LIBPATH   = @KRB4_LIBPATH@
index 0d95002607d02624944d3a758b663fb24f1bb4bb..4dc3d68bb9624cdf44d5105c3755b23521e0e57f 100644 (file)
@@ -64,7 +64,7 @@ AC_CONFIG_SUBDIRS(util/profile util/pty)
 if test "$DB_VERSION" = k5 ; then
   AC_CONFIG_SUBDIRS(util/db2)
 fi
-AC_CONFIG_SUBDIRS(include lib/crypto lib/krb5 lib/des425)
+AC_CONFIG_SUBDIRS(include lib/crypto lib/krb5 lib/des425 util/apputils)
 if test -n "$KRB4_LIB"; then
   AC_CONFIG_SUBDIRS(lib/krb4)
 fi
index f5f29f644a4d6f87892e141580f97f4bcef2627c..272e533280966b41c5ea1686635ecf4a4e13c38d 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * Makefile.in (OBJS, $(PROG)): Link against apputils lib instead
+       of using LIBOBJS.
+
 2003-09-02  Alexandra Ellwood  <lxs@mit.edu>
 
        * ovsec_kadmd.c: Added Apple password server support.
index 21e6aab6cb575809b1d66f447a6b25db6d309447..17406e77a2fe6663362786352df3f39ed080be60 100644 (file)
@@ -10,12 +10,12 @@ PROG_LIBPATH=-L$(TOPLIBD)
 PROG_RPATH=$(KRB5_LIBDIR)
 
 PROG = kadmind
-OBJS = kadm_rpc_svc.o server_stubs.o ovsec_kadmd.o schpw.o misc.o server_glue_v1.o @LIBOBJS@
+OBJS = kadm_rpc_svc.o server_stubs.o ovsec_kadmd.o schpw.o misc.o server_glue_v1.o
 
 all:: $(PROG)
 
-$(PROG): $(OBJS) $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS)
-       $(CC_LINK) -o $(PROG) $(OBJS) $(KADMSRV_LIBS) $(KRB5_BASE_LIBS)
+$(PROG): $(OBJS) $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS) $(APPUTILS_DEPLIB)
+       $(CC_LINK) -o $(PROG) $(OBJS) $(KADMSRV_LIBS) $(KRB5_BASE_LIBS) $(APPUTILS_LIB)
 
 install::
        $(INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(SERVER_BINDIR)/$(PROG)
index 0732bf918a179fc52595dde3d6f778085ecfa650..ccc42d629a0ab2dd173b3a46aa67a1fa2e54d13b 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * Makefile.in (OBJS, krb5kdc, fakeka): Link against apputils lib
+       instead of using LIBOBJ.
+
 2004-02-19  Ken Hornstein  <kenh@mit.edu>
 
        * fakeka.c (main): Bug from David Thompson <thomas@cs.wisc.edu>.
index efbc928570a64243df49bfff5518325f538e934c..d3079f6e7cd770d5073bd95e358ec29866dc2702 100644 (file)
@@ -46,8 +46,7 @@ OBJS= \
        policy.o \
        extern.o \
        replay.o \
-       kerberos_v4.o \
-       @LIBOBJS@
+       kerberos_v4.o
 
 RT_OBJS= rtest.o \
        kdc_util.o \
@@ -68,14 +67,14 @@ kdc5_err.h: kdc5_err.et
 
 kdc5_err.o: kdc5_err.h
 
-krb5kdc: $(OBJS) $(KADMSRV_DEPLIBS) $(KRB4COMPAT_DEPLIBS)
-       $(CC_LINK) -o krb5kdc $(OBJS) $(KADMSRV_LIBS) $(KRB4COMPAT_LIBS)
+krb5kdc: $(OBJS) $(KADMSRV_DEPLIBS) $(KRB4COMPAT_DEPLIBS) $(APPUTILS_DEPLIB)
+       $(CC_LINK) -o krb5kdc $(OBJS) $(KADMSRV_LIBS) $(KRB4COMPAT_LIBS) $(APPUTILS_LIB)
 
 rtest: $(RT_OBJS) $(KDB5_DEPLIBS) $(KADM_COMM_DEPLIBS) $(KRB5_BASE_DEPLIBS)
        $(CC_LINK) -o rtest $(RT_OBJS) $(KDB5_LIBS) $(KADM_COMM_LIBS) $(KRB5_BASE_LIBS)
 
-fakeka: fakeka.o $(KADMSRV_DEPLIBS) $(KRB4COMPAT_DEPLIBS) @LIBOBJS@
-       $(CC_LINK) -o fakeka fakeka.o $(KADMSRV_LIBS) $(KRB4COMPAT_LIBS) @LIBOBJS@
+fakeka: fakeka.o $(KADMSRV_DEPLIBS) $(KRB4COMPAT_DEPLIBS) $(APPUTILS_DEPLIB)
+       $(CC_LINK) -o fakeka fakeka.o $(KADMSRV_LIBS) $(KRB4COMPAT_LIBS) $(APPUTILS_LIB)
 
 check-unix:: rtest
        KRB5_CONFIG=$(SRCTOP)/config-files/krb5.conf ; export KRB5_CONFIG ;\
index 3e5cdb1bf779147fef5686d61fec64af6245a76c..4f135632027de134f91093088787dbaa03c04d71 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * Makefile.in (SERVER_OBJS, krb524d): Link against apputils lib
+       instead of using LIBOBJS.
+
 2003-12-15  Ezra Peisach  <epeisach@mit.edu>
 
        * Makefile.in (clean-unix): Clean up more files now that STLIBOBS
index a451a84c19da2cfdec0a80679bc6d9cdd15393e3..8dcd19d1eda609f12dc227117c993facde7b36fe 100644 (file)
@@ -74,11 +74,11 @@ all-windows:: $(OUTPRE)k524init.exe $(K524LIB)
 krb524test: test.o $(KRB5_DEPLIB) $(KRB4COMPAT_DEPLIBS)
        $(CC_LINK) -o krb524test test.o $(KRB5_LIB) $(KRB4COMPAT_LIBS)
 
-SERVER_OBJS= krb524d.o cnv_tkt_skey.o conv_princ.o @LIBOBJS@
+SERVER_OBJS= krb524d.o cnv_tkt_skey.o conv_princ.o
 CLIENT_OBJS= $(OUTPRE)k524init.$(OBJEXT)
 
-krb524d: $(SERVER_OBJS) $(KADMSRV_DEPLIBS) $(KRB5_DEPLIB) $(KRB4COMPAT_DEPLIBS)
-       $(CC_LINK) -o krb524d $(SERVER_OBJS) $(KADMSRV_LIBS) $(KRB5_LIB) $(KRB4COMPAT_LIBS)
+krb524d: $(SERVER_OBJS) $(KADMSRV_DEPLIBS) $(KRB5_DEPLIB) $(KRB4COMPAT_DEPLIBS) $(APPUTILS_DEPLIB)
+       $(CC_LINK) -o krb524d $(SERVER_OBJS) $(KADMSRV_LIBS) $(KRB5_LIB) $(KRB4COMPAT_LIBS) $(APPUTILS_LIB)
 
 k524init: $(CLIENT_OBJS) $(KRB5_DEPLIB) $(KRB4COMPAT_DEPLIBS)
        $(CC_LINK) -o k524init $(CLIENT_OBJS) $(KRB5_LIB) $(KRB4COMPAT_LIBS)
index 8c0f0edec4edcdc1e25ecca1cf70d3f984609f03..9ba5e103378dd7d329f8586b69f80c35dc5f2c37 100644 (file)
@@ -1,3 +1,7 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * daemon.c: Moved to util/apputils.
+
 2003-08-21  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in (STLIBOBJS, OBJS): Empty.
index 7a07be47cfc92cdf0f020c416f928ace8a442f66..ef545392f94993b70a7eb2e744ccd4137094497b 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * Makefile.in (SERVEROBJS, kpropd): Link against apputils lib
+       instead of using LIBOBJS.
+
 2003-08-29  Ken Raeburn  <raeburn@mit.edu>
 
        * configure.in: Call KRB5_AC_NEED_DAEMON instead of checking
index 3f12fc134f261c4439bc0a61f6b6fad122ba5621..3ef6d5617ddc7d12d41758a8fb38e2da06c6bd0e 100644 (file)
@@ -11,7 +11,7 @@ CLIENTSRCS= $(srcdir)/kprop.c
 CLIENTOBJS= kprop.o 
 
 SERVERSRCS= $(srcdir)/kpropd.c 
-SERVEROBJS= kpropd.o @LIBOBJS@
+SERVEROBJS= kpropd.o
 
 SRCS= $(CLIENTSRCS) $(SERVERSRCS)
 
@@ -19,8 +19,8 @@ SRCS= $(CLIENTSRCS) $(SERVERSRCS)
 kprop: $(CLIENTOBJS) $(KRB5_BASE_DEPLIBS)
        $(CC_LINK) -o kprop $(CLIENTOBJS) $(KRB5_BASE_LIBS)
 
-kpropd: $(SERVEROBJS) $(KRB5_BASE_DEPLIBS)
-       $(CC_LINK) -o kpropd $(SERVEROBJS) $(KRB5_BASE_LIBS)
+kpropd: $(SERVEROBJS) $(KRB5_BASE_DEPLIBS) $(APPUTILS_DEPLIB)
+       $(CC_LINK) -o kpropd $(SERVEROBJS) $(KRB5_BASE_LIBS) $(APPUTILS_LIB)
 
 install::
        for f in kprop kpropd; do \
index 0c1e44f211c2153f9583ff9a0e57633d44ccbb8b..7273cf5e4ea97178024d6de6e7e83f7de1282250 100644 (file)
@@ -1,3 +1,7 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * Makefile.in (MY_SUBDIRS): Build in apputils dir.
+
 2004-02-12  Tom Yu  <tlyu@mit.edu>
 
        * Makefile.in (all-recurse): Remove exitsleep.
index dc5d9ddce90a0a6dcf010db7d4185db1c00e78f9..d04f4217fbb28afaca80338e1a87662036374fc5 100644 (file)
@@ -7,7 +7,7 @@ mydir=util
 ##WIN32### below in the 'all-windows' target anyways, so just hide this.
 ##WIN32##!if 0
 MY_SUBDIRS=$(MAYBE_ET_@COM_ERR_VERSION@) $(MAYBE_SS_@SS_VERSION@) \
-       profile pty $(MAYBE_DB_@DB_VERSION@) send-pr
+       profile pty $(MAYBE_DB_@DB_VERSION@) send-pr apputils
 ##WIN32##!endif
 BUILDTOP=$(REL)..
 
diff --git a/src/util/apputils/ChangeLog b/src/util/apputils/ChangeLog
new file mode 100644 (file)
index 0000000..68305d9
--- /dev/null
@@ -0,0 +1,6 @@
+2004-02-24  Ken Raeburn  <raeburn@mit.edu>
+
+       * New directory.
+       * Makefile.in, configure.in, dummy.c: New files.
+       * daemon.c: Moved here from lib/krb5/posix.
+
diff --git a/src/util/apputils/Makefile.in b/src/util/apputils/Makefile.in
new file mode 100644 (file)
index 0000000..1509646
--- /dev/null
@@ -0,0 +1,47 @@
+prefix=@prefix@
+bindir=@bindir@
+datadir=@datadir@
+mydatadir=$(datadir)/apputils
+thisconfigdir=.
+myfulldir=util/apputils
+mydir=.
+BUILDTOP=$(REL)..$(S)..
+RELDIR=../util/apputils
+SED = sed
+
+##DOS##BUILDTOP = ..\..
+##DOS##LIBNAME=$(OUTPRE)apputils.lib
+##DOS##XTRA=
+##DOS##OBJFILE=$(OUTPRE)apputils.lst
+
+# LIBOBJS may or may not contain daemon.o; dummy.o is just here to
+# avoid having an empty library.
+STLIBOBJS=dummy.o @LIBOBJS@
+STOBJLISTS=OBJS.ST
+LIB=apputils
+
+all-unix:: all-liblinks
+clean-unix:: clean-liblinks clean-libs clean-libobjs
+install-unix:: install-libs
+
+LINTFLAGS=-uhvb 
+LINTFILES= daemon.c
+LIBOBJS=$(OUTPRE)daemon.$(OBJEXT)
+
+SRCS=  $(srcdir)/daemon.c \
+       $(srcdir)/dummy.c
+
+# @lib_frag@
+# @libobj_frag@
+
+# +++ Dependency line eater +++
+# 
+# Makefile dependencies follow.  This must be the last section in
+# the Makefile.in file
+#
+error_message.so error_message.po $(OUTPRE)error_message.$(OBJEXT): error_message.c com_err.h \
+  error_table.h
+et_name.so et_name.po $(OUTPRE)et_name.$(OBJEXT): et_name.c com_err.h error_table.h
+init_et.so init_et.po $(OUTPRE)init_et.$(OBJEXT): init_et.c com_err.h error_table.h
+com_err.so com_err.po $(OUTPRE)com_err.$(OBJEXT): com_err.c com_err.h error_table.h
+
diff --git a/src/util/apputils/configure.in b/src/util/apputils/configure.in
new file mode 100644 (file)
index 0000000..efc4fcb
--- /dev/null
@@ -0,0 +1,6 @@
+AC_INIT(daemon.c)
+CONFIG_RULES
+AC_REPLACE_FUNCS(daemon)
+KRB5_BUILD_LIBRARY_STATIC
+KRB5_BUILD_LIBOBJS
+V5_AC_OUTPUT_MAKEFILE
diff --git a/src/util/apputils/dummy.c b/src/util/apputils/dummy.c
new file mode 100644 (file)
index 0000000..d5b6cc0
--- /dev/null
@@ -0,0 +1 @@
+int lib_server_dummy = 0;