summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-22 17:21:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:27 -0500
commitd9bdfb0a0720907151b71086be289a0f6ec2bb98 (patch)
treec112e6391bda1d5d49193e3049500ee42e7b168d
parent3553a24dfee94e96d40a5518c3ee90ed2480b97c (diff)
downloadsamba-d9bdfb0a0720907151b71086be289a0f6ec2bb98.tar.gz
samba-d9bdfb0a0720907151b71086be289a0f6ec2bb98.tar.bz2
samba-d9bdfb0a0720907151b71086be289a0f6ec2bb98.zip
r15814: add SMB2 Lock interface structure
metze (This used to be commit 8f1850ef65dc8c860912639d787d82399d015f13)
-rw-r--r--source4/libcli/raw/interfaces.h34
-rw-r--r--source4/libcli/raw/rawfile.c2
-rw-r--r--source4/ntvfs/ntvfs_generic.c3
3 files changed, 38 insertions, 1 deletions
diff --git a/source4/libcli/raw/interfaces.h b/source4/libcli/raw/interfaces.h
index 49ac702e45..8b144779f4 100644
--- a/source4/libcli/raw/interfaces.h
+++ b/source4/libcli/raw/interfaces.h
@@ -1781,7 +1781,12 @@ union smb_write {
};
-enum smb_lock_level {RAW_LOCK_LOCK, RAW_LOCK_UNLOCK, RAW_LOCK_LOCKX};
+enum smb_lock_level {
+ RAW_LOCK_LOCK,
+ RAW_LOCK_UNLOCK,
+ RAW_LOCK_LOCKX,
+ RAW_LOCK_SMB2
+};
/* the generic interface is defined to be equal to the lockingX interface */
#define RAW_LOCK_GENERIC RAW_LOCK_LOCKX
@@ -1815,6 +1820,33 @@ union smb_lock {
uint32_t offset;
} in;
} lock, unlock;
+
+ /* SMB2 Lock */
+ struct smb2_lock {
+ enum smb_lock_level level;
+ struct {
+ union smb_handle file;
+
+ /* static body buffer 48 (0x30) bytes */
+ /* uint16_t buffer_code; 0x30 */
+ uint16_t unknown1; /* must be 0x0001 */
+ uint32_t unknown2;
+ /* struct smb2_handle handle; */
+ uint64_t offset;
+ uint64_t count;
+ uint32_t unknown5;
+#define SMB2_LOCK_FLAG_NONE 0x00000000
+#define SMB2_LOCK_FLAG_EXCLUSIV 0x00000002
+#define SMB2_LOCK_FLAG_UNLOCK 0x00000004
+#define SMB2_LOCK_FLAGS_MASK 0x00000006
+ uint32_t flags;
+ } in;
+ struct {
+ /* static body buffer 4 (0x04) bytes */
+ /* uint16_t buffer_code; 0x04 */
+ uint16_t unknown1;
+ } out;
+ } smb2;
};
diff --git a/source4/libcli/raw/rawfile.c b/source4/libcli/raw/rawfile.c
index 3aad05a748..5a38d4083d 100644
--- a/source4/libcli/raw/rawfile.c
+++ b/source4/libcli/raw/rawfile.c
@@ -802,6 +802,8 @@ struct smbcli_request *smb_raw_lock_send(struct smbcli_tree *tree, union smb_loc
}
}
}
+ case RAW_LOCK_SMB2:
+ return NULL;
}
if (!smbcli_request_send(req)) {
diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c
index 922093a0a9..3283ee673d 100644
--- a/source4/ntvfs/ntvfs_generic.c
+++ b/source4/ntvfs/ntvfs_generic.c
@@ -969,6 +969,9 @@ _PUBLIC_ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
lck2->generic.in.ulock_cnt = 1;
lck2->generic.in.lock_cnt = 0;
break;
+
+ case RAW_LOCK_SMB2:
+ return NT_STATUS_INVALID_LEVEL;
}
lck2->generic.level = RAW_LOCK_GENERIC;