From bd68af5cea494a63697e89a322b70cf6c5dfd10e Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Tue, 9 May 1995 02:11:22 +0000 Subject: [PATCH] Add string.h if necessary to define strlen, etc. Add stdlib.h if present & necessary for malloc definition. (otherwise define ourselves) - based on other code present. Change ifdef POSIX to ifdef HAS_STDLIB_H Check for stdlib.h in configure.in git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5757 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb4/ChangeLog | 22 ++++++++++++++++++++++ src/lib/krb4/configure.in | 4 ++++ src/lib/krb4/g_pw_in_tkt.c | 1 + src/lib/krb4/g_svc_in_tkt.c | 1 + src/lib/krb4/memcache.c | 2 +- src/lib/krb4/mk_auth.c | 3 ++- src/lib/krb4/mk_preauth.c | 7 +++++++ src/lib/krb4/rd_preauth.c | 2 ++ src/lib/krb4/realmofhost.c | 2 +- src/lib/krb4/send_to_kdc.c | 2 +- 10 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/lib/krb4/ChangeLog b/src/lib/krb4/ChangeLog index 93f5bfda9..c59459df2 100644 --- a/src/lib/krb4/ChangeLog +++ b/src/lib/krb4/ChangeLog @@ -1,3 +1,25 @@ +Sun May 7 08:05:56 1995 Ezra Peisach + + * mk_preauth.c: Add and either or provide + prototypes for malloc. + + * g_svc_in_tkt.c: Add + + + * rd_preauth.c: Add + + * mk_auth.c: Include "krb4-proto.h" for get_phost definition. + + * g_pw_in_tkt.c (stub_key): Add + + * send_to_kdc.c: Ifdef on HAS_STDLIB_H not POSIX + + * realmofhost.c: Ifdef on HAS_STDLIB_H not POSIX + + * memcache.c: Ifdef on HAS_STDLIB_H not POSIX + + * configure.in: Check for stdlib.h + Thu May 4 10:03:22 1995 Tom Yu (tlyu@dragons-lair) * put_svc_key.c (put_svc_key): remove spurious & in front of fkey diff --git a/src/lib/krb4/configure.in b/src/lib/krb4/configure.in index cb83a794f..dd118adda 100644 --- a/src/lib/krb4/configure.in +++ b/src/lib/krb4/configure.in @@ -12,6 +12,10 @@ AC_CONST CHECK_FCNTL KRB5_POSIX_LOCKS AC_HEADER_CHECK(unistd.h,AC_DEFINE(HAS_UNISTD_H)) +dnl Could check for full stdc environment, but will only test +dnl for stdlib.h +AC_HEADER_CHECK(stdlib.h,AC_DEFINE(HAS_STDLIB_H)) + dnl need MSBFIRST, LSBFIRST, BITS16, BITS32 AC_MSG_CHECKING([if system is msbfirst]) AC_CACHE_VAL(krb5_cv_is_msbfirst, diff --git a/src/lib/krb4/g_pw_in_tkt.c b/src/lib/krb4/g_pw_in_tkt.c index 213540e69..079704b49 100644 --- a/src/lib/krb4/g_pw_in_tkt.c +++ b/src/lib/krb4/g_pw_in_tkt.c @@ -10,6 +10,7 @@ #include "mit-copyright.h" #include "krb.h" #include "prot.h" +#include #ifndef NULL #define NULL 0 diff --git a/src/lib/krb4/g_svc_in_tkt.c b/src/lib/krb4/g_svc_in_tkt.c index 72fae3be7..8006587c3 100644 --- a/src/lib/krb4/g_svc_in_tkt.c +++ b/src/lib/krb4/g_svc_in_tkt.c @@ -10,6 +10,7 @@ #include "mit-copyright.h" #include "krb.h" #include "prot.h" +#include #ifndef NULL #define NULL 0 diff --git a/src/lib/krb4/memcache.c b/src/lib/krb4/memcache.c index 3e622eb10..46376885c 100644 --- a/src/lib/krb4/memcache.c +++ b/src/lib/krb4/memcache.c @@ -29,7 +29,7 @@ #include #include -#ifdef POSIX +#ifdef HAS_STDLIB_H #include #else extern char *malloc (), *realloc (); diff --git a/src/lib/krb4/mk_auth.c b/src/lib/krb4/mk_auth.c index 60444dcf1..2b0928094 100644 --- a/src/lib/krb4/mk_auth.c +++ b/src/lib/krb4/mk_auth.c @@ -12,9 +12,10 @@ #include "mit-copyright.h" #define DEFINE_SOCKADDR /* Ask for sockets declarations from krb.h. */ +#include #include "krb.h" +#include "krb4-proto.h" #include -#include #include #define KRB_SENDAUTH_VERS "AUTHV0.1" /* MUST be KRB_SENDAUTH_VLEN chars */ diff --git a/src/lib/krb4/mk_preauth.c b/src/lib/krb4/mk_preauth.c index 3f4830747..5f26111c3 100644 --- a/src/lib/krb4/mk_preauth.c +++ b/src/lib/krb4/mk_preauth.c @@ -13,6 +13,13 @@ */ #include "krb.h" +#include + +#ifdef HAS_STDLIB_H +#include +#else +extern char *malloc(), *calloc(), *realloc(); +#endif /* Define a couple of function types including parameters. These are needed on MS-Windows to convert arguments of the function pointers diff --git a/src/lib/krb4/rd_preauth.c b/src/lib/krb4/rd_preauth.c index 65c2dcc71..a34d713ef 100644 --- a/src/lib/krb4/rd_preauth.c +++ b/src/lib/krb4/rd_preauth.c @@ -16,6 +16,8 @@ #include "krb_db.h" #include "prot.h" #include "des.h" +#include + /* #define KERB_ERR_PREAUTH_SHORT 11 */ /* #define KERB_ERR_PREAUTH_MISMATCH 12 */ diff --git a/src/lib/krb4/realmofhost.c b/src/lib/krb4/realmofhost.c index 3841e6a94..cff11cc8e 100644 --- a/src/lib/krb4/realmofhost.c +++ b/src/lib/krb4/realmofhost.c @@ -13,7 +13,7 @@ #include #include #include -#ifdef POSIX +#ifdef HAS_STDLIB_H #include #else extern char *malloc(); diff --git a/src/lib/krb4/send_to_kdc.c b/src/lib/krb4/send_to_kdc.c index f6bec2881..c3219fb6c 100644 --- a/src/lib/krb4/send_to_kdc.c +++ b/src/lib/krb4/send_to_kdc.c @@ -18,7 +18,7 @@ #define S_AD_SZ sizeof(struct sockaddr_in) -#ifdef POSIX +#ifdef HAS_STDLIB_H #include #else extern char *malloc(), *calloc(), *realloc(); -- 2.26.2