diff --git a/src/cmd/NTMakefile b/src/cmd/NTMakefile index 053a10cf04..9033e9b8a6 100644 --- a/src/cmd/NTMakefile +++ b/src/cmd/NTMakefile @@ -15,6 +15,8 @@ INCFILEDIR = $(DESTDIR)\include\afs INCFILES =\ $(INCFILEDIR)\cmd.h +HEIMDAL = ..\external\heimdal\krb5 + # build afscmd.lib LIBFILE = $(DESTDIR)\lib\afs\afscmd.lib @@ -23,11 +25,21 @@ LIBOBJS =\ $(OUT)\cmd_errors.obj \ $(OUT)\cmd.obj \ $(OUT)\AFS_component_version_number.obj - + +HEIMOBJS =\ + $(OUT)\config_file.obj \ + $(OUT)\expand_path.obj + $(LIBOBJS): $$(@B).c $(C2OBJ) $** -$(LIBFILE): $(LIBOBJS) +$(OUT)\expand_path.obj: $(HEIMDAL)\$$(@B).c + $(C2OBJ) -I$(HEIMDAL) -DEXPAND_PATH_HEADER $** + +$(OUT)\config_file.obj: $(HEIMDAL)\$$(@B).c + $(C2OBJ) -I$(HEIMDAL) -DKRB5_USE_PATH_TOKENS $** + +$(LIBFILE): $(LIBOBJS) $(HEIMOBJS) $(LIBARCH) $(INCFILES):$$(@F) diff --git a/src/cmd/krb5_locl.h b/src/cmd/krb5_locl.h index bbb1798138..fde8846034 100644 --- a/src/cmd/krb5_locl.h +++ b/src/cmd/krb5_locl.h @@ -7,22 +7,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include +#include +#include + #include "cmd.h" +#define PACKAGE "openafs" + #ifndef TRUE # define TRUE 1 #endif @@ -37,8 +30,6 @@ #define KRB5_DEPRECATED_FUNCTION(x) -#define KRB5_CONFIG_BADFORMAT CMD_BADFORMAT - #define N_(X,Y) X typedef struct cmd_config_binding krb5_config_binding; @@ -56,6 +47,41 @@ typedef int krb5_error_code; typedef int krb5_boolean; typedef time_t krb5_deltat; +static void krb5_set_error_message(krb5_context context, krb5_error_code ret, + const char *fmt, ...) { + return; +} + +#ifdef EXPAND_PATH_HEADER + +#include + +static int _krb5_expand_path_tokens(krb5_context, const char *, char**); + +int +_cmd_ExpandPathTokens(krb5_context context, const char *in, char **out) { + return _krb5_expand_path_tokens(context, in, out); +} + +HINSTANCE _krb5_hInstance = NULL; + +/* This bodge avoids the need for everything linking against cmd to also + * link against the shell library on Windows */ +#undef SHGetFolderPath +#define SHGetFolderPath internal_getpath + +HRESULT internal_getpath(void *a, int b, void *c, DWORD d, LPTSTR out) { + return E_INVALIDARG; +} + +#else + +#define KRB5_CONFIG_BADFORMAT CMD_BADFORMAT + +#define _krb5_expand_path_tokens _cmd_ExpandPathTokens + +extern int _cmd_ExpandPathTokens(krb5_context, const char *, char **); + static const void *_krb5_config_vget(krb5_context, const krb5_config_section *, int, va_list); @@ -92,10 +118,6 @@ KRB5_LIB_FUNCTION void krb5_clear_error_message(krb5_context context) { return; } -static void krb5_set_error_message(krb5_context context, krb5_error_code ret, - const char *fmt, ...) { - return; -} static int _krb5_homedir_access(krb5_context context) { return 0; @@ -115,6 +137,7 @@ krb5_abortx(krb5_context context, const char *fmt, ...) /* Wrappers */ + int cmd_RawConfigParseFileMulti(const char *fname, cmd_config_section **res) { return krb5_config_parse_file_multi(NULL, fname, res); @@ -187,3 +210,4 @@ cmd_RawConfigGetList(const cmd_config_section *c, ...) return ret; } +#endif