Bugzilla – Attachment 1445 Details for
Bug 1230
filename escaping of brackets in sftp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
process_put: check pathname even if glob does not match
sftp-put.diff (text/plain), 1.32 KB, created by
Damien Miller
on 2008-01-20 11:31:11 AEDT
(
hide
)
Description:
process_put: check pathname even if glob does not match
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2008-01-20 11:31:11 AEDT
Size:
1.32 KB
patch
obsolete
>Index: sftp.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sftp.c,v >retrieving revision 1.98 >diff -u -p -r1.98 sftp.c >--- sftp.c 12 Dec 2007 05:04:03 -0000 1.98 >+++ sftp.c 20 Jan 2008 00:30:13 -0000 >@@ -422,17 +422,6 @@ is_dir(char *path) > } > > static int >-is_reg(char *path) >-{ >- struct stat sb; >- >- if (stat(path, &sb) == -1) >- fatal("stat %s: %s", path, strerror(errno)); >- >- return(S_ISREG(sb.st_mode)); >-} >- >-static int > remote_is_dir(struct sftp_conn *conn, char *path) > { > Attrib *a; >@@ -520,6 +509,7 @@ process_put(struct sftp_conn *conn, char > glob_t g; > int err = 0; > int i; >+ struct stat sb; > > if (dst) { > tmp_dst = xstrdup(dst); >@@ -528,7 +518,7 @@ process_put(struct sftp_conn *conn, char > > memset(&g, 0, sizeof(g)); > debug3("Looking up %s", src); >- if (glob(src, 0, NULL, &g)) { >+ if (glob(src, GLOB_NOCHECK, NULL, &g)) { > error("File \"%s\" not found.", src); > err = -1; > goto out; >@@ -543,7 +533,12 @@ process_put(struct sftp_conn *conn, char > } > > for (i = 0; g.gl_pathv[i] && !interrupted; i++) { >- if (!is_reg(g.gl_pathv[i])) { >+ if (stat(g.gl_pathv[i], &sb) == -1) { >+ error("stat %s: %s", g.gl_pathv[i], strerror(errno)); >+ continue; >+ } >+ >+ if (!S_ISREG(sb.st_mode)) { > error("skipping non-regular file %s", > g.gl_pathv[i]); > continue;
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 1230
: 1445