Use O_EXCL when creating a new keyfile.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11414 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -297,7 +297,7 @@ akf_add_entry(krb5_context context,
|
||||
fd = open (d->filename, O_RDWR | O_BINARY);
|
||||
if (fd < 0) {
|
||||
fd = open (d->filename,
|
||||
O_RDWR | O_BINARY | O_CREAT, 0600);
|
||||
O_RDWR | O_BINARY | O_CREAT | O_EXCL, 0600);
|
||||
if (fd < 0) {
|
||||
ret = errno;
|
||||
krb5_set_error_string(context, "open(%s): %s", d->filename,
|
||||
|
Reference in New Issue
Block a user