Bugzilla – Attachment 1776 Details for
Bug 1290
sshd dies if passed host key with relative path on command line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
/home/djm/sshd-abspath.diff
sshd-abspath.diff (text/plain), 2.97 KB, created by
Damien Miller
on 2010-01-13 14:32:05 AEDT
(
hide
)
Description:
/home/djm/sshd-abspath.diff
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2010-01-13 14:32:05 AEDT
Size:
2.97 KB
patch
obsolete
>? ignoredirective >? ssh.core >? what >Index: Makefile.inc >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/Makefile.inc,v >retrieving revision 1.33 >diff -u -p -r1.33 Makefile.inc >--- Makefile.inc 4 Nov 2008 08:22:12 -0000 1.33 >+++ Makefile.inc 13 Jan 2010 03:12:56 -0000 >@@ -3,7 +3,7 @@ > CFLAGS+= -I${.CURDIR}/.. > > CDIAGFLAGS= -Wall >-#CDIAGFLAGS+= -Werror >+CDIAGFLAGS+= -Werror > CDIAGFLAGS+= -Wpointer-arith > CDIAGFLAGS+= -Wno-uninitialized > CDIAGFLAGS+= -Wstrict-prototypes >@@ -13,9 +13,9 @@ CDIAGFLAGS+= -Wsign-compare > CDIAGFLAGS+= -Wbounded > CDIAGFLAGS+= -Wshadow > >-#DEBUG=-g >+DEBUG=-g > >-#CFLAGS+= -DJPAKE >+CFLAGS+= -DJPAKE > > #CFLAGS+= -DSMARTCARD > #LDADD+= -lsectok >Index: servconf.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/servconf.c,v >retrieving revision 1.201 >diff -u -p -r1.201 servconf.c >--- servconf.c 10 Jan 2010 03:51:17 -0000 1.201 >+++ servconf.c 13 Jan 2010 03:12:57 -0000 >@@ -422,6 +422,24 @@ parse_token(const char *cp, const char * > return sBadOption; > } > >+char * >+derelativise_path(const char *path) >+{ >+ char *expanded, *ret, *cwd; >+ >+ debug3("XXX: %s", path); >+ expanded = tilde_expand_filename(path, getuid()); >+ if (*expanded == '/') >+ return expanded; >+ if ((cwd = getcwd(NULL, 0)) == NULL) >+ fatal("%s: getcwd: %s", __func__, strerror(errno)); >+ xasprintf(&ret, "%s/%s", cwd, expanded); >+ xfree(cwd); >+ xfree(expanded); >+ debug3("XXX: %s", ret); >+ return ret; >+} >+ > static void > add_listen_addr(ServerOptions *options, char *addr, int port) > { >@@ -750,7 +768,7 @@ process_server_config_line(ServerOptions > fatal("%s line %d: missing file name.", > filename, linenum); > if (*activep && *charptr == NULL) { >- *charptr = tilde_expand_filename(arg, getuid()); >+ *charptr = derelativise_path(arg); > /* increase optional counter */ > if (intptr != NULL) > *intptr = *intptr + 1; >Index: servconf.h >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/servconf.h,v >retrieving revision 1.89 >diff -u -p -r1.89 servconf.h >--- servconf.h 9 Jan 2010 23:04:13 -0000 1.89 >+++ servconf.h 13 Jan 2010 03:12:57 -0000 >@@ -162,5 +162,6 @@ void parse_server_match_config(ServerOp > const char *); > void copy_set_server_options(ServerOptions *, ServerOptions *, int); > void dump_config(ServerOptions *); >+char *derelativise_path(const char *); > > #endif /* SERVCONF_H */ >Index: sshd.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sshd.c,v >retrieving revision 1.370 >diff -u -p -r1.370 sshd.c >--- sshd.c 9 Jan 2010 23:04:13 -0000 1.370 >+++ sshd.c 13 Jan 2010 03:12:57 -0000 >@@ -1297,7 +1297,8 @@ main(int ac, char **av) > fprintf(stderr, "too many host keys.\n"); > exit(1); > } >- options.host_key_files[options.num_host_key_files++] = optarg; >+ options.host_key_files[options.num_host_key_files++] = >+ derelativise_path(optarg); > break; > case 't': > test_flag = 1;
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 1290
:
1288
|
1289
|
1290
| 1776