Merge pull request #1068 from PowerShell/revert-1059-L1-Prod

Revert "Fix Issue #1058"

Fix was committed to wrong branch
This commit is contained in:
Manoj Ampalam 2018-02-08 11:26:00 -08:00 committed by GitHub
commit 4e7dbfbd77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 7 deletions

View File

@ -1544,16 +1544,9 @@ do_change_comment(struct passwd *pw)
fd = open(identity_file, O_WRONLY | O_CREAT | O_TRUNC, 0644); fd = open(identity_file, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd == -1) if (fd == -1)
fatal("Could not save your public key in %s", identity_file); fatal("Could not save your public key in %s", identity_file);
#ifdef WINDOWS
/* Windows POSIX adpater does not support fdopen() on open(file)*/
close(fd);
if ((f = fopen(identity_file, "w")) == NULL)
fatal("fopen %s failed: %s", identity_file, strerror(errno));
#else /* !WINDOWS */
f = fdopen(fd, "w"); f = fdopen(fd, "w");
if (f == NULL) if (f == NULL)
fatal("fdopen %s failed: %s", identity_file, strerror(errno)); fatal("fdopen %s failed: %s", identity_file, strerror(errno));
#endif /* !WINDOWS */
if ((r = sshkey_write(public, f)) != 0) if ((r = sshkey_write(public, f)) != 0)
fatal("write key failed: %s", ssh_err(r)); fatal("write key failed: %s", ssh_err(r));
sshkey_free(public); sshkey_free(public);