(fkt_add_entry): use an explicit seek instead of O_APPEND

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4690 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1998-03-28 10:25:48 +00:00
parent 36ed5bc255
commit b3e0e216bb

View File

@@ -617,7 +617,7 @@ fkt_add_entry(krb5_context context,
struct fkt_data *d = id->data;
off_t pos_start, pos_end;
fd = open (d->filename, O_WRONLY | O_APPEND);
fd = open (d->filename, O_WRONLY);
if (fd < 0) {
fd = open (d->filename, O_WRONLY | O_CREAT, 0600);
if (fd < 0)
@@ -632,7 +632,7 @@ fkt_add_entry(krb5_context context,
sp = krb5_storage_from_fd(fd);
}
pos_start = sp->seek(sp, 0, SEEK_CUR);
pos_start = sp->seek(sp, 0, SEEK_END);
ret = krb5_store_int32 (sp, 0); /* store real size at end */
if (ret) goto out;
ret = krb5_kt_store_principal (sp, entry->principal);