Bugzilla – Attachment 1456 Details for
Bug 1400
add atomic rename extension to sftp-server
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Tweaked patch
sftp-posix-rename.diff (text/plain), 1.47 KB, created by
Damien Miller
on 2008-02-24 12:04:54 AEDT
(
hide
)
Description:
Tweaked patch
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2008-02-24 12:04:54 AEDT
Size:
1.47 KB
patch
obsolete
>Index: sftp-server.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sftp-server.c,v >retrieving revision 1.77 >diff -u -p -r1.77 sftp-server.c >--- sftp-server.c 8 Feb 2008 23:24:07 -0000 1.77 >+++ sftp-server.c 24 Feb 2008 01:02:47 -0000 >@@ -482,6 +482,9 @@ process_init(void) > buffer_init(&msg); > buffer_put_char(&msg, SSH2_FXP_VERSION); > buffer_put_int(&msg, SSH2_FILEXFER_VERSION); >+ /* POSIX rename extension */ >+ buffer_put_cstring(&msg, "posix-rename@openssh.com"); >+ buffer_put_cstring(&msg, "1"); /* version */ > send_msg(&msg); > buffer_free(&msg); > } >@@ -1059,6 +1062,23 @@ process_symlink(void) > } > > static void >+process_extended_posix_rename(u_int32_t id) >+{ >+ char *oldpath, *newpath; >+ >+ oldpath = get_string(NULL); >+ newpath = get_string(NULL); >+ debug3("request %u: posix-rename", id); >+ logit("posix-rename old \"%s\" new \"%s\"", oldpath, newpath); >+ if (rename(oldpath, newpath) == -1) >+ send_status(id, errno_to_portable(errno)); >+ else >+ send_status(id, SSH2_FX_OK); >+ xfree(oldpath); >+ xfree(newpath); >+} >+ >+static void > process_extended(void) > { > u_int32_t id; >@@ -1066,7 +1086,10 @@ process_extended(void) > > id = get_int(); > request = get_string(NULL); >- send_status(id, SSH2_FX_OP_UNSUPPORTED); /* MUST */ >+ if (strcmp(request, "posix-rename@openssh.com") == 0) >+ process_extended_posix_rename(id); >+ else >+ send_status(id, SSH2_FX_OP_UNSUPPORTED); /* MUST */ > xfree(request); > } >
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 1400
:
1394
| 1456