From 0d54de536c03f941739359a121a337aa33a2dc84 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 26 Feb 2001 06:53:42 +0000 Subject: made some LANMAN1 wildcard progress it now handles -M LANMAN1 -f '.x' -m '?x' nicely (This used to be commit e7ccb9be6da9b1426eb136b4a0a1171232471768) --- source3/libsmb/clilist.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'source3/libsmb/clilist.c') diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index eccf3c553a..175673d4fe 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -133,10 +133,14 @@ static int interpret_long_filename(struct cli_state *cli, p += 4; /* EA size */ slen = SVAL(p, 0); p += 2; - clistr_pull(cli, finfo->short_name, p, - sizeof(finfo->short_name), - 24, - CLISTR_CONVERT); + { + /* stupid NT bugs. grr */ + int flags = CLISTR_CONVERT; + if (p[1] == 0 && namelen > 1) flags |= CLISTR_UNICODE; + clistr_pull(cli, finfo->short_name, p, + sizeof(finfo->short_name), + 24, flags); + } p += 24; /* short name? */ clistr_pull(cli, finfo->name, p, sizeof(finfo->name), @@ -159,8 +163,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, void (*fn)(file_info *, const char *, void *), void *state) { int max_matches = 512; - /* NT uses 260, OS/2 uses 2. Both accept 1. */ - int info_level = cli->protocolcapabilities&CAP_NT_SMBS)?260:1; + pstrcpy(mask,Mask); while (ff_eos == 0) { -- cgit