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
+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.
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;
}
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;
}