summaryrefslogtreecommitdiff
path: root/source4/torture/smb2/util.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-11-08 08:04:28 +0100
committerMichael Adam <obnox@samba.org>2011-11-09 01:02:08 +0100
commit33ccdf88f975e5ccfbeaf978e059841bc2150985 (patch)
treea75a0f1d7c0eb26306564ec15f5017c6918a3d42 /source4/torture/smb2/util.c
parent9fe4709a4b4cb4fd5bad6d8c8655e94aa59a03cf (diff)
downloadsamba-33ccdf88f975e5ccfbeaf978e059841bc2150985.tar.gz
samba-33ccdf88f975e5ccfbeaf978e059841bc2150985.tar.bz2
samba-33ccdf88f975e5ccfbeaf978e059841bc2150985.zip
s4:torture:smb2: extract map_lease() to util.c as smb2_util_lease_state().
Diffstat (limited to 'source4/torture/smb2/util.c')
-rw-r--r--source4/torture/smb2/util.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index caa7fd4be5..49ffccda14 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -499,3 +499,25 @@ bool smb2_util_verify_attrib(TALLOC_CTX *tctx, struct smb2_tree *tree,
}
+uint32_t smb2_util_lease_state(const char *ls)
+{
+ uint32_t val = 0;
+ int i;
+
+ for (i = 0; i < strlen(ls); i++) {
+ switch (ls[i]) {
+ case 'R':
+ val |= SMB2_LEASE_READ;
+ break;
+ case 'H':
+ val |= SMB2_LEASE_HANDLE;
+ break;
+ case 'W':
+ val |= SMB2_LEASE_WRITE;
+ break;
+ }
+ }
+
+ return val;
+}
+