summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-10-31 20:11:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:15 -0500
commit6baec64a7370ff1871f0b806a623b1fc1a898acb (patch)
treebd4ac368bbc4deaabab528f5ef7ea7214c764042 /source3/libsmb
parent7ec71aa20d43fd45dd9321e42ada93ee10fd1d45 (diff)
downloadsamba-6baec64a7370ff1871f0b806a623b1fc1a898acb.tar.gz
samba-6baec64a7370ff1871f0b806a623b1fc1a898acb.tar.bz2
samba-6baec64a7370ff1871f0b806a623b1fc1a898acb.zip
r11420: Fix issue pointed out by Dina Fine <dina@exanet.com>. We can
only tell at parse time from the wire if an incoming name has wildcards or not. If it's a mangled name and we demangle the demangled name may contain wildcard characters. Ensure these are ignored. Jeremy. (This used to be commit 4cd8e2a96b98ff711905e8c6f416b22440c16062)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clifile.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index a7e6fbfe3f..ff42e64143 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1404,19 +1404,29 @@ static BOOL cli_set_ea(struct cli_state *cli, uint16 setup, char *param, unsigne
char *p;
size_t ea_namelen = strlen(ea_name);
- data_len = 4 + 4 + ea_namelen + 1 + ea_len;
- data = SMB_MALLOC(data_len);
- if (!data) {
- return False;
+ if (ea_namelen == 0 && ea_len == 0) {
+ data_len = 4;
+ data = SMB_MALLOC(data_len);
+ if (!data) {
+ return False;
+ }
+ p = data;
+ SIVAL(p,0,data_len);
+ } else {
+ data_len = 4 + 4 + ea_namelen + 1 + ea_len;
+ data = SMB_MALLOC(data_len);
+ if (!data) {
+ return False;
+ }
+ p = data;
+ SIVAL(p,0,data_len);
+ p += 4;
+ SCVAL(p, 0, 0); /* EA flags. */
+ SCVAL(p, 1, ea_namelen);
+ SSVAL(p, 2, ea_len);
+ memcpy(p+4, ea_name, ea_namelen+1); /* Copy in the name. */
+ memcpy(p+4+ea_namelen+1, ea_val, ea_len);
}
- p = data;
- SIVAL(p,0,data_len);
- p += 4;
- SCVAL(p, 0, 0); /* EA flags. */
- SCVAL(p, 1, ea_namelen);
- SSVAL(p, 2, ea_len);
- memcpy(p+4, ea_name, ea_namelen+1); /* Copy in the name. */
- memcpy(p+4+ea_namelen+1, ea_val, ea_len);
if (!cli_send_trans(cli, SMBtrans2,
NULL, /* name */