+Sat Feb 24 18:53:33 1996 Theodore Y. Ts'o <tytso@dcl>
+
+ * rc_io.c (krb5_rc_io_creat, krb5_rc_io_open): Use Windows path
+ separator, if appropriate. Under Windows also use the
+ environment variables TEMP and TMP for the replay cache.
+
Fri Dec 1 17:07:24 1995 Theodore Y. Ts'o <tytso@dcl>
* rc_io.c (krb5_rc_io_creat): In case of permission problems,
* I/O functions for the replay cache default implementation.
*/
+#ifdef _WINDOWS
+# define PATH_SEPARATOR "\\"
+#else
+# define PATH_SEPARATOR "/"
+#endif
#define KRB5_RC_VNO 0x0501 /* krb5, rcache v 1 */
#define NEED_SOCKETS
if (!dirlen)
{
if (!(dir = getenv("KRB5RCACHEDIR")))
+#ifdef _WINDOWS
+ if (!(dir = getenv("TEMP")))
+ if (!(dir = getenv("TMP")))
+ dir = "C:\\";
+#else
if (!(dir = getenv("TMPDIR")))
#ifdef RCTMPDIR
dir = RCTMPDIR;
#else
dir = "/tmp";
+#endif
#endif
dirlen = strlen(dir) + 1;
}
if (!(d->fn = malloc(strlen(*fn) + dirlen + 1)))
return KRB5_RC_IO_MALLOC;
(void) strcpy(d->fn,dir);
- (void) strcat(d->fn,"/");
+ (void) strcat(d->fn,PATH_SEPARATOR);
(void) strcat(d->fn,*fn);
d->fd = THREEPARAMOPEN(d->fn,O_WRONLY | O_CREAT | O_TRUNC | O_EXCL | O_BINARY,0600);
}
if (fn)
if (!(*fn = malloc(35)))
{ FREE(d->fn); return KRB5_RC_IO_MALLOC; }
- (void) sprintf(d->fn,"%s/krb5_RC%d",dir,UNIQUE);
+ (void) sprintf(d->fn,"%s%skrb5_RC%d",dir,PATH_SEPARATOR,UNIQUE);
c = d->fn + strlen(d->fn);
(void) strcpy(c,"aaa");
while ((d->fd = THREEPARAMOPEN(d->fn,O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY,0600)) == -1)
if (!(d->fn = malloc(strlen(fn) + dirlen + 1)))
return KRB5_RC_IO_MALLOC;
(void) strcpy(d->fn,dir);
- (void) strcat(d->fn,"/");
+ (void) strcat(d->fn,PATH_SEPARATOR);
(void) strcat(d->fn,fn);
#ifdef NO_USERID