xfree, close-on-exec
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23469 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997 - 2005 Kungliga Tekniska H<>gskolan
|
* Copyright (c) 1997 - 2008 Kungliga Tekniska H<>gskolan
|
||||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -338,6 +338,7 @@ fkt_start_seq_get_int(krb5_context context,
|
|||||||
d->filename, strerror(ret));
|
d->filename, strerror(ret));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
rk_cloexec(c->fd);
|
||||||
ret = _krb5_xlock(context, c->fd, exclusive, d->filename);
|
ret = _krb5_xlock(context, c->fd, exclusive, d->filename);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
close(c->fd);
|
close(c->fd);
|
||||||
@@ -496,6 +497,8 @@ fkt_add_entry(krb5_context context,
|
|||||||
strerror(ret));
|
strerror(ret));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
rk_cloexec(fd);
|
||||||
|
|
||||||
ret = _krb5_xlock(context, fd, 1, d->filename);
|
ret = _krb5_xlock(context, fd, 1, d->filename);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
close(fd);
|
close(fd);
|
||||||
@@ -510,6 +513,9 @@ fkt_add_entry(krb5_context context,
|
|||||||
storage_set_flags(context, sp, id->version);
|
storage_set_flags(context, sp, id->version);
|
||||||
} else {
|
} else {
|
||||||
int8_t pvno, tag;
|
int8_t pvno, tag;
|
||||||
|
|
||||||
|
rk_cloexec(fd);
|
||||||
|
|
||||||
ret = _krb5_xlock(context, fd, 1, d->filename);
|
ret = _krb5_xlock(context, fd, 1, d->filename);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
close(fd);
|
close(fd);
|
||||||
|
Reference in New Issue
Block a user