summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-29 00:58:52 +0000
committerJeremy Allison <jra@samba.org>2001-03-29 00:58:52 +0000
commit1b95784324cd518d166cc790d9b1cf8a7905aed6 (patch)
treea775cd918fefde0fdcc119af958f3e50f3d23ade /source3
parent559c1692e7b23aca69ca747098dc594b8e0e61d0 (diff)
downloadsamba-1b95784324cd518d166cc790d9b1cf8a7905aed6.tar.gz
samba-1b95784324cd518d166cc790d9b1cf8a7905aed6.tar.bz2
samba-1b95784324cd518d166cc790d9b1cf8a7905aed6.zip
Added cli_nt_create_full() as a way to get at all the ntcreate parameters.
Used in smbtorture mods. Re-cast cli_nt_create() as a call to cli_nt_create_full(). Jeremy. (This used to be commit f602fa1205e99541e825ccae8502c35cd0e7ccfc)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h3
-rw-r--r--source3/libsmb/clifile.c26
2 files changed, 23 insertions, 6 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ef5f60522b..38706b1d62 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -875,6 +875,9 @@ BOOL cli_rename(struct cli_state *cli, char *fname_src, char *fname_dst);
BOOL cli_unlink(struct cli_state *cli, char *fname);
BOOL cli_mkdir(struct cli_state *cli, char *dname);
BOOL cli_rmdir(struct cli_state *cli, char *dname);
+int cli_nt_create_full(struct cli_state *cli, char *fname, uint32 DesiredAccess,
+ uint32 FileAttributes, uint32 ShareAccess,
+ uint32 CreateDisposition, uint32 CreateOptions);
int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess);
int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode);
BOOL cli_close(struct cli_state *cli, int fnum);
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 79a168121b..bae07d34e6 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -167,9 +167,13 @@ BOOL cli_rmdir(struct cli_state *cli, char *dname)
}
/****************************************************************************
-open a file
+ open a file - exposing the full horror of the NT API :-).
+ Used in smbtorture.
****************************************************************************/
-int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess)
+
+int cli_nt_create_full(struct cli_state *cli, char *fname, uint32 DesiredAccess,
+ uint32 FileAttributes, uint32 ShareAccess,
+ uint32 CreateDisposition, uint32 CreateOptions)
{
char *p;
int len;
@@ -190,10 +194,10 @@ int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess)
SIVAL(cli->outbuf,smb_ntcreate_Flags, 0);
SIVAL(cli->outbuf,smb_ntcreate_RootDirectoryFid, 0x0);
SIVAL(cli->outbuf,smb_ntcreate_DesiredAccess, DesiredAccess);
- SIVAL(cli->outbuf,smb_ntcreate_FileAttributes, 0x0);
- SIVAL(cli->outbuf,smb_ntcreate_ShareAccess, 0x03);
- SIVAL(cli->outbuf,smb_ntcreate_CreateDisposition, 0x01);
- SIVAL(cli->outbuf,smb_ntcreate_CreateOptions, 0x0);
+ SIVAL(cli->outbuf,smb_ntcreate_FileAttributes, FileAttributes);
+ SIVAL(cli->outbuf,smb_ntcreate_ShareAccess, ShareAccess);
+ SIVAL(cli->outbuf,smb_ntcreate_CreateDisposition, CreateDisposition);
+ SIVAL(cli->outbuf,smb_ntcreate_CreateOptions, CreateOptions);
SIVAL(cli->outbuf,smb_ntcreate_ImpersonationLevel, 0x02);
p = smb_buf(cli->outbuf);
@@ -221,6 +225,16 @@ int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess)
/****************************************************************************
open a file
+****************************************************************************/
+
+int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess)
+{
+ return cli_nt_create_full(cli, fname, DesiredAccess, 0,
+ FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_EXISTS_OPEN, 0x0);
+}
+
+/****************************************************************************
+open a file
WARNING: if you open with O_WRONLY then getattrE won't work!
****************************************************************************/
int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode)