s3-smb Use FILE_ATTRIBUTE_VOLUME intead of aVOLID
authorAndrew Bartlett <abartlet@samba.org>
Fri, 29 Apr 2011 01:52:48 +0000 (11:52 +1000)
committerJeremy Allison <jra@samba.org>
Fri, 29 Apr 2011 16:51:30 +0000 (09:51 -0700)
This means we use just one constant for this file attribute.

Andrew Bartlett
(cherry picked from commit 08c90d6f2df85499f43c5766a62839e80437290f)

source3/include/smb.h
source3/lib/util.c
source3/smbd/reply.c

index eff29c52491911c6bc729b65aa4741f9e182195c..9679a9755ab81ef7eb95456ae44c9914d9115024 100644 (file)
@@ -84,7 +84,6 @@ enum smb_read_errors {
 #define DIR_STRUCT_SIZE 43
 
 /* these define the attribute byte as seen by DOS */
-#define aVOLID (1L<<3)         /* 0x08 */
 #define aDIR (1L<<4)           /* 0x10 */
 #define aARCH (1L<<5)          /* 0x20 */
 
index 3537491bd34454423fd6df6e9a61ef70e8ae472c..55879cbd65be2b9b9699fb8686178a68fc59ec4f 100644 (file)
@@ -308,7 +308,7 @@ char *attrib_string(uint16 mode)
 
        attrstr[0] = 0;
 
-       if (mode & aVOLID) fstrcat(attrstr,"V");
+       if (mode & FILE_ATTRIBUTE_VOLUME) fstrcat(attrstr,"V");
        if (mode & aDIR) fstrcat(attrstr,"D");
        if (mode & aARCH) fstrcat(attrstr,"A");
        if (mode & FILE_ATTRIBUTE_HIDDEN) fstrcat(attrstr,"H");
index 6c498fd40e08b4b1df7f38aa3f9288ddd29c06d8..ad72e4b7a9dd7eed8bb32bcd126cd5f68efdb3e3 100644 (file)
@@ -1520,11 +1520,11 @@ void reply_search(struct smb_request *req)
        /* Initialize per SMBsearch/SMBffirst/SMBfunique operation data */
        dptr_init_search_op(dirptr);
 
-       if ((dirtype&0x1F) == aVOLID) {
+       if ((dirtype&0x1F) == FILE_ATTRIBUTE_VOLUME) {
                char buf[DIR_STRUCT_SIZE];
                memcpy(buf,status,21);
                if (!make_dir_struct(ctx,buf,"???????????",volume_label(SNUM(conn)),
-                               0,aVOLID,0,!allow_long_path_components)) {
+                               0,FILE_ATTRIBUTE_VOLUME,0,!allow_long_path_components)) {
                        reply_nterror(req, NT_STATUS_NO_MEMORY);
                        goto out;
                }
@@ -2160,7 +2160,7 @@ void reply_mknew(struct smb_request *req)
                goto out;
        }
 
-       if (fattr & aVOLID) {
+       if (fattr & FILE_ATTRIBUTE_VOLUME) {
                DEBUG(0,("Attempt to create file (%s) with volid set - "
                         "please report this\n",
                         smb_fname_str_dbg(smb_fname)));