diff options
author | Michael Adam <obnox@samba.org> | 2011-11-08 18:15:12 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-11-09 01:02:08 +0100 |
commit | ef6c0974a0899bf5add9bd031db8c734fc5cb536 (patch) | |
tree | b181df9c327d705ae68490481864e17d3f234c50 /source4/torture/smb2 | |
parent | 4746edc55d9699ad595b95520fddc747611d62b1 (diff) | |
download | samba-ef6c0974a0899bf5add9bd031db8c734fc5cb536.tar.gz samba-ef6c0974a0899bf5add9bd031db8c734fc5cb536.tar.bz2 samba-ef6c0974a0899bf5add9bd031db8c734fc5cb536.zip |
s4:torture:smb2: add smb2_generic_create_share() that also takes the sharemode as parameter
Diffstat (limited to 'source4/torture/smb2')
-rw-r--r-- | source4/torture/smb2/util.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c index 748a424344..973e76db31 100644 --- a/source4/torture/smb2/util.c +++ b/source4/torture/smb2/util.c @@ -569,10 +569,11 @@ uint8_t smb2_util_oplock_level(const char *op) * Helper functions to fill a smb2_create struct for several * open scenarios. */ -void smb2_generic_create(struct smb2_create *io, struct smb2_lease *ls, - bool dir, const char *name, uint32_t disposition, - uint8_t oplock, uint64_t leasekey, - uint32_t leasestate) +void smb2_generic_create_share(struct smb2_create *io, struct smb2_lease *ls, + bool dir, const char *name, uint32_t disposition, + uint32_t share_access, + uint8_t oplock, uint64_t leasekey, + uint32_t leasestate) { ZERO_STRUCT(*io); io->in.security_flags = 0x00; @@ -582,9 +583,7 @@ void smb2_generic_create(struct smb2_create *io, struct smb2_lease *ls, io->in.reserved = 0x00000000; io->in.desired_access = SEC_RIGHTS_FILE_ALL; io->in.file_attributes = FILE_ATTRIBUTE_NORMAL; - io->in.share_access = NTCREATEX_SHARE_ACCESS_READ | - NTCREATEX_SHARE_ACCESS_WRITE | - NTCREATEX_SHARE_ACCESS_DELETE; + io->in.share_access = share_access; io->in.create_disposition = disposition; io->in.create_options = NTCREATEX_OPTIONS_SEQUENTIAL_ONLY | NTCREATEX_OPTIONS_ASYNC_ALERT | @@ -608,6 +607,17 @@ void smb2_generic_create(struct smb2_create *io, struct smb2_lease *ls, } } +void smb2_generic_create(struct smb2_create *io, struct smb2_lease *ls, + bool dir, const char *name, uint32_t disposition, + uint8_t oplock, uint64_t leasekey, + uint32_t leasestate) +{ + smb2_generic_create_share(io, ls, dir, name, disposition, + smb2_util_share_access("RWD"), + oplock, + leasekey, leasestate); +} + void smb2_lease_create(struct smb2_create *io, struct smb2_lease *ls, bool dir, const char *name, uint64_t leasekey, uint32_t leasestate) |