summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-04-06 23:01:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:08 -0500
commit1db9257c953c93c3f26596a535e4f26b609e7955 (patch)
tree6113771ac0ec30fd0cb67d243a07f5844a5c6145 /source3/libsmb
parent9d458e45c8979bbfa081722b379abba9db922bba (diff)
downloadsamba-1db9257c953c93c3f26596a535e4f26b609e7955.tar.gz
samba-1db9257c953c93c3f26596a535e4f26b609e7955.tar.bz2
samba-1db9257c953c93c3f26596a535e4f26b609e7955.zip
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)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clifile.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index bf7923ec78..398c7cc4f0 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -25,9 +25,10 @@
/****************************************************************************
Hard/Symlink a file (UNIX extensions).
+ Creates new name (sym)linked to oldname.
****************************************************************************/
-static BOOL cli_link_internal(struct cli_state *cli, const char *fname_src, const char *fname_dst, BOOL hard_link)
+static BOOL cli_link_internal(struct cli_state *cli, const char *oldname, const char *newname, BOOL hard_link)
{
unsigned int data_len = 0;
unsigned int param_len = 0;
@@ -36,18 +37,18 @@ static BOOL cli_link_internal(struct cli_state *cli, const char *fname_src, cons
pstring data;
char *rparam=NULL, *rdata=NULL;
char *p;
- size_t srclen = 2*(strlen(fname_src)+1);
- size_t destlen = 2*(strlen(fname_dst) + 1);
+ size_t oldlen = 2*(strlen(oldname)+1);
+ size_t newlen = 2*(strlen(newname)+1);
memset(param, 0, sizeof(param));
SSVAL(param,0,hard_link ? SMB_SET_FILE_UNIX_HLINK : SMB_SET_FILE_UNIX_LINK);
p = &param[6];
- p += clistr_push(cli, p, fname_src, MIN(srclen, sizeof(param)-6), STR_TERMINATE);
+ p += clistr_push(cli, p, newname, MIN(newlen, sizeof(param)-6), STR_TERMINATE);
param_len = PTR_DIFF(p, param);
p = data;
- p += clistr_push(cli, p, fname_dst, MIN(destlen,sizeof(data)), STR_TERMINATE);
+ p += clistr_push(cli, p, oldname, MIN(oldlen,sizeof(data)), STR_TERMINATE);
data_len = PTR_DIFF(p, data);
if (!cli_send_trans(cli, SMBtrans2,
@@ -105,18 +106,18 @@ uint32 unix_perms_to_wire(mode_t perms)
Symlink a file (UNIX extensions).
****************************************************************************/
-BOOL cli_unix_symlink(struct cli_state *cli, const char *fname_src, const char *fname_dst)
+BOOL cli_unix_symlink(struct cli_state *cli, const char *oldname, const char *newname)
{
- return cli_link_internal(cli, fname_src, fname_dst, False);
+ return cli_link_internal(cli, oldname, newname, False);
}
/****************************************************************************
Hard a file (UNIX extensions).
****************************************************************************/
-BOOL cli_unix_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst)
+BOOL cli_unix_hardlink(struct cli_state *cli, const char *oldname, const char *newname)
{
- return cli_link_internal(cli, fname_src, fname_dst, True);
+ return cli_link_internal(cli, oldname, newname, True);
}
/****************************************************************************