Bugzilla – Attachment 1842 Details for
Bug 1740
Misleading error message in ssh-keygen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
keygen-report-stat-errors.diff
keygen-report-stat-errors.diff (text/plain), 1.35 KB, created by
Damien Miller
on 2010-04-23 11:12:12 AEST
(
hide
)
Description:
keygen-report-stat-errors.diff
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2010-04-23 11:12:12 AEST
Size:
1.35 KB
patch
obsolete
>Index: ssh-keygen.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/ssh-keygen.c,v >retrieving revision 1.187 >diff -u -p -r1.187 ssh-keygen.c >--- ssh-keygen.c 16 Apr 2010 06:47:04 -0000 1.187 >+++ ssh-keygen.c 23 Apr 2010 01:11:32 -0000 >@@ -1871,13 +1871,19 @@ main(int argc, char **argv) > ask_filename(pw, "Enter file in which to save the key"); > > /* Create ~/.ssh directory if it doesn't already exist. */ >- snprintf(dotsshdir, sizeof dotsshdir, "%s/%s", pw->pw_dir, _PATH_SSH_USER_DIR); >- if (strstr(identity_file, dotsshdir) != NULL && >- stat(dotsshdir, &st) < 0) { >- if (mkdir(dotsshdir, 0700) < 0) >- error("Could not create directory '%s'.", dotsshdir); >- else if (!quiet) >- printf("Created directory '%s'.\n", dotsshdir); >+ snprintf(dotsshdir, sizeof dotsshdir, "%s/%s", >+ pw->pw_dir, _PATH_SSH_USER_DIR); >+ if (strstr(identity_file, dotsshdir) != NULL) { >+ if (stat(dotsshdir, &st) < 0) { >+ if (errno != ENOENT) { >+ error("Could not stat %s: %s", dotsshdir, >+ strerror(errno)); >+ } else if (mkdir(dotsshdir, 0700) < 0) { >+ error("Could not create directory '%s': %s", >+ dotsshdir, strerror(errno)); >+ } else if (!quiet) >+ printf("Created directory '%s'.\n", dotsshdir); >+ } > } > /* If the file already exists, ask the user to confirm. */ > if (stat(identity_file, &st) >= 0) {
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 1740
:
1818
| 1842