From 1db9257c953c93c3f26596a535e4f26b609e7955 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 6 Apr 2004 23:01:09 +0000 Subject: r96: Stupid f&%'n UNIX extensions.... SETPATHINFO normally takes as it's param entry the filename to be acted upon.... Unless it's UNIX extensions create hardlink, or UNIX extensions create symlink. Then it's param -> newfile name data -> oldfile name. This caused me to stuff them up in 3.0.2 (and the client commands link and symlink). Fixed them, everything is now called oldname and newname - thus specifying which name should already exist (hint - the old one...) and which will be created (newname). Jeremy. (This used to be commit 21cc6ab7e8a41160a3e2970623ade7445b5214d6) --- source3/client/client.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'source3/client/client.c') diff --git a/source3/client/client.c b/source3/client/client.c index 1da35fcc43..f2f43656cb 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -1608,7 +1608,7 @@ static int cmd_rmdir(void) static int cmd_link(void) { - pstring src,dest; + pstring oldname,newname; pstring buf,buf2; if (!SERVER_HAS_UNIX_CIFS(cli)) { @@ -1616,20 +1616,20 @@ static int cmd_link(void) return 1; } - pstrcpy(src,cur_dir); - pstrcpy(dest,cur_dir); + pstrcpy(oldname,cur_dir); + pstrcpy(newname,cur_dir); if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) || !next_token_nr(NULL,buf2,NULL, sizeof(buf2))) { - d_printf("link \n"); + d_printf("link \n"); return 1; } - pstrcat(src,buf); - pstrcat(dest,buf2); + pstrcat(oldname,buf); + pstrcat(newname,buf2); - if (!cli_unix_hardlink(cli, src, dest)) { - d_printf("%s linking files (%s -> %s)\n", cli_errstr(cli), src, dest); + if (!cli_unix_hardlink(cli, oldname, newname)) { + d_printf("%s linking files (%s -> %s)\n", cli_errstr(cli), newname, oldname); return 1; } @@ -1642,7 +1642,7 @@ static int cmd_link(void) static int cmd_symlink(void) { - pstring src,dest; + pstring oldname,newname; pstring buf,buf2; if (!SERVER_HAS_UNIX_CIFS(cli)) { @@ -1650,21 +1650,21 @@ static int cmd_symlink(void) return 1; } - pstrcpy(src,cur_dir); - pstrcpy(dest,cur_dir); + pstrcpy(oldname,cur_dir); + pstrcpy(newname,cur_dir); if (!next_token_nr(NULL,buf,NULL,sizeof(buf)) || !next_token_nr(NULL,buf2,NULL, sizeof(buf2))) { - d_printf("symlink \n"); + d_printf("symlink \n"); return 1; } - pstrcat(src,buf); - pstrcat(dest,buf2); + pstrcat(oldname,buf); + pstrcat(newname,buf2); - if (!cli_unix_symlink(cli, src, dest)) { + if (!cli_unix_symlink(cli, oldname, newname)) { d_printf("%s symlinking files (%s -> %s)\n", - cli_errstr(cli), src, dest); + cli_errstr(cli), newname, oldname); return 1; } @@ -2192,7 +2192,7 @@ static struct {"help",cmd_help,"[command] give help on a command",{COMPL_NONE,COMPL_NONE}}, {"history",cmd_history,"displays the command history",{COMPL_NONE,COMPL_NONE}}, {"lcd",cmd_lcd,"[directory] change/report the local current working directory",{COMPL_LOCAL,COMPL_NONE}}, - {"link",cmd_link," create a UNIX hard link",{COMPL_REMOTE,COMPL_REMOTE}}, + {"link",cmd_link," create a UNIX hard link",{COMPL_REMOTE,COMPL_REMOTE}}, {"lowercase",cmd_lowercase,"toggle lowercasing of filenames for get",{COMPL_NONE,COMPL_NONE}}, {"ls",cmd_dir," list the contents of the current directory",{COMPL_REMOTE,COMPL_NONE}}, {"mask",cmd_select," mask all filenames against this",{COMPL_REMOTE,COMPL_NONE}}, @@ -2219,7 +2219,7 @@ static struct {"rm",cmd_del," delete all matching files",{COMPL_REMOTE,COMPL_NONE}}, {"rmdir",cmd_rmdir," remove a directory",{COMPL_NONE,COMPL_NONE}}, {"setmode",cmd_setmode,"filename change modes of file",{COMPL_REMOTE,COMPL_NONE}}, - {"symlink",cmd_symlink," create a UNIX symlink",{COMPL_REMOTE,COMPL_REMOTE}}, + {"symlink",cmd_symlink," create a UNIX symlink",{COMPL_REMOTE,COMPL_REMOTE}}, {"tar",cmd_tar,"tar [IXFqbgNan] current directory to/from ",{COMPL_NONE,COMPL_NONE}}, {"tarmode",cmd_tarmode," tar's behaviour towards archive bits",{COMPL_NONE,COMPL_NONE}}, {"translate",cmd_translate,"toggle text translation for printing",{COMPL_NONE,COMPL_NONE}}, -- cgit