windows-unicode-support-20080511
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 11 May 2008 14:15:51 +0000 (14:15 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 11 May 2008 14:15:51 +0000 (14:15 +0000)
LICENSE MIT

In NTCreateX a zero length name is permitted.  This can occur when
opening the root directory of a share.

Change cm_NameEntries() to accept a size_t* instead of long* since
that permits better type safety.

src/WINNT/afsd/cm_dir.c
src/WINNT/afsd/cm_dir.h
src/WINNT/afsd/smb3.c

index 463d2fb..d1fdfbd 100644 (file)
@@ -121,7 +121,7 @@ cm_DirFreeBlobs(cm_dirOp_t * op, int firstblob, int nblobs);
  * the specified name.
  */
 long 
-cm_NameEntries(char *namep, long *lenp)
+cm_NameEntries(char *namep, size_t *lenp)
 {
     long i;
         
index febebb6..cc1b998 100644 (file)
@@ -139,7 +139,7 @@ extern long
 cm_EndDirOp(cm_dirOp_t * op);
 
 extern long
-cm_NameEntries(char *namep, long *lenp);
+cm_NameEntries(char *namep, size_t *lenp);
 
 extern long
 cm_DirCreateEntry(cm_dirOp_t * op, char *entry, cm_fid_t * cfid);
index fa40cae..4da9f02 100644 (file)
@@ -6771,9 +6771,6 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
     if (extAttributes & SMB_ATTR_READONLY) 
         initialModeBits &= ~0222;
 
-    if (nameLength == 0)
-        return CM_ERROR_INVAL;
-
     pathp = smb_ParseStringCb(inp, smb_GetSMBData(inp, NULL), nameLength,
                               NULL, SMB_STRF_ANSIPATH);