Skip to content

Commit 5758b1d

Browse files
committed
fix issue #1058
1 parent 23e46f5 commit 5758b1d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ssh-keygen.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,10 +1541,7 @@ do_change_comment(struct passwd *pw)
15411541
sshkey_free(private);
15421542

15431543
strlcat(identity_file, ".pub", sizeof(identity_file));
1544-
fd = open(identity_file, O_WRONLY | O_CREAT | O_TRUNC, 0644);
1545-
if (fd == -1)
1546-
fatal("Could not save your public key in %s", identity_file);
1547-
f = fdopen(fd, "w");
1544+
f = fopen(identity_file, "w");
15481545
if (f == NULL)
15491546
fatal("fdopen %s failed: %s", identity_file, strerror(errno));
15501547
if ((r = sshkey_write(public, f)) != 0)

0 commit comments

Comments
 (0)