Fill in a share info level 1 structure.
********************************************************************/
-static void init_srv_share_info_1(SRV_SHARE_INFO_1 *sh1, int snum)
+static void init_srv_share_info_1(pipes_struct *p, SRV_SHARE_INFO_1 *sh1, int snum)
{
int len_net_name;
pstring net_name;
pstrcpy(net_name, lp_servicename(snum));
pstrcpy(remark, lp_comment(snum));
- pstring_sub(remark,"%S",lp_servicename(snum));
+ standard_sub_conn(p->conn, remark);
len_net_name = strlen(net_name);
/* work out the share type */
Fill in a share info level 2 structure.
********************************************************************/
-static void init_srv_share_info_2(SRV_SHARE_INFO_2 *sh2, int snum)
+static void init_srv_share_info_2(pipes_struct *p, SRV_SHARE_INFO_2 *sh2, int snum)
{
int len_net_name;
pstring net_name;
pstrcpy(net_name, lp_servicename(snum));
pstrcpy(remark, lp_comment(snum));
- pstring_sub(remark,"%S",lp_servicename(snum));
+ standard_sub_conn(p->conn, remark);
pstrcpy(path, "C:");
pstrcat(path, lp_pathname(snum));
Fill in a share info level 502 structure.
********************************************************************/
-static void init_srv_share_info_502(TALLOC_CTX *ctx, SRV_SHARE_INFO_502 *sh502, int snum)
+static void init_srv_share_info_502(pipes_struct *p, SRV_SHARE_INFO_502 *sh502, int snum)
{
int len_net_name;
pstring net_name;
uint32 type;
SEC_DESC *sd;
size_t sd_size;
+ TALLOC_CTX *ctx = p->mem_ctx;
+
ZERO_STRUCTP(sh502);
pstrcpy(net_name, lp_servicename(snum));
pstrcpy(remark, lp_comment(snum));
- pstring_sub(remark,"%S",lp_servicename(snum));
+ standard_sub_conn(p->conn, remark);
pstrcpy(path, "C:");
pstrcat(path, lp_pathname(snum));
Fill in a share info structure.
********************************************************************/
-static BOOL init_srv_share_info_ctr(TALLOC_CTX *ctx, SRV_SHARE_INFO_CTR *ctr,
+static BOOL init_srv_share_info_ctr(pipes_struct *p, SRV_SHARE_INFO_CTR *ctr,
uint32 info_level, uint32 *resume_hnd, uint32 *total_entries, BOOL all_shares)
{
int num_entries = 0;
int num_services = lp_numservices();
int snum;
+ TALLOC_CTX *ctx = p->mem_ctx;
DEBUG(5,("init_srv_share_info_ctr\n"));
for (snum = *resume_hnd; snum < num_services; snum++) {
if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_admin_share(snum)) ) {
- init_srv_share_info_1(&info1[i++], snum);
+ init_srv_share_info_1(p, &info1[i++], snum);
}
}
for (snum = *resume_hnd; snum < num_services; snum++) {
if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_admin_share(snum)) ) {
- init_srv_share_info_2(&info2[i++], snum);
+ init_srv_share_info_2(p, &info2[i++], snum);
}
}
for (snum = *resume_hnd; snum < num_services; snum++) {
if (lp_browseable(snum) && lp_snum_ok(snum) && (all_shares || !is_admin_share(snum)) ) {
- init_srv_share_info_502(ctx, &info502[i++], snum);
+ init_srv_share_info_502(p, &info502[i++], snum);
}
}
Inits a SRV_R_NET_SHARE_ENUM structure.
********************************************************************/
-static void init_srv_r_net_share_enum(TALLOC_CTX *ctx, SRV_R_NET_SHARE_ENUM *r_n,
+static void init_srv_r_net_share_enum(pipes_struct *p, SRV_R_NET_SHARE_ENUM *r_n,
uint32 info_level, uint32 resume_hnd, BOOL all)
{
DEBUG(5,("init_srv_r_net_share_enum: %d\n", __LINE__));
- if (init_srv_share_info_ctr(ctx, &r_n->ctr, info_level,
+ if (init_srv_share_info_ctr(p, &r_n->ctr, info_level,
&resume_hnd, &r_n->total_entries, all)) {
r_n->status = NT_STATUS_NOPROBLEMO;
} else {
Inits a SRV_R_NET_SHARE_GET_INFO structure.
********************************************************************/
-static void init_srv_r_net_share_get_info(TALLOC_CTX *ctx, SRV_R_NET_SHARE_GET_INFO *r_n,
+static void init_srv_r_net_share_get_info(pipes_struct *p, SRV_R_NET_SHARE_GET_INFO *r_n,
char *share_name, uint32 info_level)
{
uint32 status = NT_STATUS_NOPROBLEMO;
if (snum >= 0) {
switch (info_level) {
case 1:
- init_srv_share_info_1(&r_n->info.share.info1, snum);
+ init_srv_share_info_1(p, &r_n->info.share.info1, snum);
break;
case 2:
- init_srv_share_info_2(&r_n->info.share.info2, snum);
+ init_srv_share_info_2(p, &r_n->info.share.info2, snum);
break;
case 502:
- init_srv_share_info_502(ctx, &r_n->info.share.info502, snum);
+ init_srv_share_info_502(p, &r_n->info.share.info502, snum);
break;
case 1005:
init_srv_share_info_1005(&r_n->info.share.info1005, snum);
DEBUG(5,("_srv_net_share_enum: %d\n", __LINE__));
/* Create the list of shares for the response. */
- init_srv_r_net_share_enum(p->mem_ctx, r_u,
+ init_srv_r_net_share_enum(p, r_u,
q_u->ctr.info_level,
get_enum_hnd(&q_u->enum_hnd), True);
DEBUG(5,("_srv_net_share_enum: %d\n", __LINE__));
/* Create the list of shares for the response. */
- init_srv_r_net_share_enum(p->mem_ctx, r_u,
+ init_srv_r_net_share_enum(p, r_u,
q_u->ctr.info_level,
get_enum_hnd(&q_u->enum_hnd), False);
/* Create the list of shares for the response. */
unistr2_to_ascii(share_name, &q_u->uni_share_name, sizeof(share_name));
- init_srv_r_net_share_get_info(p->mem_ctx, r_u, share_name, q_u->info_level);
+ init_srv_r_net_share_get_info(p, r_u, share_name, q_u->info_level);
DEBUG(5,("_srv_net_share_get_info: %d\n", __LINE__));