From cf8949f684ee9adcd35d56d923b2f5733efc05ac Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 24 Mar 2005 02:23:32 +0000 Subject: [PATCH] r6022: Fix for bug #2533. Incorrect dir listings from OS/2 clients. Jeremy. --- source/lib/util.c | 4 +++- source/smbd/dir.c | 7 ------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/source/lib/util.c b/source/lib/util.c index 8db7bb38ab5..cd30ef9814b 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -641,7 +641,9 @@ void make_dir_struct(char *buf, const char *mask, const char *fname,SMB_OFF_T si put_dos_date(buf,22,date); SSVAL(buf,26,size & 0xFFFF); SSVAL(buf,28,(size >> 16)&0xFFFF); - push_ascii(buf+30,fname,12,0); + /* We only uppercase if the protocol is downrev. + Strange, but verified on W2K3. Needed for OS/2. JRA. */ + push_ascii(buf+30,fname,12,Protocol < PROTOCOL_NT1 ? STR_UPPER : 0); DEBUG(8,("put name [%s] from [%s] into dir struct\n",buf+30, fname)); } diff --git a/source/smbd/dir.c b/source/smbd/dir.c index 1ec35d839c2..6ecdcec461f 100644 --- a/source/smbd/dir.c +++ b/source/smbd/dir.c @@ -713,16 +713,11 @@ BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype, pstring fname SMB_STRUCT_STAT sbuf; pstring path; pstring pathreal; - BOOL isrootdir; pstring filename; BOOL needslash; *path = *pathreal = *filename = 0; - isrootdir = (strequal(conn->dirpath,"./") || - strequal(conn->dirpath,".") || - strequal(conn->dirpath,"/")); - needslash = ( conn->dirpath[strlen(conn->dirpath) -1] != '/'); if (!conn->dirptr) @@ -747,8 +742,6 @@ BOOL get_dir_entry(connection_struct *conn,char *mask,int dirtype, pstring fname if ((strcmp(mask,"*.*") == 0) || mask_match(filename,mask,False) || mangle_mask_match(conn,filename,mask)) { - if (isrootdir && (strequal(filename,"..") || strequal(filename,"."))) - continue; if (!mangle_is_8_3(filename, False)) mangle_map(filename,True,False,SNUM(conn)); -- 2.11.4.GIT