summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1995-03-31 21:48:37 +0000
committerTheodore Tso <tytso@mit.edu>1995-03-31 21:48:37 +0000
commite7ee775130ce4bc4197874487c33517289715453 (patch)
tree8e2ca411d9fcca8764398757f63622e4c353c55b /src/lib/krb5
parent441cc7ee72b937f72c44009a723e26bea02a084c (diff)
downloadkrb5-e7ee775130ce4bc4197874487c33517289715453.tar.gz
krb5-e7ee775130ce4bc4197874487c33517289715453.tar.xz
krb5-e7ee775130ce4bc4197874487c33517289715453.zip
* rc_dfl.c (krb5_rc_dfl_expunage): Close the old, temporary reply
cache after we're done expunging it. * rc_io.c (krb5_rc_io_move): Make duplicate copies of the filename and the file descriptor (via malloc/strcpy and dup), so that the old rc_io object can be cleanly closed without affecting the new rc_io object. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5327 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5')
-rw-r--r--src/lib/krb5/rcache/ChangeLog10
-rw-r--r--src/lib/krb5/rcache/rc_dfl.c1
-rw-r--r--src/lib/krb5/rcache/rc_io.c7
3 files changed, 16 insertions, 2 deletions
diff --git a/src/lib/krb5/rcache/ChangeLog b/src/lib/krb5/rcache/ChangeLog
index 8818198ec..01150216d 100644
--- a/src/lib/krb5/rcache/ChangeLog
+++ b/src/lib/krb5/rcache/ChangeLog
@@ -1,3 +1,13 @@
+Fri Mar 31 16:44:34 1995 Theodore Y. Ts'o (tytso@dcl)
+
+ * rc_dfl.c (krb5_rc_dfl_expunage): Close the old, temporary reply
+ cache after we're done expunging it.
+
+ * rc_io.c (krb5_rc_io_move): Make duplicate copies of the filename
+ and the file descriptor (via malloc/strcpy and dup), so
+ that the old rc_io object can be cleanly closed without
+ affecting the new rc_io object.
+
Fri Mar 17 20:27:41 1995 John Gilmore (gnu at toad.com)
* Makefile.in (LDFLAGS): Eliminate duplicate of config/pre.in.
diff --git a/src/lib/krb5/rcache/rc_dfl.c b/src/lib/krb5/rcache/rc_dfl.c
index a6476109b..aecbb37e9 100644
--- a/src/lib/krb5/rcache/rc_dfl.c
+++ b/src/lib/krb5/rcache/rc_dfl.c
@@ -590,6 +590,7 @@ krb5_rcache id;
return KRB5_RC_IO;
if (krb5_rc_io_move(context, &t->d, &((struct dfl_data *)tmp->data)->d))
return KRB5_RC_IO;
+ (void) krb5_rc_dfl_close(context, tmp);
#endif
return 0;
}
diff --git a/src/lib/krb5/rcache/rc_io.c b/src/lib/krb5/rcache/rc_io.c
index dd59ea084..8d61d5724 100644
--- a/src/lib/krb5/rcache/rc_io.c
+++ b/src/lib/krb5/rcache/rc_io.c
@@ -235,8 +235,11 @@ krb5_error_code INTERFACE krb5_rc_io_move (context, new, old)
if (rename(old->fn,new->fn) == -1) /* MUST be atomic! */
return KRB5_RC_IO_UNKNOWN;
(void) krb5_rc_io_close(context, new);
- new->fn = old->fn;
- new->fd = old->fd;
+ new->fn = malloc(strlen(old->fn)+1);
+ if (new->fn == 0)
+ return ENOMEM;
+ strcpy(new->fn, old->fn);
+ new->fd = dup(old->fd);
return 0;
}