s4:ntvfs: s/== PROTOCOL_SMB2/>= PROTOCOL_SMB2_02/
authorStefan Metzmacher <metze@samba.org>
Mon, 5 Sep 2011 11:10:42 +0000 (13:10 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 5 Sep 2011 11:17:33 +0000 (13:17 +0200)
metze

source4/ntvfs/common/brlock_tdb.c
source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/pvfs_fileinfo.c
source4/ntvfs/posix/pvfs_open.c
source4/ntvfs/posix/pvfs_qfileinfo.c
source4/ntvfs/posix/pvfs_read.c
source4/ntvfs/posix/pvfs_resolve.c
source4/ntvfs/posix/pvfs_setfileinfo.c

index 817448377cfab4a5408f0dc5b33c339441b287c5..fcaa756530229b3efcee512a167076abef6d8631 100644 (file)
@@ -242,7 +242,7 @@ static NTSTATUS brl_tdb_lock_failed(struct brl_handle *brlh, struct lock_struct
         */
 
        /* in SMB2 mode always return NT_STATUS_LOCK_NOT_GRANTED! */
-       if (lock->ntvfs->ctx->protocol == PROTOCOL_SMB2) {
+       if (lock->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02) {
                return NT_STATUS_LOCK_NOT_GRANTED;
        }
 
index d7a778e1f7d35e5b28820ab504801a4416084492..78169272e41f8eeac4966cfb43a2bfc9befc8ce6 100644 (file)
@@ -595,7 +595,7 @@ NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
        bool allow_delete = false;
 
        /* on SMB2 a blank access mask is always denied */
-       if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2 &&
+       if (pvfs->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02 &&
            *access_mask == 0) {
                return NT_STATUS_ACCESS_DENIED;
        }
index a372383daac68021780fd23b8c25e98fe3b82c62..b1fd55acebc04fd0e8b005bf5be94e3a900954db 100644 (file)
@@ -82,7 +82,7 @@ NTSTATUS pvfs_fill_dos_info(struct pvfs_state *pvfs, struct pvfs_filename *name,
        name->dos.alloc_size = pvfs_round_alloc_size(pvfs, name->st.st_size);
        name->dos.nlink = name->st.st_nlink;
        name->dos.ea_size = 4;
-       if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2) {
+       if (pvfs->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02) {
                /* SMB2 represents a null EA with zero bytes */
                name->dos.ea_size = 0;
        }
index d56bce58f75273d48e436e4a83713cb77c70abc6..c0f55e8e73ceda6d59a87844e9f9f6cdc83277d8 100644 (file)
@@ -1284,7 +1284,7 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
        }
 
        /* what does this bit really mean?? */
-       if (req->ctx->protocol == PROTOCOL_SMB2 &&
+       if (req->ctx->protocol >= PROTOCOL_SMB2_02 &&
            access_mask == SEC_STD_SYNCHRONIZE) {
                return NT_STATUS_ACCESS_DENIED;
        }
@@ -1502,7 +1502,7 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
         * on existing files
         */
        if (create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE &&
-           req->ctx->protocol == PROTOCOL_SMB2) {
+           req->ctx->protocol >= PROTOCOL_SMB2_02) {
                del_on_close = true;
        } else {
                del_on_close = false;
index 92843067539fe3168f085c69d049ca18b60761f8..ac3e6a65f5acab757aa6159126f2762bdea69b12 100644 (file)
@@ -222,7 +222,7 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
 
        case RAW_FILEINFO_NAME_INFO:
        case RAW_FILEINFO_NAME_INFORMATION:
-               if (req->ctx->protocol == PROTOCOL_SMB2) {
+               if (req->ctx->protocol >= PROTOCOL_SMB2_02) {
                        /* strange that SMB2 doesn't have this */
                        return NT_STATUS_NOT_SUPPORTED;
                }
index d25036ad4b0721e73fa3c634654cb3f9cfddd4d1..34742fcf66e756f86a491d4c43e8d488f028ec3f 100644 (file)
@@ -96,7 +96,7 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
        }
 
        /* only SMB2 honors mincnt */
-       if (req->ctx->protocol == PROTOCOL_SMB2) {
+       if (req->ctx->protocol >= PROTOCOL_SMB2_02) {
                if (rd->readx.in.mincnt > ret ||
                    (ret == 0 && maxcnt > 0)) {
                        return NT_STATUS_END_OF_FILE;
index 0da64a790dabb5a6db381dda5eb1362008cd0e4d..255728382ebbb7637763822c65bf2e2010ee4bc2 100644 (file)
@@ -524,7 +524,7 @@ NTSTATUS pvfs_resolve_name(struct pvfs_state *pvfs,
        }
 
        /* SMB2 doesn't allow a leading slash */
-       if (req->ctx->protocol == PROTOCOL_SMB2 &&
+       if (req->ctx->protocol >= PROTOCOL_SMB2_02 &&
            *cifs_name == '\\') {
                return NT_STATUS_INVALID_PARAMETER;
        }
index ca8e9cbe3f12fb5b1d6d6bd6b3f2cabe9782fd83..92fe0148e3463753c4f581579e6a246f64f09193 100644 (file)
@@ -148,7 +148,7 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
        }
 
        /* construct the fully qualified windows name for the new file name */
-       if (req->ctx->protocol == PROTOCOL_SMB2) {
+       if (req->ctx->protocol >= PROTOCOL_SMB2_02) {
                /* SMB2 sends the full path of the new name */
                new_name = talloc_asprintf(req, "\\%s", info->rename_information.in.new_name);
        } else {