Bugzilla – Attachment 669 Details for
Bug 863
SCP misses copying a file on error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Equivalent patch against OpenBSD
openbsd-scp-double-error-skip.patch (text/plain), 1.62 KB, created by
Darren Tucker
on 2004-06-28 19:40:32 AEST
(
hide
)
Description:
Equivalent patch against OpenBSD
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2004-06-28 19:40:32 AEST
Size:
1.62 KB
patch
obsolete
>scp -p will skip the file immediately *after* a double-error for >chown and utimes. This is because scp will return two errors to >the sending scp, the second will cause the immediate abort of the >file follwing the error. > >The down side of this patch is it won't attempt to set the erroring >file's timestamp (which I think is preferable to skipping a file that >is not in error). > >This is Mindrot bug #863: >http://bugzilla.mindrot.org/show_bug.cgi?id=863 > >You can reproduce with: >$ cd /tmp >$ mkdir tmp1 tmp2 >$ touch tmp1/test1 tmp1/test2 tmp2/test1 >$ sudo chown root tmp2/test1 >$ cd tmp2 >$ scp -p localhost:/tmp/tmp1/* . >test1 100% 0 0.0KB/s 00:00 >./test1: set mode: Operation not permitted >./test1: set times: Operation not permitted >$ ls >test1 > >I also have a regression test for this which I'll send separately. > >OK? > >Index: scp.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/scp.c,v >retrieving revision 1.115 >diff -u -p -r1.115 scp.c >--- scp.c 21 Jun 2004 17:36:31 -0000 1.115 >+++ scp.c 28 Jun 2004 04:08:14 -0000 >@@ -936,14 +936,18 @@ bad: run_err("%s: %s", np, strerror(er > } > if (pflag) { > if (exists || omode != mode) >- if (fchmod(ofd, omode)) >+ if (fchmod(ofd, omode)) { > run_err("%s: set mode: %s", > np, strerror(errno)); >+ wrerr = DISPLAYED; >+ } > } else { > if (!exists && omode != mode) >- if (fchmod(ofd, omode & ~mask)) >+ if (fchmod(ofd, omode & ~mask)) { > run_err("%s: set mode: %s", > np, strerror(errno)); >+ wrerr = DISPLAYED; >+ } > } > if (close(ofd) == -1) { > wrerr = YES;
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 863
:
664
| 669 |
670