Fix broken return from _krb5_erase_file on missing file.
The return of lstat should be handled like the "open" if errno = ENOENT.
This commit is contained in:

committed by
Nico Williams

parent
717a399bbd
commit
907b9ee6c4
@@ -254,8 +254,12 @@ _krb5_erase_file(krb5_context context, const char *filename)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = lstat (filename, &sb1);
|
ret = lstat (filename, &sb1);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
return errno;
|
if(errno == ENOENT)
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return errno;
|
||||||
|
}
|
||||||
|
|
||||||
fd = open(filename, O_RDWR | O_BINARY | O_CLOEXEC | O_NOFOLLOW);
|
fd = open(filename, O_RDWR | O_BINARY | O_CLOEXEC | O_NOFOLLOW);
|
||||||
if(fd < 0) {
|
if(fd < 0) {
|
||||||
|
Reference in New Issue
Block a user