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

source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/pvfs_lock.c
source4/ntvfs/posix/pvfs_read.c
source4/ntvfs/posix/pvfs_setfileinfo.c

index 78169272e41f8eeac4966cfb43a2bfc9befc8ce6..cbe3e4e233ff5b632bc6a94ba58af65d5b977ccf 100644 (file)
@@ -568,7 +568,7 @@ static NTSTATUS pvfs_access_check_unix(struct pvfs_state *pvfs,
                return NT_STATUS_ACCESS_DENIED;
        }
 
-       if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+       if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
                /* on SMB, this bit is always granted, even if not
                   asked for */
                *access_mask |= SEC_FILE_READ_ATTRIBUTE;
@@ -621,7 +621,7 @@ NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
 
        /* expand the generic access bits to file specific bits */
        *access_mask = pvfs_translate_mask(*access_mask);
-       if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+       if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
                *access_mask &= ~SEC_FILE_READ_ATTRIBUTE;
        }
 
@@ -647,7 +647,7 @@ NTSTATUS pvfs_access_check(struct pvfs_state *pvfs,
        status = se_access_check(sd, token, *access_mask, access_mask);
        talloc_free(acl);
 done:
-       if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+       if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
                /* on SMB, this bit is always granted, even if not
                   asked for */
                *access_mask |= SEC_FILE_READ_ATTRIBUTE;
@@ -745,7 +745,7 @@ NTSTATUS pvfs_access_check_create(struct pvfs_state *pvfs,
                *access_mask &= ~SEC_FLAG_MAXIMUM_ALLOWED;
        }
 
-       if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+       if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
                /* on SMB, this bit is always granted, even if not
                   asked for */
                *access_mask |= SEC_FILE_READ_ATTRIBUTE;
index 0d99860e59be3ea46073e8d261d9349f650f9b0e..54c7a33d3a0f48333c79324070d13971edaa54f8 100644 (file)
@@ -116,7 +116,7 @@ static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice
 
        /* we don't retry on a cancel */
        if (reason == PVFS_WAIT_CANCEL) {
-               if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+               if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) {
                        status = NT_STATUS_FILE_LOCK_CONFLICT;
                } else {
                        status = NT_STATUS_CANCELLED;
index 34742fcf66e756f86a491d4c43e8d488f028ec3f..f60b721e418cc49605130160bd1c04d121c8d502 100644 (file)
@@ -59,7 +59,7 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
        }
 
        maxcnt = rd->readx.in.maxcnt;
-       if (maxcnt > 2*UINT16_MAX && req->ctx->protocol < PROTOCOL_SMB2) {
+       if (maxcnt > 2*UINT16_MAX && req->ctx->protocol < PROTOCOL_SMB2_02) {
                DEBUG(3,(__location__ ": Invalid SMB maxcnt 0x%x\n", maxcnt));
                return NT_STATUS_INVALID_PARAMETER;
        }
index 92fe0148e3463753c4f581579e6a246f64f09193..cbb5c7853cbcf4fe96aa481ae4bbaa632384e492 100644 (file)
@@ -130,7 +130,7 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
 
        /* renames are only allowed within a directory */
        if (strchr_m(info->rename_information.in.new_name, '\\') &&
-           (req->ctx->protocol != PROTOCOL_SMB2)) {
+           (req->ctx->protocol < PROTOCOL_SMB2_02)) {
                return NT_STATUS_NOT_SUPPORTED;
        }
 
@@ -143,7 +143,7 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
        /* w2k3 does not appear to allow relative rename. On SMB2, vista sends it sometimes,
           but I suspect it is just uninitialised memory */
        if (info->rename_information.in.root_fid != 0 && 
-           (req->ctx->protocol != PROTOCOL_SMB2)) {
+           (req->ctx->protocol < PROTOCOL_SMB2_02)) {
                return NT_STATUS_INVALID_PARAMETER;
        }