Bugzilla – Attachment 1223 Details for
Bug 1271
sftp should allow local files (lrm) and directories (lrmdir) to be removed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Adds lrm and lrmdir options to sftp
addlrm.patch (text/plain), 1.79 KB, created by
Matthew Flaschen
on 2006-12-29 18:27:16 AEDT
(
hide
)
Description:
Adds lrm and lrmdir options to sftp
Filename:
MIME Type:
Creator:
Matthew Flaschen
Created:
2006-12-29 18:27:16 AEDT
Size:
1.79 KB
patch
obsolete
>diff -Nrau openssh-4.3p2/sftp.c openssh-4.3p2_lrm/sftp.c >--- openssh-4.3p2/sftp.c 2006-01-31 05:49:28.000000000 -0500 >+++ openssh-4.3p2_lrm/sftp.c 2006-12-29 02:21:59.000000000 -0500 >@@ -103,6 +103,8 @@ > #define I_SYMLINK 21 > #define I_VERSION 22 > #define I_PROGRESS 23 >+#define I_LRM 24 >+#define I_LRMDIR 25 > > struct CMD { > const char *c; >@@ -127,6 +129,8 @@ > { "lmkdir", I_LMKDIR }, > { "ln", I_SYMLINK }, > { "lpwd", I_LPWD }, >+ { "lrm", I_LRM }, >+ { "lrmdir", I_LRMDIR }, > { "ls", I_LS }, > { "lumask", I_LUMASK }, > { "mkdir", I_MKDIR }, >@@ -184,6 +188,8 @@ > printf("ln oldpath newpath Symlink remote file\n"); > printf("lmkdir path Create local directory\n"); > printf("lpwd Print local working directory\n"); >+ printf("lrmdir Remove local directory\n"); >+ printf("lrm Delete local file\n"); > printf("ls [path] Display remote directory listing\n"); > printf("lumask umask Set local umask to 'umask'\n"); > printf("mkdir path Create remote directory\n"); >@@ -932,6 +938,8 @@ > case I_CHDIR: > case I_LCHDIR: > case I_LMKDIR: >+ case I_LRM: >+ case I_LRMDIR: > /* Get pathname (mandatory) */ > if (get_pathname(&cp, path1)) > return(-1); >@@ -1125,6 +1133,20 @@ > case I_LLS: > local_do_ls(cmd); > break; >+ case I_LRM: >+ if (unlink(path1) == -1){ >+ error("Couldn't delete local file " >+ "\"%s\": %s", path1, strerror(errno)); >+ err = 1; >+ } >+ break; >+ case I_LRMDIR: >+ if (rmdir(path1) == -1){ >+ error("Couldn't remove local directory " >+ "\"%s\": %s", path1, strerror(errno)); >+ err = 1; >+ } >+ break; > case I_SHELL: > local_do_shell(cmd); > break;
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 1271
: 1223