summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-03-03 20:55:59 +0000
committerJeremy Allison <jra@samba.org>2004-03-03 20:55:59 +0000
commitfba5a722497c1e4577aa463921a0fec5f6d5fe55 (patch)
tree15df1942a8929c34b86df0a1bf1042700d0e7f85 /source3/client
parent7ac1750de20edf1b315feb8648f292ff82e92c21 (diff)
downloadsamba-fba5a722497c1e4577aa463921a0fec5f6d5fe55.tar.gz
samba-fba5a722497c1e4577aa463921a0fec5f6d5fe55.tar.bz2
samba-fba5a722497c1e4577aa463921a0fec5f6d5fe55.zip
Use a common function to parse all pathnames from the wire. This allows
much closer emulation of Win2k3 error return codes. Jeremy. (This used to be commit c9f31fafeda6ad79e590276f36e03ecd2e93f818)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c46
1 files changed, 43 insertions, 3 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 547ebe8029..d0bc01655f 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -577,9 +577,13 @@ static int cmd_dir(void)
int rc;
dir_total = 0;
- pstrcpy(mask,cur_dir);
- if(mask[strlen(mask)-1]!='\\')
- pstrcat(mask,"\\");
+ if (strcmp(cur_dir, "\\") != 0) {
+ pstrcpy(mask,cur_dir);
+ if(mask[strlen(mask)-1]!='\\')
+ pstrcat(mask,"\\");
+ } else {
+ *mask = '\0';
+ }
if (next_token_nr(NULL,buf,NULL,sizeof(buf))) {
dos_format(p);
@@ -1769,6 +1773,38 @@ static int cmd_rename(void)
return 0;
}
+#if 0
+ This will become a hard link call. JRA.
+/****************************************************************************
+ Rename some file using the NT call.
+****************************************************************************/
+
+static int cmd_ntrename(void)
+{
+ pstring src,dest;
+ fstring buf,buf2;
+
+ pstrcpy(src,cur_dir);
+ pstrcpy(dest,cur_dir);
+
+ if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) ||
+ !next_token_nr(NULL,buf2,NULL, sizeof(buf2))) {
+ d_printf("ntrename <src> <dest>\n");
+ return 1;
+ }
+
+ pstrcat(src,buf);
+ pstrcat(dest,buf2);
+
+ if (!cli_ntrename(cli, src, dest)) {
+ d_printf("%s doing an NT rename of files\n",cli_errstr(cli));
+ return 1;
+ }
+
+ return 0;
+}
+#endif
+
/****************************************************************************
Toggle the prompt flag.
****************************************************************************/
@@ -2168,6 +2204,10 @@ static struct
{"more",cmd_more,"<remote name> view a remote file with your pager",{COMPL_REMOTE,COMPL_NONE}},
{"mput",cmd_mput,"<mask> put all matching files",{COMPL_REMOTE,COMPL_NONE}},
{"newer",cmd_newer,"<file> only mget files newer than the specified local file",{COMPL_LOCAL,COMPL_NONE}},
+#if 0
+ /* This call will eventually morph into a hard link call. JRA */
+ {"ntrename",cmd_ntrename,"<src> <dest> NT rename some files",{COMPL_REMOTE,COMPL_REMOTE}},
+#endif
{"open",cmd_open,"<mask> open a file",{COMPL_REMOTE,COMPL_NONE}},
{"print",cmd_print,"<file name> print a file",{COMPL_NONE,COMPL_NONE}},
{"printmode",cmd_printmode,"<graphics or text> set the print mode",{COMPL_NONE,COMPL_NONE}},