diff options
author | Greg Hudson <ghudson@mit.edu> | 2010-11-25 20:28:30 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2010-11-25 20:28:30 +0000 |
commit | 530043377ee6f39b9ca95c13f6260602e6fe7674 (patch) | |
tree | 28fd4b42c486d7097c4cd537d90042bb5fda3852 /src/util | |
parent | e9dd6e21afc9af2237e9ae5590ad5a67e52fb24e (diff) | |
download | krb5-530043377ee6f39b9ca95c13f6260602e6fe7674.zip krb5-530043377ee6f39b9ca95c13f6260602e6fe7674.tar.gz krb5-530043377ee6f39b9ca95c13f6260602e6fe7674.tar.bz2 |
Fix Windows build
Repair the Windows build. Tested with the prepare-on-Unix method.
Some specific changes include:
* Removed the IPC finalizer (no longer used after r20787) from
ccapi/lib/ccapi_ipc.c, as it was creating a difficult dependency
chain for the pingtest build in ccapi/test. Also updated pingtest
to use the k5_ipc_stream interfaces since cci_stream is gone.
* Reverted the apparently non-functional r20277.
* klist -V prints just "Kerberos for Windows", since it has no access
to PACKAGE_NAME and PACKAGE_VERSION from autoconf. This should be
addressed correctly.
* krb5, telnet, gssftp, and NIM are removed from the build.
* Some files had CRLFs; these were replaced with LFs and the
svn:eol-style property set on the files. Otherwise the CRLFs became
CRCRLFs after the zip transfer.
* Windows does not have opendir/readdir, so added Windows code to
prof_parse.c for includedir. Probable fodder for a libkrb5support
portability shim.
ticket: 6826
target_version: 1.9
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24533 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/profile/Makefile.in | 4 | ||||
-rw-r--r-- | src/util/profile/prof_parse.c | 39 |
2 files changed, 43 insertions, 0 deletions
diff --git a/src/util/profile/Makefile.in b/src/util/profile/Makefile.in index 33a1321..b857d43 100644 --- a/src/util/profile/Makefile.in +++ b/src/util/profile/Makefile.in @@ -105,8 +105,12 @@ $(OUTPRE)test_profile.exe: $(CC) $(CFLAGS2) -o test_profile.exe test_profile.c prof_init.c \ prof_file.c prof_parse.c prof_tree.c /link /stack:16384 +##DOS##!if 0 profile.h: prof_err.h profile.hin cat $(srcdir)/profile.hin prof_err.h > $@ +##DOS##!endif +##DOS##profile.h: prof_err.h profile.hin +##DOS## copy /b profile.hin+prof_err.h $@ prof_err.h: $(srcdir)/prof_err.et diff --git a/src/util/profile/prof_parse.c b/src/util/profile/prof_parse.c index 85bd912..8fab90b 100644 --- a/src/util/profile/prof_parse.c +++ b/src/util/profile/prof_parse.c @@ -9,7 +9,9 @@ #endif #include <errno.h> #include <ctype.h> +#ifndef _WIN32 #include <dirent.h> +#endif #define SECTION_SEP_CHAR '/' @@ -239,6 +241,42 @@ static int valid_name(const char *filename) */ static errcode_t parse_include_dir(char *dirname, struct parse_state *state) { +#ifdef _WIN32 + char *wildcard = NULL, *pathname; + WIN32_FIND_DATA ffd; + HANDLE handle; + errcode_t retval = 0; + + if (asprintf(&wildcard, "%s\\*", dirname) < 0) + return ENOMEM; + + handle = FindFirstFile(wildcard, &ffd); + if (handle == INVALID_HANDLE_VALUE) { + retval = PROF_FAIL_INCLUDE_DIR; + goto cleanup; + } + + do { + if (!valid_name(ffd.cFileName)) + continue; + if (asprintf(&pathname, "%s\\%s", dirname, ffd.cFileName) < 0) { + retval = ENOMEM; + break; + } + retval = parse_include_file(pathname, state); + free(pathname); + if (retval) + break; + } while (FindNextFile(handle, &ffd) != 0); + + FindClose(handle); + +cleanup: + free(wildcard); + return retval; + +#else /* not _WIN32 */ + DIR *dir; char *pathname; errcode_t retval = 0; @@ -261,6 +299,7 @@ static errcode_t parse_include_dir(char *dirname, struct parse_state *state) } closedir(dir); return retval; +#endif /* not _WIN32 */ } static errcode_t parse_line(char *line, struct parse_state *state) |