diff options
author | Michael Adam <obnox@samba.org> | 2011-11-08 08:04:28 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-11-09 01:02:08 +0100 |
commit | 33ccdf88f975e5ccfbeaf978e059841bc2150985 (patch) | |
tree | a75a0f1d7c0eb26306564ec15f5017c6918a3d42 /source4/torture/smb2/util.c | |
parent | 9fe4709a4b4cb4fd5bad6d8c8655e94aa59a03cf (diff) | |
download | samba-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.c | 22 |
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; +} + |