pass the desired access into cli_nt_create()
authorAndrew Tridgell <tridge@samba.org>
Mon, 4 Dec 2000 07:26:56 +0000 (07:26 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 4 Dec 2000 07:26:56 +0000 (07:26 +0000)
(This used to be commit a2d07994e0376a8d530d262573c96710bdff2236)

source3/include/proto.h
source3/include/smb.h
source3/libsmb/clifile.c
source3/rpc_client/cli_pipe.c

index 0e326aaf1e2fab127c380a93b5361c033367e40d..b51b57716bd4bdcfa884fc8e894b8a472e7271a6 100644 (file)
@@ -675,7 +675,7 @@ 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(struct cli_state *cli, char *fname);
+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);
 BOOL cli_lock(struct cli_state *cli, int fnum, 
index 300fd9872adef8b84c21793126db48472e92c4d9..1e5d31299770fb230b658c62019c4bda4df72b37 100644 (file)
@@ -1076,6 +1076,9 @@ struct bitmap {
 #define FILE_WRITE_ATTRIBUTES 0x100
 
 #define FILE_ALL_ATTRIBUTES   0x1FF
+
+/* the desired access to use when opening a pipe */
+#define DESIRED_ACCESS_PIPE 0x2019f
  
 /* Generic access masks & rights. */
 #define SPECIFIC_RIGHTS_MASK 0x00FFFFL
index c23a43f95fe31e2738fe8f1d5fcd941f1a370ccc..cb492f1539b9a80f8ebbac6fe027ed2b40cda308 100644 (file)
@@ -149,7 +149,7 @@ BOOL cli_rmdir(struct cli_state *cli, char *dname)
        p = smb_buf(cli->outbuf);
        *p++ = 4;      
        pstrcpy(p,dname);
-    unix_to_dos(p,True);
+       unix_to_dos(p,True);
 
        cli_send_smb(cli);
        if (!cli_receive_smb(cli)) {
@@ -168,7 +168,7 @@ BOOL cli_rmdir(struct cli_state *cli, char *dname)
 /****************************************************************************
 open a file
 ****************************************************************************/
-int cli_nt_create(struct cli_state *cli, char *fname)
+int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess)
 {
        char *p;
 
@@ -187,7 +187,7 @@ int cli_nt_create(struct cli_state *cli, char *fname)
        else
                SIVAL(cli->outbuf,smb_ntcreate_Flags, 0);
        SIVAL(cli->outbuf,smb_ntcreate_RootDirectoryFid, 0x0);
-       SIVAL(cli->outbuf,smb_ntcreate_DesiredAccess, 0x2019f);
+       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);
index 3a875cc46bd5fd9d30c4f127011b49193ee3cf49..7ca274efc32a83550a64100d7ba9ea2de7d05c4c 100644 (file)
@@ -1169,7 +1169,7 @@ BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name)
        int fnum;
 
        if (cli->capabilities & CAP_NT_SMBS) {
-               if ((fnum = cli_nt_create(cli, &(pipe_name[5]))) == -1) {
+               if ((fnum = cli_nt_create(cli, &(pipe_name[5], DESIRED_ACCESS_PIPE))) == -1) {
                        DEBUG(0,("cli_nt_session_open: cli_nt_create failed on pipe %s to machine %s.  Error was %s\n",
                                 &(pipe_name[5]), cli->desthost, cli_errstr(cli)));
                        return False;