smb.h: More NT SMB stuff (just defines).
authorJeremy Allison <jra@samba.org>
Tue, 26 May 1998 19:37:31 +0000 (19:37 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 26 May 1998 19:37:31 +0000 (19:37 +0000)
smbpass.c: Do *NOT* make this function static. It breaks the compile on gcc
util.c: Getting closer to MS wildcard semantics. A trailing '*' matches
        any trailing dot-separated components.
trans2.c: Removed hacks that change multiple '?' -> '*' as this
          breaks things now.
trans2.h: Removed NT_FILE_ATTRIBUTE_NORMAL - now FILE_ATTRIBUTE_NORMAL is defined
          in smb.h.
Jeremy.
(This used to be commit 42a65511068cd9006350c80bbed2f346f3f01cb0)

source3/include/smb.h
source3/include/trans2.h
source3/lib/util.c
source3/passdb/smbpass.c
source3/smbd/trans2.c

index 31935b636d45ae86ced87bfa63061c491b7a0083..0382cf2c71c034bf63e8a91da2a55ce5a624385b 100644 (file)
@@ -1037,6 +1037,15 @@ struct parm_struct
 /* DesiredAccess */
 #if 0
 /* TODO.... JRA */
+#define SPECIFIC_RIGHTS_MASK 0x00FFFFL
+#define STANDARD_RIGHTS_MASK 0xFF0000L
+#define DELETE_ACCESS        (1L<<16)
+#define READ_CONTROL_ACCESS  (1L<<17)
+#define WRITE_DAC_ACCESS     (1L<<18)
+#define WRITE_OWNER_ACCESS   (1L<<19)
+#define SYNCHRONIZE_ACCESS   (1L<<20)
+#define SYSTEM_SECURITY_ACCESS (1L<<24)
+
 #define GENERIC_READ xxx?
 #define GENERIC_WRITE xxx?
 #endif
index 62b6a1a9bf71a50a24e1b328e213cc1dcefb51cc..894823602eecf801b8603be1a7a84baa90b8c60b 100644 (file)
@@ -233,11 +233,6 @@ Byte offset   Type     name                description
 
 #define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName))
 
-/* NT uses a FILE_ATTRIBUTE_NORMAL when no other attributes
-   are set. */
-
-#define NT_FILE_ATTRIBUTE_NORMAL        0x80
-
 #endif
 
 
index ebf66c56f460dbe4a355b9542745a67249ddf93e..98cd150d7f5c3437365eb7bbb43c365566b90b54 100644 (file)
@@ -3103,6 +3103,7 @@ BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2)
      * characters.
      */
     char *fp, *rp, *cp2, *cp1;
+    BOOL last_wcard_was_star = False;
     matched = False;
     for( cp1 = ebase, cp2 = sbase; cp1;) {
       fp = strchr(cp2, '.');
@@ -3111,12 +3112,17 @@ BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2)
       rp = strchr(cp1, '.');
       if(rp)
         *rp = '\0';
+
+      if(cp1[strlen(cp1)-1] == '*')
+        last_wcard_was_star = True;
+      else
+        last_wcard_was_star = False;
       if(!do_match(cp2, cp1, case_sig))
         break;
       cp2 = fp ? fp + 1 : "";
       cp1 = rp ? rp + 1 : NULL;
     } 
-    if(cp1 == NULL)
+    if(cp1 == NULL && ((*cp2 == '\0') || last_wcard_was_star))
       matched = True;
   } else {
     matched = do_match(sbase,ebase,case_sig) && do_match(sext,eext,case_sig);
index a9efcf2a52de8f7d329d678d715707895bb36250..abb037b95df0d565f6625c7f0d2c26c4efb0e908 100644 (file)
@@ -952,5 +952,6 @@ struct passdb_ops *file_initialize_password_db(void)
 }
 
 #else
-       static void dummy_function(void) { } /* stop some compilers complaining */
+ /* Do *NOT* make this function static. It breaks the compile on gcc. JRA */
+ void dummy_function(void) { } /* stop some compilers complaining */
 #endif /* USE_SMBPASS_DB */
index 4c06377bda3a328674205b6bce8de284690f785d..4fefb4b39ce9cee0b832e2500d859f0dc49fc0f5 100644 (file)
@@ -401,7 +401,7 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l
   p = pdata;
   nameptr = p;
 
-  nt_extmode = mode ? mode : NT_FILE_ATTRIBUTE_NORMAL;
+  nt_extmode = mode ? mode : FILE_ATTRIBUTE_NORMAL;
 
   switch (info_level)
     {
@@ -693,13 +693,21 @@ static int call_trans2findfirst(char *inbuf, char *outbuf, int bufsize, int cnum
       p++;
     }
   }
-  
+
+#if 0 /* JRA */
+  /*
+   * Now we have a working mask_match in util.c, I believe
+   * we no longer need these hacks (in fact they break
+   * things). JRA. 
+   */
+
   /* a special case for 16 bit apps */
   if (strequal(mask,"????????.???")) pstrcpy(mask,"*");
 
   /* handle broken clients that send us old 8.3 format */
   string_sub(mask,"????????","*");
   string_sub(mask,".???",".*");
+#endif /* JRA */
 
   /* Save the wildcard match and attribs we are using on this directory - 
      needed as lanman2 assumes these are being saved between calls */