Bugzilla – Attachment 3392 Details for
Bug 3146
ssh-keygen -R changes permissions on existing file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
preserve file mode
bz3146.diff (text/plain), 1.01 KB, created by
Damien Miller
on 2020-05-08 13:53:22 AEST
(
hide
)
Description:
preserve file mode
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2020-05-08 13:53:22 AEST
Size:
1.01 KB
patch
obsolete
>Index: ssh-keygen.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/ssh-keygen.c,v >retrieving revision 1.409 >diff -u -p -r1.409 ssh-keygen.c >--- ssh-keygen.c 2 May 2020 07:19:43 -0000 1.409 >+++ ssh-keygen.c 8 May 2020 03:50:45 -0000 >@@ -1270,6 +1270,7 @@ do_known_hosts(struct passwd *pw, const > int r, fd, oerrno, inplace = 0; > struct known_hosts_ctx ctx; > u_int foreach_options; >+ struct stat sb; > > if (!have_identity) { > cp = tilde_expand_filename(_PATH_SSH_USER_HOSTFILE, pw->pw_uid); >@@ -1279,6 +1280,8 @@ do_known_hosts(struct passwd *pw, const > free(cp); > have_identity = 1; > } >+ if (stat(identity_file, &sb) != 0) >+ fatal("Cannot stat %s: %s", identity_file, strerror(errno)); > > memset(&ctx, 0, sizeof(ctx)); > ctx.out = stdout; >@@ -1305,6 +1308,7 @@ do_known_hosts(struct passwd *pw, const > unlink(tmp); > fatal("fdopen: %s", strerror(oerrno)); > } >+ fchmod(fd, sb.st_mode & 0644); > inplace = 1; > } > /* XXX support identity_file == "-" for stdin */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 3146
: 3392