Bugzilla – Attachment 1409 Details for
Bug 1414
Botched getpwuid usage on Mac OS X
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
This patch corrects the usage of getpwuid for POSIX.
DVG-4808140_getpwuid_botch.patch (text/plain), 1.21 KB, created by
Disco Vince Giffin
on 2007-12-21 15:25:22 AEDT
(
hide
)
Description:
This patch corrects the usage of getpwuid for POSIX.
Filename:
MIME Type:
Creator:
Disco Vince Giffin
Created:
2007-12-21 15:25:22 AEDT
Size:
1.21 KB
patch
obsolete
>diff -uNr ../openssh-4.4p1.orig/ssh.c ./ssh.c >--- ../openssh-4.4p1.orig/ssh.c 2006-09-01 22:32:40.000000000 -0700 >+++ ./ssh.c 2006-10-27 18:48:11.000000000 -0700 >@@ -1227,6 +1227,7 @@ > int i = 0; > Key *public; > struct passwd *pw; >+ char *pw_dir, *pw_name; > #ifdef SMARTCARD > Key **keys; > >@@ -1252,14 +1253,16 @@ > #endif /* SMARTCARD */ > if ((pw = getpwuid(original_real_uid)) == NULL) > fatal("load_public_identity_files: getpwuid failed"); >+ pw_dir = xstrdup (pw->pw_dir); >+ pw_name = xstrdup (pw->pw_name); > if (gethostname(thishost, sizeof(thishost)) == -1) > fatal("load_public_identity_files: gethostname: %s", > strerror(errno)); > for (; i < options.num_identity_files; i++) { > cp = tilde_expand_filename(options.identity_files[i], > original_real_uid); >- filename = percent_expand(cp, "d", pw->pw_dir, >- "u", pw->pw_name, "l", thishost, "h", host, >+ filename = percent_expand(cp, "d", pw_dir, >+ "u", pw_name, "l", thishost, "h", host, > "r", options.user, (char *)NULL); > xfree(cp); > public = key_load_public(filename, NULL); >@@ -1269,6 +1272,8 @@ > options.identity_files[i] = filename; > options.identity_keys[i] = public; > } >+ xfree(pw_dir); >+ xfree(pw_name); > } > > static void
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
Actions:
View
|
Diff
Attachments on
bug 1414
: 1409