--- smbd/reply.c.orig 2007-03-08 18:04:11.180812000 -0800 +++ smbd/reply.c 2007-03-08 18:08:49.764857000 -0800 @@ -1121,33 +1121,25 @@ if (status_len == 0) { SMB_STRUCT_STAT sbuf; - pstring dir2; pstrcpy(directory,path); - pstrcpy(dir2,path); unix_convert(directory,conn,0,&bad_path,&sbuf); - unix_format(dir2); if (!check_name(directory,conn)) can_open = False; - p = strrchr_m(dir2,'/'); - if (p == NULL) { - pstrcpy(mask,dir2); - *dir2 = 0; + p = strrchr_m(directory,'/'); + if (!p) { + pstrcpy(mask,directory); + pstrcpy(directory,"."); } else { *p = 0; pstrcpy(mask,p+1); } - p = strrchr_m(directory,'/'); - if (!p) - *directory = 0; - else - *p = 0; - - if (strlen(directory) == 0) + if (*directory == '\0') { pstrcpy(directory,"."); + } memset((char *)status,'\0',21); SCVAL(status,0,(dirtype & 0x1F)); } else {