mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
s4: rename RAP share_enum_info to share_info.
Guenther
This commit is contained in:
parent
1055b3c229
commit
1ede2a0577
@ -278,20 +278,20 @@
|
||||
#define RAP_WDASDSetInfo2 318
|
||||
#define MAX_API 318
|
||||
|
||||
struct rap_shareenum_info_0 {
|
||||
char name[13];
|
||||
struct rap_share_info_0 {
|
||||
char share_name[13];
|
||||
};
|
||||
|
||||
struct rap_shareenum_info_1 {
|
||||
char name[13];
|
||||
char pad;
|
||||
uint16_t type;
|
||||
struct rap_share_info_1 {
|
||||
char share_name[13];
|
||||
char reserved1;
|
||||
uint16_t share_type;
|
||||
char *comment;
|
||||
};
|
||||
|
||||
union rap_shareenum_info {
|
||||
struct rap_shareenum_info_0 info0;
|
||||
struct rap_shareenum_info_1 info1;
|
||||
union rap_share_info {
|
||||
struct rap_share_info_0 info0;
|
||||
struct rap_share_info_1 info1;
|
||||
};
|
||||
|
||||
struct rap_NetShareEnum {
|
||||
@ -305,7 +305,7 @@ struct rap_NetShareEnum {
|
||||
uint16_t convert;
|
||||
uint16_t count;
|
||||
uint16_t available;
|
||||
union rap_shareenum_info *info;
|
||||
union rap_share_info *info;
|
||||
} out;
|
||||
};
|
||||
|
||||
|
@ -291,17 +291,17 @@ static NTSTATUS _rap_netshareenum(struct rap_call *call)
|
||||
switch(r.in.level) {
|
||||
case 0:
|
||||
NDR_GOTO(ndr_push_bytes(call->ndr_push_data,
|
||||
(const uint8_t *)r.out.info[i].info0.name,
|
||||
sizeof(r.out.info[i].info0.name)));
|
||||
(const uint8_t *)r.out.info[i].info0.share_name,
|
||||
sizeof(r.out.info[i].info0.share_name)));
|
||||
break;
|
||||
case 1:
|
||||
NDR_GOTO(ndr_push_bytes(call->ndr_push_data,
|
||||
(const uint8_t *)r.out.info[i].info1.name,
|
||||
sizeof(r.out.info[i].info1.name)));
|
||||
(const uint8_t *)r.out.info[i].info1.share_name,
|
||||
sizeof(r.out.info[i].info1.share_name)));
|
||||
NDR_GOTO(ndr_push_uint8(call->ndr_push_data,
|
||||
NDR_SCALARS, r.out.info[i].info1.pad));
|
||||
NDR_SCALARS, r.out.info[i].info1.reserved1));
|
||||
NDR_GOTO(ndr_push_uint16(call->ndr_push_data,
|
||||
NDR_SCALARS, r.out.info[i].info1.type));
|
||||
NDR_SCALARS, r.out.info[i].info1.share_type));
|
||||
|
||||
RAP_GOTO(rap_push_string(call->ndr_push_data,
|
||||
call->heap,
|
||||
|
@ -58,18 +58,18 @@ NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx,
|
||||
|
||||
r->out.available = count;
|
||||
r->out.info = talloc_array(mem_ctx,
|
||||
union rap_shareenum_info, r->out.available);
|
||||
union rap_share_info, r->out.available);
|
||||
|
||||
for (i = 0, j = 0; i < r->out.available; i++) {
|
||||
if (!NT_STATUS_IS_OK(share_get_config(mem_ctx, sctx, snames[i], &scfg))) {
|
||||
DEBUG(3, ("WARNING: Service [%s] disappeared after enumeration!\n", snames[i]));
|
||||
continue;
|
||||
}
|
||||
strncpy(r->out.info[j].info1.name,
|
||||
strncpy(r->out.info[j].info1.share_name,
|
||||
snames[i],
|
||||
sizeof(r->out.info[0].info1.name));
|
||||
r->out.info[i].info1.pad = 0;
|
||||
r->out.info[i].info1.type = dcesrv_common_get_share_type(mem_ctx, NULL, scfg);
|
||||
sizeof(r->out.info[0].info1.share_name));
|
||||
r->out.info[i].info1.reserved1 = 0;
|
||||
r->out.info[i].info1.share_type = dcesrv_common_get_share_type(mem_ctx, NULL, scfg);
|
||||
r->out.info[i].info1.comment = talloc_strdup(mem_ctx, share_string_option(scfg, SHARE_COMMENT, ""));
|
||||
talloc_free(scfg);
|
||||
j++;
|
||||
|
@ -280,7 +280,7 @@ static NTSTATUS smbcli_rap_netshareenum(struct smbcli_tree *tree,
|
||||
NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.count));
|
||||
NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.available));
|
||||
|
||||
r->out.info = talloc_array(mem_ctx, union rap_shareenum_info, r->out.count);
|
||||
r->out.info = talloc_array(mem_ctx, union rap_share_info, r->out.count);
|
||||
|
||||
if (r->out.info == NULL) {
|
||||
result = NT_STATUS_NO_MEMORY;
|
||||
@ -291,15 +291,15 @@ static NTSTATUS smbcli_rap_netshareenum(struct smbcli_tree *tree,
|
||||
switch(r->in.level) {
|
||||
case 0:
|
||||
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
|
||||
(uint8_t *)r->out.info[i].info0.name, 13));
|
||||
(uint8_t *)r->out.info[i].info0.share_name, 13));
|
||||
break;
|
||||
case 1:
|
||||
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
|
||||
(uint8_t *)r->out.info[i].info1.name, 13));
|
||||
(uint8_t *)r->out.info[i].info1.share_name, 13));
|
||||
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
|
||||
(uint8_t *)&r->out.info[i].info1.pad, 1));
|
||||
(uint8_t *)&r->out.info[i].info1.reserved1, 1));
|
||||
NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data,
|
||||
NDR_SCALARS, &r->out.info[i].info1.type));
|
||||
NDR_SCALARS, &r->out.info[i].info1.share_type));
|
||||
RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data,
|
||||
r->out.convert,
|
||||
&r->out.info[i].info1.comment));
|
||||
@ -327,8 +327,8 @@ static bool test_netshareenum(struct torture_context *tctx,
|
||||
smbcli_rap_netshareenum(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r), "");
|
||||
|
||||
for (i=0; i<r.out.count; i++) {
|
||||
printf("%s %d %s\n", r.out.info[i].info1.name,
|
||||
r.out.info[i].info1.type,
|
||||
printf("%s %d %s\n", r.out.info[i].info1.share_name,
|
||||
r.out.info[i].info1.share_type,
|
||||
r.out.info[i].info1.comment);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user