diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-10-31 09:06:48 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2013-04-18 15:11:48 +0200 |
commit | 3c9846cafde28fb8d40ae81cafb03f2e2ec8d9e2 (patch) | |
tree | 25fb67e3251e16a2a57f91628649c91a1c49b0ec /source4/torture | |
parent | 6c81893b342786d5f63aaa89e855e9378def50c3 (diff) | |
download | samba-3c9846cafde28fb8d40ae81cafb03f2e2ec8d9e2.tar.gz samba-3c9846cafde28fb8d40ae81cafb03f2e2ec8d9e2.tar.bz2 samba-3c9846cafde28fb8d40ae81cafb03f2e2ec8d9e2.zip |
s4:torture/smb2: add smb2_lease_v2_create_share() helper
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smb2/util.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c index 7e882349c9..59748b7e25 100644 --- a/source4/torture/smb2/util.c +++ b/source4/torture/smb2/util.c @@ -729,6 +729,34 @@ void smb2_lease_create(struct smb2_create *io, struct smb2_lease *ls, leasekey, leasestate); } +void smb2_lease_v2_create_share(struct smb2_create *io, + struct smb2_lease *ls, + bool dir, + const char *name, + uint32_t share_access, + uint64_t leasekey, + const uint64_t *parentleasekey, + uint32_t leasestate, + uint16_t lease_epoch) +{ + smb2_generic_create_share(io, NULL, dir, name, NTCREATEX_DISP_OPEN_IF, + share_access, SMB2_OPLOCK_LEVEL_LEASE, 0, 0); + + if (ls) { + ZERO_STRUCT(*ls); + ls->lease_key.data[0] = leasekey; + ls->lease_key.data[1] = ~leasekey; + ls->lease_state = leasestate; + if (parentleasekey != NULL) { + ls->lease_flags |= SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET; + ls->parent_lease_key.data[0] = *parentleasekey; + ls->parent_lease_key.data[1] = ~(*parentleasekey); + } + ls->lease_epoch = lease_epoch; + io->in.lease_request_v2 = ls; + } +} + void smb2_oplock_create_share(struct smb2_create *io, const char *name, uint32_t share_access, uint8_t oplock) { |