mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-04-08 18:35:05 +02:00
fix test
This commit is contained in:
parent
f6981a5dbd
commit
a7b6aff348
12
authfile.c
12
authfile.c
@ -513,13 +513,15 @@ sshkey_save_public(const struct sshkey *key, const char *path,
|
||||
FILE *f = NULL;
|
||||
int r = SSH_ERR_INTERNAL_ERROR;
|
||||
|
||||
#ifdef WINDOWS
|
||||
/* Windows POSIX adapter does not support fdopen() on open(file)*/
|
||||
if ((f = fopen(path, "w")) == NULL)
|
||||
return SSH_ERR_SYSTEM_ERROR;
|
||||
#else /* !WINDOWS */
|
||||
if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
|
||||
return SSH_ERR_SYSTEM_ERROR;
|
||||
#ifdef WINDOWS
|
||||
/* Windows POSIX adapter does not support fdopen() on open(file)
|
||||
but still want to create file with 0644 permissions */
|
||||
close(fd);
|
||||
if ((f = fopen(path, "w")) == NULL)
|
||||
return SSH_ERR_SYSTEM_ERROR;
|
||||
#else /* WINDOWS */
|
||||
if ((f = fdopen(fd, "w")) == NULL) {
|
||||
r = SSH_ERR_SYSTEM_ERROR;
|
||||
close(fd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user