Rewrite strerror to ssh_strerror

Signed-off-by: Norbert Pocs <npocs@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Norbert Pocs
2022-07-04 10:08:23 +02:00
committed by Jakub Jelen
parent 4f09bb3660
commit 4719c09e6a

View File

@@ -622,8 +622,12 @@ int ssh_publickey_to_file(ssh_session session,
fp = fopen(file, "w+");
if (fp == NULL) {
ssh_set_error(session, SSH_REQUEST_DENIED,
"Error opening %s: %s", file, strerror(errno));
char err_msg[SSH_ERRNO_MSG_MAX] = {0};
ssh_set_error(session,
SSH_REQUEST_DENIED,
"Error opening %s: %s",
file,
ssh_strerror(errno, err_msg, SSH_ERRNO_MSG_MAX));
return SSH_ERROR;
}