From: Theodore Tso Date: Wed, 12 Jun 1996 05:15:11 +0000 (+0000) Subject: net_read.c (krb5_net_read): X-Git-Tag: krb5-1.0-beta7~377 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1ee4675a31f2f568d4a4857caa6cfc72c519f42c;p=krb5.git net_read.c (krb5_net_read): net_write.c (krb5_net_write): In case of an error, on Windows machines, set errno from SOCKET_ERRNO, since the interface assumes the error is passed back the errno global varaible. This really needs to be fixed sometime... read_msg.c: If ECONNABORTED is not defined, try using the Winsock version of the error code (WSAECONNABORTED). read_pwd.c: promptusr.c: lock_file.c: kuserok.c: ktdefname.c (krb5_kt_default_name): init_os_ctx.c (os_init_paths): ccdefname.c: an_to_ln.c (db_an_to_ln): Change _WINDOWS to _MSDOS, and add check for _WIN32. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8316 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 37600779f..75d2f0d3e 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,26 @@ +Wed Jun 12 01:12:32 1996 Theodore Ts'o + + * net_read.c (krb5_net_read): + * net_write.c (krb5_net_write): In case of an error, on Windows + machines, set errno from SOCKET_ERRNO, since the interface + assumes the error is passed back the errno global + varaible. This really needs to be fixed sometime... + + * read_msg.c: If ECONNABORTED is not defined, try using the + Winsock version of the error code (WSAECONNABORTED). + +Mon Jun 10 21:48:45 1996 Theodore Ts'o + + * read_pwd.c: + * promptusr.c: + * lock_file.c: + * kuserok.c: + * ktdefname.c (krb5_kt_default_name): + * init_os_ctx.c (os_init_paths): + * ccdefname.c: + * an_to_ln.c (db_an_to_ln): Change _WINDOWS to _MSDOS, and add + check for _WIN32. + Thu Apr 18 16:24:44 1996 Theodore Y. Ts'o * macsock.c (getsockname, getpeername): Correctly implement diff --git a/src/lib/krb5/os/an_to_ln.c b/src/lib/krb5/os/an_to_ln.c index 9748daf66..abf8d374c 100644 --- a/src/lib/krb5/os/an_to_ln.c +++ b/src/lib/krb5/os/an_to_ln.c @@ -108,7 +108,7 @@ db_an_to_ln(context, dbname, aname, lnsize, lname) const int lnsize; char *lname; { -#if defined(BERK_DB_DBM) || (!defined(_WINDOWS) && !defined(_MACINTOSH)) +#if defined(BERK_DB_DBM) || (!defined(_MSDOS) && !defined(_WIN32) && !defined(_MACINTOSH)) DBM *db; krb5_error_code retval; datum key, contents; @@ -144,13 +144,13 @@ db_an_to_ln(context, dbname, aname, lnsize, lname) /* can't close until we copy the contents. */ (void) KDBM_CLOSE(db); return retval; -#else /* BERK_DB_DBM && !_WINDOWS */ +#else /* BERK_DB_DBM && !_MSDOS && !_WIN32 && !MACINTOSH */ /* * If we don't have support for a database mechanism, then we can't * translate this now, can we? */ return KRB5_LNAME_NOTRANS; -#endif /* BERK_DB_DBM && !_WINDOWS */ +#endif /* BERK_DB_DBM && !_MSDOS && !_WIN32 && !MACINTOSH */ } #ifdef AN_TO_LN_RULES diff --git a/src/lib/krb5/os/ccdefname.c b/src/lib/krb5/os/ccdefname.c index 197ab32c7..1db1706f2 100644 --- a/src/lib/krb5/os/ccdefname.c +++ b/src/lib/krb5/os/ccdefname.c @@ -107,7 +107,7 @@ char pathbuf[255]; // strcpy (name_buf, "STDIO:krb5cc"); } #else -#ifdef _WINDOWS +#if defined(_MSDOS) || defined(_WIN32) { char defname[160]; /* Default value */ diff --git a/src/lib/krb5/os/init_os_ctx.c b/src/lib/krb5/os/init_os_ctx.c index ba80694bc..56e5ebc95 100644 --- a/src/lib/krb5/os/init_os_ctx.c +++ b/src/lib/krb5/os/init_os_ctx.c @@ -106,13 +106,13 @@ os_init_paths(ctx, secure) krb5_error_code retval = 0; char *name = 0; -#if defined(_MACINTOSH) || defined(_WINDOWS) +#if defined(_MACINTOSH) || defined(_MSDOS) || defined(_WIN32) const char *filenames[2]; #endif ctx->profile_secure = secure; -#ifdef _WINDOWS +#if defined(_MSDOS) || defined(_WIN32) { char defname[160]; /* Default value */ char krb5conf[160]; /* Actual value */ @@ -130,7 +130,7 @@ os_init_paths(ctx, secure) retval = profile_init(filenames, &ctx->profile); -#else /* _WINDOWS */ +#else /* _MSDOS || _WIN32 */ #ifdef _MACINTOSH filenames[0] = GetMacProfilePathName(); filenames[1] = 0; @@ -145,7 +145,7 @@ os_init_paths(ctx, secure) retval = profile_init_path(name, &ctx->profile); #endif /* _MACINTOSH */ -#endif /* _WINDOWS */ +#endif /* _MSDOS || _WIN32 */ if (retval) ctx->profile = 0; diff --git a/src/lib/krb5/os/ktdefname.c b/src/lib/krb5/os/ktdefname.c index b431b945c..433c1c9da 100644 --- a/src/lib/krb5/os/ktdefname.c +++ b/src/lib/krb5/os/ktdefname.c @@ -44,7 +44,7 @@ krb5_kt_default_name(context, name, namesize) if (strlen(cp) >= (size_t) namesize) return KRB5_CONFIG_NOTENUFSPACE; } else { -#if defined (_WINDOWS) || defined(WIN32) +#if defined (_MSDOS) || defined(_WIN32) { char defname[160]; int len; diff --git a/src/lib/krb5/os/kuserok.c b/src/lib/krb5/os/kuserok.c index 321f438cc..3e54fa0c1 100644 --- a/src/lib/krb5/os/kuserok.c +++ b/src/lib/krb5/os/kuserok.c @@ -25,7 +25,7 @@ */ #include "k5-int.h" -#if !defined(_MSDOS) && !defined(_MACINTOSH) /* Not yet for Windows */ +#if !defined(_MSDOS) && !defined(_WIN32) && !defined(_MACINTOSH) /* Not yet for Windows */ #include #include diff --git a/src/lib/krb5/os/lock_file.c b/src/lib/krb5/os/lock_file.c index 4994caf08..edc4d88d2 100644 --- a/src/lib/krb5/os/lock_file.c +++ b/src/lib/krb5/os/lock_file.c @@ -27,7 +27,7 @@ #include "k5-int.h" #include -#if !defined(_MSDOS) && !defined(HAVE_MACSOCK_H) +#if !defined(_MSDOS) && !defined(_WIN32) && !defined(HAVE_MACSOCK_H) /* Unix version... */ diff --git a/src/lib/krb5/os/net_read.c b/src/lib/krb5/os/net_read.c index 151389860..9d3f52bdf 100644 --- a/src/lib/krb5/os/net_read.c +++ b/src/lib/krb5/os/net_read.c @@ -50,6 +50,10 @@ krb5_net_read(context, fd, buf, len) if (cc < 0) { if (SOCKET_ERRNO == SOCKET_EINTR) continue; +#if defined(_MSDOS) || (_WIN32) + /* XXX this interface sucks! */ + errno = SOCKET_ERRNO; +#endif return(cc); /* errno is already set */ } else if (cc == 0) { diff --git a/src/lib/krb5/os/net_write.c b/src/lib/krb5/os/net_write.c index 161846fc4..bea342880 100644 --- a/src/lib/krb5/os/net_write.c +++ b/src/lib/krb5/os/net_write.c @@ -49,6 +49,10 @@ krb5_net_write(context, fd, buf, len) if (cc < 0) { if (SOCKET_ERRNO == SOCKET_EINTR) continue; +#if defined(_MSDOS) || (_WIN32) + /* XXX this interface sucks! */ + errno = SOCKET_ERRNO; +#endif return(cc); } else { diff --git a/src/lib/krb5/os/promptusr.c b/src/lib/krb5/os/promptusr.c index 90ceaccec..f40be0ff4 100644 --- a/src/lib/krb5/os/promptusr.c +++ b/src/lib/krb5/os/promptusr.c @@ -3,7 +3,7 @@ */ #include "k5-int.h" -#if !defined(_MSDOS) && !defined(_MACINTOSH) +#if !defined(_MSDOS) && !defined(_WIN32) && !defined(_MACINTOSH) #include #include diff --git a/src/lib/krb5/os/read_msg.c b/src/lib/krb5/os/read_msg.c index a5dc7964c..6a93644a8 100644 --- a/src/lib/krb5/os/read_msg.c +++ b/src/lib/krb5/os/read_msg.c @@ -28,6 +28,10 @@ #include "k5-int.h" #include +#ifndef ECONNABORTED +#define ECONNABORTED WSAECONNABORTED +#endif + krb5_error_code krb5_read_message(context, fdp, inbuf) krb5_context context; diff --git a/src/lib/krb5/os/read_pwd.c b/src/lib/krb5/os/read_pwd.c index 5aa9055f1..202b1f9f4 100644 --- a/src/lib/krb5/os/read_pwd.c +++ b/src/lib/krb5/os/read_pwd.c @@ -25,7 +25,7 @@ */ #include "k5-int.h" -#if !defined(_MSDOS) && !defined(_MACINTOSH) +#if !defined(_MSDOS) && !defined(_WIN32) && !defined(_MACINTOSH) #include #include #include