Fix ENOENT msg clobbering in fcache.c
By not returning the same error code as we were setting on the context, the error message was subsequently lost.
This commit is contained in:
@@ -426,7 +426,7 @@ again:
|
||||
return EPERM;
|
||||
}
|
||||
} else if (errno != ENOENT || !(flags & O_CREAT)) {
|
||||
krb5_set_error_message(context, ret, N_("%s lstat(%s)", "file, error"),
|
||||
krb5_set_error_message(context, errno, N_("%s lstat(%s)", "file, error"),
|
||||
operation, filename);
|
||||
return errno;
|
||||
}
|
||||
@@ -1009,13 +1009,8 @@ out:
|
||||
if (fd > -1) {
|
||||
fcc_unlock(context, fd);
|
||||
if (close(fd) < 0 && ret == 0) {
|
||||
char buf[128];
|
||||
|
||||
/* This error might be useful */
|
||||
rk_strerror_r(ret, buf, sizeof(buf));
|
||||
ret = errno;
|
||||
krb5_set_error_message(context, ret, N_("close %s: %s", ""),
|
||||
FILENAME(id), buf);
|
||||
krb5_set_error_message(context, errno, N_("close %s", ""),
|
||||
FILENAME(id));
|
||||
}
|
||||
}
|
||||
krb5_data_free(&orig_cred_data);
|
||||
|
Reference in New Issue
Block a user