summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-04 23:42:17 +0000
committerJeremy Allison <jra@samba.org>2001-04-04 23:42:17 +0000
commit852242a1b53069e5e6c8861f8243fe4a5016001a (patch)
treec3191fbb57a6110298771770e9290f8bb8021760 /source3/include
parentdcc01ec5fb16b3529afef6c13324463db37ad147 (diff)
downloadsamba-852242a1b53069e5e6c8861f8243fe4a5016001a.tar.gz
samba-852242a1b53069e5e6c8861f8243fe4a5016001a.tar.bz2
samba-852242a1b53069e5e6c8861f8243fe4a5016001a.zip
I know we're supposed to be feature frozen, but I couldn't resist this... :-).
I worked out and added the per-share get/set RPCs for security descriptors. Currently this code returns Everyone, full access on get and permission denied on set, but backending this with a tdb and checking it on tconX (to give full NT semantics for security on shares) is now an excersise for the reader... :-). Jeremy. (This used to be commit 3bfd155ba78798c50588904d4ea3389f50f8abb6)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h10
-rw-r--r--source3/include/rpc_srvsvc.h78
2 files changed, 83 insertions, 5 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 69aabab485..3af984788c 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -3494,6 +3494,13 @@ void init_srv_share_info2(SH_INFO_2 *sh2,
char *net_name, uint32 type, char *remark,
uint32 perms, uint32 max_uses, uint32 num_uses,
char *path, char *passwd);
+void init_srv_share_info502(SH_INFO_502 *sh502,
+ char *net_name, uint32 type, char *remark,
+ uint32 perms, uint32 max_uses, uint32 num_uses,
+ char *path, char *passwd, SEC_DESC *psd, size_t sd_size);
+void init_srv_share_info502_str(SH_INFO_502_STR *sh502,
+ char *net_name, char *remark,
+ char *path, char *passwd, SEC_DESC *psd, size_t sd_size);
void init_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n,
char *srv_name, uint32 info_level,
uint32 preferred_len, ENUM_HND *hnd);
@@ -3501,6 +3508,8 @@ BOOL srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *
BOOL srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth);
BOOL srv_io_q_net_share_get_info(char *desc, SRV_Q_NET_SHARE_GET_INFO *q_n, prs_struct *ps, int depth);
BOOL srv_io_r_net_share_get_info(char *desc, SRV_R_NET_SHARE_GET_INFO *r_n, prs_struct *ps, int depth);
+BOOL srv_io_q_net_share_set_info(char *desc, SRV_Q_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth);
+BOOL srv_io_r_net_share_set_info(char *desc, SRV_R_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth);
void init_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name);
void init_srv_sess_info0(SESS_INFO_0 *ss0, char *name);
void init_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user);
@@ -3773,6 +3782,7 @@ uint32 _srv_net_conn_enum(pipes_struct *p, SRV_Q_NET_CONN_ENUM *q_u, SRV_R_NET_C
uint32 _srv_net_sess_enum(pipes_struct *p, SRV_Q_NET_SESS_ENUM *q_u, SRV_R_NET_SESS_ENUM *r_u);
uint32 _srv_net_share_enum(pipes_struct *p, SRV_Q_NET_SHARE_ENUM *q_u, SRV_R_NET_SHARE_ENUM *r_u);
uint32 _srv_net_share_get_info(pipes_struct *p, SRV_Q_NET_SHARE_GET_INFO *q_u, SRV_R_NET_SHARE_GET_INFO *r_u);
+uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, SRV_R_NET_SHARE_SET_INFO *r_u);
uint32 _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET_REMOTE_TOD *r_u);
/*The following definitions come from rpc_server/srv_util.c */
diff --git a/source3/include/rpc_srvsvc.h b/source3/include/rpc_srvsvc.h
index b18c70bf25..dcf466fbe3 100644
--- a/source3/include/rpc_srvsvc.h
+++ b/source3/include/rpc_srvsvc.h
@@ -1,4 +1,4 @@
-/*
+/*
Unix SMB/Netbios implementation.
Version 1.9.
SMB parameters and setup
@@ -31,6 +31,7 @@
#define SRV_NETSESSENUM 0x0c
#define SRV_NETSHAREENUM 0x0f
#define SRV_NET_SHARE_GET_INFO 0x10
+#define SRV_NET_SHARE_SET_INFO 0x11
#define SRV_NET_SRV_GET_INFO 0x15
#define SRV_NET_SRV_SET_INFO 0x16
#define SRV_NET_REMOTE_TOD 0x1c
@@ -305,6 +306,44 @@ typedef struct share_info_2_info
} SRV_SHARE_INFO_2;
+/* SH_INFO_502 (pointers to level 502 share info strings) */
+typedef struct ptr_share_info502
+{
+ uint32 ptr_netname; /* pointer to net name. */
+ uint32 type; /* ipc, print, disk ... */
+ uint32 ptr_remark; /* pointer to comment. */
+ uint32 perms; /* permissions */
+ uint32 max_uses; /* maximum uses */
+ uint32 num_uses; /* current uses */
+ uint32 ptr_path; /* pointer to path name */
+ uint32 ptr_passwd; /* pointer to password */
+ uint32 sd_size; /* size of security descriptor */
+ uint32 ptr_sd; /* pointer to security descriptor */
+
+} SH_INFO_502;
+
+/* SH_INFO_502_STR (level 502 share info strings) */
+typedef struct str_share_info502
+{
+ UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
+ UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */
+ UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
+ UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */
+
+ uint32 sd_size;
+ SEC_DESC *sd;
+
+} SH_INFO_502_STR;
+
+/* SRV_SHARE_INFO_502 */
+/* SRV_SHARE_INFO_2 */
+typedef struct share_info_502_info
+{
+ SH_INFO_502 info_502;
+ SH_INFO_502_STR info_502_str;
+
+} SRV_SHARE_INFO_502;
+
/* SRV_SHARE_INFO_1005 */
typedef struct share_info_1005_info
{
@@ -325,6 +364,7 @@ typedef struct srv_share_info_ctr_info
union {
SRV_SHARE_INFO_1 *info1; /* share info level 1 */
SRV_SHARE_INFO_2 *info2; /* share info level 2 */
+ SRV_SHARE_INFO_502 *info502; /* share info level 502 */
void *info;
} share;
@@ -370,22 +410,50 @@ typedef struct q_net_share_get_info_info
} SRV_Q_NET_SHARE_GET_INFO;
-/* SRV_R_NET_SHARE_GET_INFO */
-typedef struct r_net_share_get_info_info
-{
+/* SRV_SHARE_INFO */
+typedef struct srv_share_info {
uint32 switch_value;
uint32 ptr_share_ctr;
union {
SRV_SHARE_INFO_1 info1;
SRV_SHARE_INFO_2 info2;
- SRV_SHARE_INFO_1005 info1005;
+ SRV_SHARE_INFO_502 info502;
+ SRV_SHARE_INFO_1005 info1005;
} share;
+} SRV_SHARE_INFO;
+/* SRV_R_NET_SHARE_GET_INFO */
+typedef struct r_net_share_get_info_info
+{
+ SRV_SHARE_INFO info;
uint32 status;
} SRV_R_NET_SHARE_GET_INFO;
+/* JRA. NB. We also need level 1004, 1006 and 1501 here. */
+
+/* SRV_Q_NET_SHARE_SET_INFO */
+typedef struct q_net_share_set_info_info
+{
+ uint32 ptr_srv_name;
+ UNISTR2 uni_srv_name;
+
+ UNISTR2 uni_share_name;
+ uint32 info_level;
+
+ SRV_SHARE_INFO info;
+
+} SRV_Q_NET_SHARE_SET_INFO;
+
+/* SRV_R_NET_SHARE_SET_INFO */
+typedef struct r_net_share_set_info
+{
+ uint32 switch_value; /* switch value */
+
+ uint32 status; /* return status */
+
+} SRV_R_NET_SHARE_SET_INFO;
/* FILE_INFO_3 (level 3 file info strings) */
typedef struct file_info3_info