The size of kadm5_server_handle_rec differs between the client and
authorEzra Peisach <epeisach@mit.edu>
Fri, 20 Nov 2009 03:42:40 +0000 (03:42 +0000)
committerEzra Peisach <epeisach@mit.edu>
Fri, 20 Nov 2009 03:42:40 +0000 (03:42 +0000)
server code. Valgrind picked up on access past end of allocated
structure.  Include proper internal header in client/server test.

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

src/lib/kadm5/unit-test/Makefile.in
src/lib/kadm5/unit-test/handle-test.c

index 8afe66a3c82480fff98390a5790d3f173bafe58b..caa4e2d2f4c6db954571805360e6eb55fa0b410c 100644 (file)
@@ -23,10 +23,13 @@ destroy-test: destroy-test.o $(KADMCLNT_DEPLIBS) $(KRB5_BASE_DEPLIBS)
        $(CC_LINK) -o destroy-test destroy-test.o \
                $(KADMCLNT_LIBS) $(KRB5_BASE_LIBS)
 
-client-handle-test: handle-test.o $(KADMCLNT_DEPLIBS) $(KRB5_BASE_DEPLIBS)
-       $(CC_LINK) -o client-handle-test handle-test.o \
+client-handle-test: client-handle-test.o $(KADMCLNT_DEPLIBS) $(KRB5_BASE_DEPLIBS)
+       $(CC_LINK) -o client-handle-test client-handle-test.o \
                $(KADMCLNT_LIBS) $(KRB5_BASE_LIBS)
 
+client-handle-test.o: handle-test.c
+       $(CC) $(ALL_CFLAGS) -DCLIENT_TEST -o client-handle-test.o -c $(srcdir)/handle-test.c
+
 client-iter-test: iter-test.o $(KADMLCNT_DEPLIBS) $(KRB5_BASE_DEPLIBS)
        $(CC_LINK) -o client-iter-test iter-test.o \
                $(KADMCLNT_LIBS) $(KRB5_BASE_LIBS)
@@ -128,7 +131,7 @@ unit-test-server-body: site.exp test-handle-server lock-test
 clean::
        $(RM) init-test client_init.o init-test.o
        $(RM) destroy-test destroy-test.o
-       $(RM) client-handle-test handle-test.o
+       $(RM) client-handle-test handle-test.o client-handle-test.o
        $(RM) client-iter-test iter-test.o
        $(RM) randkey-test randkey-test.o
        $(RM) server-handle-test handle-test.o
index 56eac844a1b764f5f345d36a625f58606981ab2d..9f0e3feaa0b1857a610216d7188219859c37b3ce 100644 (file)
@@ -7,8 +7,12 @@
 #include <sys/file.h>
 #include <unistd.h>
 #include <netinet/in.h>
+#ifdef CLIENT_TEST
 #include <kadm5/client_internal.h>
-
+#else
+#include <kadm5/server_internal.h>
+#include <kadm5/admin.h>
+#endif
 
 int main(int argc, char *argv[])
 {