From 871a4294043e2e74d906f63ad97a31e35abd0374 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 16 Mar 2001 03:25:13 +0000 Subject: added STR_ASCII support to clistr_pull() (This used to be commit 797293811ef0a79eecc460c471135c89090f8c06) --- source3/libsmb/clilist.c | 6 +++--- source3/libsmb/clistr.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 0033f05942..9080a9c221 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -333,7 +333,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, interpret a short filename structure The length of the structure is returned ****************************************************************************/ -static int interpret_short_filename(char *p,file_info *finfo) +static int interpret_short_filename(struct cli_state *cli, char *p,file_info *finfo) { extern file_info def_finfo; @@ -345,7 +345,7 @@ static int interpret_short_filename(char *p,file_info *finfo) finfo->ctime = make_unix_date(p+22); finfo->mtime = finfo->atime = finfo->ctime; finfo->size = IVAL(p,26); - pstrcpy(finfo->name,p+30); + clistr_pull(cli, finfo->name, p+30, sizeof(finfo->name), 12, STR_CONVERT|STR_ASCII); if (strcmp(finfo->name, "..") && strcmp(finfo->name, ".")) fstrcpy(finfo->short_name,finfo->name); @@ -461,7 +461,7 @@ int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute, for (p=dirlist,i=0;iinbuf, src)) { + if (!(flags & STR_ASCII) && clistr_align(cli->inbuf, src)) { src++; if (src_len > 0) src_len--; } - if (!(flags & STR_UNICODE) && !(SVAL(cli->inbuf, smb_flg2) & FLAGS2_UNICODE_STRINGS)) { + if ((flags & STR_ASCII) || + (!(flags & STR_UNICODE) && !(SVAL(cli->inbuf, smb_flg2) & FLAGS2_UNICODE_STRINGS))) { /* the server doesn't want unicode */ if (flags & STR_TERMINATE) { safe_strcpy(dest, src, dest_len); -- cgit