static WERROR dcesrv_srvsvc_NetCharDevGetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct srvsvc_NetCharDevGetInfo *r)
{
- ZERO_STRUCT(r->out);
+ ZERO_STRUCTP(r->out.info);
switch (r->in.level) {
case 0:
static WERROR dcesrv_srvsvc_NetCharDevQGetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct srvsvc_NetCharDevQGetInfo *r)
{
- ZERO_STRUCT(r->out);
+ ZERO_STRUCTP(r->out.info);
switch (r->in.level) {
case 0:
static WERROR dcesrv_srvsvc_NetFileGetInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct srvsvc_NetFileGetInfo *r)
{
- ZERO_STRUCT(r->out);
+ ZERO_STRUCTP(r->out.info);
switch (r->in.level) {
case 2:
info[i].name = SHARE_TYPE;
info[i].type = SHARE_INFO_STRING;
- switch (r->in.info.info2->type) {
+ switch (r->in.info->info2->type) {
case 0x00:
info[i].value = talloc_strdup(info, "DISK");
break;
W_ERROR_HAVE_NO_MEMORY(info[i].value);
i++;
- if (r->in.info.info2->path && r->in.info.info2->path[0]) {
+ if (r->in.info->info2->path && r->in.info->info2->path[0]) {
info[i].name = SHARE_PATH;
info[i].type = SHARE_INFO_STRING;
/* Windows will send a path in a form of C:\example\path */
- if (r->in.info.info2->path[1] == ':') {
- info[i].value = talloc_strdup(info, &r->in.info.info2->path[2]);
+ if (r->in.info->info2->path[1] == ':') {
+ info[i].value = talloc_strdup(info, &r->in.info->info2->path[2]);
} else {
/* very strange let's try to set as is */
- info[i].value = talloc_strdup(info, r->in.info.info2->path);
+ info[i].value = talloc_strdup(info, r->in.info->info2->path);
}
W_ERROR_HAVE_NO_MEMORY(info[i].value);
all_string_sub((char *)info[i].value, "\\", "/", 0);
i++;
}
- if (r->in.info.info2->comment && r->in.info.info2->comment[0]) {
+ if (r->in.info->info2->comment && r->in.info->info2->comment[0]) {
info[i].name = SHARE_COMMENT;
info[i].type = SHARE_INFO_STRING;
- info[i].value = talloc_strdup(info, r->in.info.info2->comment);
+ info[i].value = talloc_strdup(info, r->in.info->info2->comment);
W_ERROR_HAVE_NO_MEMORY(info[i].value);
i++;
}
- if (r->in.info.info2->password && r->in.info.info2->password[0]) {
+ if (r->in.info->info2->password && r->in.info->info2->password[0]) {
info[i].name = SHARE_PASSWORD;
info[i].type = SHARE_INFO_STRING;
- info[i].value = talloc_strdup(info, r->in.info.info502->password);
+ info[i].value = talloc_strdup(info, r->in.info->info2->password);
W_ERROR_HAVE_NO_MEMORY(info[i].value);
i++;
info[i].name = SHARE_MAX_CONNECTIONS;
info[i].type = SHARE_INFO_INT;
info[i].value = talloc(info, int);
- *((int *)info[i].value) = r->in.info.info2->max_users;
+ *((int *)info[i].value) = r->in.info->info2->max_users;
i++;
/* TODO: security descriptor */
- nterr = share_create(sctx, r->in.info.info2->name, info, i);
+ nterr = share_create(sctx, r->in.info->info2->name, info, i);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
info[i].name = SHARE_TYPE;
info[i].type = SHARE_INFO_STRING;
- switch (r->in.info.info502->type) {
+ switch (r->in.info->info502->type) {
case 0x00:
info[i].value = talloc_strdup(info, "DISK");
break;
W_ERROR_HAVE_NO_MEMORY(info[i].value);
i++;
- if (r->in.info.info502->path && r->in.info.info502->path[0]) {
+ if (r->in.info->info502->path && r->in.info->info502->path[0]) {
info[i].name = SHARE_PATH;
info[i].type = SHARE_INFO_STRING;
/* Windows will send a path in a form of C:\example\path */
- if (r->in.info.info2->path[1] == ':') {
- info[i].value = talloc_strdup(info, &r->in.info.info502->path[2]);
+ if (r->in.info->info502->path[1] == ':') {
+ info[i].value = talloc_strdup(info, &r->in.info->info502->path[2]);
} else {
/* very strange let's try to set as is */
- info[i].value = talloc_strdup(info, r->in.info.info502->path);
+ info[i].value = talloc_strdup(info, r->in.info->info502->path);
}
W_ERROR_HAVE_NO_MEMORY(info[i].value);
all_string_sub((char *)info[i].value, "\\", "/", 0);
i++;
}
- if (r->in.info.info502->comment && r->in.info.info502->comment[0]) {
+ if (r->in.info->info502->comment && r->in.info->info502->comment[0]) {
info[i].name = SHARE_COMMENT;
info[i].type = SHARE_INFO_STRING;
- info[i].value = talloc_strdup(info, r->in.info.info502->comment);
+ info[i].value = talloc_strdup(info, r->in.info->info502->comment);
W_ERROR_HAVE_NO_MEMORY(info[i].value);
i++;
}
- if (r->in.info.info502->password && r->in.info.info502->password[0]) {
+ if (r->in.info->info502->password && r->in.info->info502->password[0]) {
info[i].name = SHARE_PASSWORD;
info[i].type = SHARE_INFO_STRING;
- info[i].value = talloc_strdup(info, r->in.info.info502->password);
+ info[i].value = talloc_strdup(info, r->in.info->info502->password);
W_ERROR_HAVE_NO_MEMORY(info[i].value);
i++;
info[i].name = SHARE_MAX_CONNECTIONS;
info[i].type = SHARE_INFO_INT;
info[i].value = talloc(info, int);
- *((int *)info[i].value) = r->in.info.info502->max_users;
+ *((int *)info[i].value) = r->in.info->info502->max_users;
i++;
/* TODO: security descriptor */
- nterr = share_create(sctx, r->in.info.info502->name, info, i);
+ nterr = share_create(sctx, r->in.info->info502->name, info, i);
if (!NT_STATUS_IS_OK(nterr)) {
return ntstatus_to_werror(nterr);
}
info->info502->path = dcesrv_common_get_share_path(mem_ctx, dce_ctx, scfg);
W_ERROR_HAVE_NO_MEMORY(info->info502->path);
info->info502->password = talloc_strdup(mem_ctx, share_string_option(scfg, SHARE_PASSWORD, NULL));
- info->info502->unknown = dcesrv_common_get_share_unknown(mem_ctx, dce_ctx, scfg);
- info->info502->sd = dcesrv_common_get_security_descriptor(mem_ctx, dce_ctx, scfg);
+ info->info502->sd_buf.sd = dcesrv_common_get_security_descriptor(mem_ctx, dce_ctx, scfg);
return WERR_OK;
}
struct share_context *sctx = NULL;
struct share_config *scfg = NULL;
- ZERO_STRUCT(r->out);
+ ZERO_STRUCTP(r->out.info);
/* TODO: - access check
*/
return status;
}
- r->out.info.info0 = info.info0;
+ r->out.info->info0 = info.info0;
return WERR_OK;
}
case 1:
return status;
}
- r->out.info.info1 = info.info1;
+ r->out.info->info1 = info.info1;
return WERR_OK;
}
case 2:
return status;
}
- r->out.info.info2 = info.info2;
+ r->out.info->info2 = info.info2;
return WERR_OK;
}
case 501:
return status;
}
- r->out.info.info501 = info.info501;
+ r->out.info->info501 = info.info501;
return WERR_OK;
}
case 502:
return status;
}
- r->out.info.info502 = info.info502;
+ r->out.info->info502 = info.info502;
return WERR_OK;
}
case 1005:
return status;
}
- r->out.info.info1005 = info.info1005;
+ r->out.info->info1005 = info.info1005;
return WERR_OK;
}
default:
{
status = dcesrv_srvsvc_fill_share_info(info, &count,
r->in.share_name, r->in.level,
- r->in.info.info0->name,
+ r->in.info->info0->name,
NULL,
NULL,
NULL,
{
status = dcesrv_srvsvc_fill_share_info(info, &count,
r->in.share_name, r->in.level,
- r->in.info.info1->name,
+ r->in.info->info1->name,
NULL,
- r->in.info.info1->comment,
+ r->in.info->info1->comment,
NULL,
- r->in.info.info1->type,
+ r->in.info->info1->type,
0,
0,
NULL);
{
status = dcesrv_srvsvc_fill_share_info(info, &count,
r->in.share_name, r->in.level,
- r->in.info.info2->name,
- r->in.info.info2->path,
- r->in.info.info2->comment,
- r->in.info.info2->password,
- r->in.info.info2->type,
- r->in.info.info2->max_users,
+ r->in.info->info2->name,
+ r->in.info->info2->path,
+ r->in.info->info2->comment,
+ r->in.info->info2->password,
+ r->in.info->info2->type,
+ r->in.info->info2->max_users,
0,
NULL);
if (W_ERROR_EQUAL(status, WERR_OK)) {
{
status = dcesrv_srvsvc_fill_share_info(info, &count,
r->in.share_name, r->in.level,
- r->in.info.info501->name,
+ r->in.info->info501->name,
NULL,
- r->in.info.info501->comment,
+ r->in.info->info501->comment,
NULL,
- r->in.info.info501->type,
+ r->in.info->info501->type,
0,
- r->in.info.info501->csc_policy,
+ r->in.info->info501->csc_policy,
NULL);
if (W_ERROR_EQUAL(status, WERR_OK)) {
return status;
{
status = dcesrv_srvsvc_fill_share_info(info, &count,
r->in.share_name, r->in.level,
- r->in.info.info502->name,
- r->in.info.info502->path,
- r->in.info.info502->comment,
- r->in.info.info502->password,
- r->in.info.info502->type,
- r->in.info.info502->max_users,
+ r->in.info->info502->name,
+ r->in.info->info502->path,
+ r->in.info->info502->comment,
+ r->in.info->info502->password,
+ r->in.info->info502->type,
+ r->in.info->info502->max_users,
0,
- r->in.info.info502->sd);
+ r->in.info->info502->sd_buf.sd);
if (W_ERROR_EQUAL(status, WERR_OK)) {
return status;
}
r->in.share_name, r->in.level,
NULL,
NULL,
- r->in.info.info1004->comment,
+ r->in.info->info1004->comment,
NULL,
0,
0,
const char **names;
int count, i;
- ZERO_STRUCT(r->out);
+ *r->out.type = 0;
/* TODO: - access check
*/
if (strcmp("", r->in.device_name) == 0) {
- r->out.type = STYPE_IPC;
+ *r->out.type = STYPE_IPC;
return WERR_OK;
}
if (!type) continue;
if (strcmp(type, "DISK") == 0) {
- r->out.type = STYPE_DISKTREE;
+ *r->out.type = STYPE_DISKTREE;
return WERR_OK;
}
if (strcmp(type, "IPC") == 0) {
- r->out.type = STYPE_IPC;
+ *r->out.type = STYPE_IPC;
return WERR_OK;
}
if (strcmp(type, "PRINTER") == 0) {
- r->out.type = STYPE_PRINTQ;
+ *r->out.type = STYPE_PRINTQ;
return WERR_OK;
}
}
{
struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx;
- ZERO_STRUCT(r->out);
+ ZERO_STRUCTP(r->out.info);
switch (r->in.level) {
case 100:
info100->server_name = dcesrv_common_get_server_name(mem_ctx, dce_ctx, r->in.server_unc);
W_ERROR_HAVE_NO_MEMORY(info100->server_name);
- r->out.info.info100 = info100;
+ r->out.info->info100 = info100;
return WERR_OK;
}
case 101:
info101->comment = talloc_strdup(mem_ctx, lp_serverstring(dce_ctx->lp_ctx));
W_ERROR_HAVE_NO_MEMORY(info101->comment);
- r->out.info.info101 = info101;
+ r->out.info->info101 = info101;
return WERR_OK;
}
case 102:
info102->userpath = dcesrv_common_get_userpath(mem_ctx, dce_ctx);
W_ERROR_HAVE_NO_MEMORY(info102->userpath);
- r->out.info.info102 = info102;
+ r->out.info->info102 = info102;
return WERR_OK;
}
default:
static WERROR dcesrv_srvsvc_NetTransportEnum(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct srvsvc_NetTransportEnum *r)
{
- r->out.level = r->in.level;
- r->out.totalentries = 0;
- r->out.resume_handle = NULL;
+ r->out.transports->level = r->in.transports->level;
+ *r->out.totalentries = 0;
+ if (r->out.resume_handle) {
+ *r->out.resume_handle = 0;
+ }
- switch (r->in.level) {
+ switch (r->in.transports->level) {
case 0:
{
- r->out.transports.ctr0 = talloc(mem_ctx, struct srvsvc_NetTransportCtr0);
- W_ERROR_HAVE_NO_MEMORY(r->out.transports.ctr0);
+ r->out.transports->ctr.ctr0 = talloc(mem_ctx, struct srvsvc_NetTransportCtr0);
+ W_ERROR_HAVE_NO_MEMORY(r->out.transports->ctr.ctr0);
- r->out.transports.ctr0->count = 0;
- r->out.transports.ctr0->array = NULL;
+ r->out.transports->ctr.ctr0->count = 0;
+ r->out.transports->ctr.ctr0->array = NULL;
return WERR_NOT_SUPPORTED;
}
case 1:
{
- r->out.transports.ctr1 = talloc(mem_ctx, struct srvsvc_NetTransportCtr1);
- W_ERROR_HAVE_NO_MEMORY(r->out.transports.ctr1);
+ r->out.transports->ctr.ctr1 = talloc(mem_ctx, struct srvsvc_NetTransportCtr1);
+ W_ERROR_HAVE_NO_MEMORY(r->out.transports->ctr.ctr1);
- r->out.transports.ctr1->count = 0;
- r->out.transports.ctr1->array = NULL;
+ r->out.transports->ctr.ctr1->count = 0;
+ r->out.transports->ctr.ctr1->array = NULL;
return WERR_NOT_SUPPORTED;
}
case 2:
{
- r->out.transports.ctr2 = talloc(mem_ctx, struct srvsvc_NetTransportCtr2);
- W_ERROR_HAVE_NO_MEMORY(r->out.transports.ctr2);
+ r->out.transports->ctr.ctr2 = talloc(mem_ctx, struct srvsvc_NetTransportCtr2);
+ W_ERROR_HAVE_NO_MEMORY(r->out.transports->ctr.ctr2);
- r->out.transports.ctr2->count = 0;
- r->out.transports.ctr2->array = NULL;
+ r->out.transports->ctr.ctr2->count = 0;
+ r->out.transports->ctr.ctr2->array = NULL;
return WERR_NOT_SUPPORTED;
}
case 3:
{
- r->out.transports.ctr3 = talloc(mem_ctx, struct srvsvc_NetTransportCtr3);
- W_ERROR_HAVE_NO_MEMORY(r->out.transports.ctr3);
+ r->out.transports->ctr.ctr3 = talloc(mem_ctx, struct srvsvc_NetTransportCtr3);
+ W_ERROR_HAVE_NO_MEMORY(r->out.transports->ctr.ctr3);
- r->out.transports.ctr3->count = 0;
- r->out.transports.ctr3->array = NULL;
+ r->out.transports->ctr.ctr3->count = 0;
+ r->out.transports->ctr.ctr3->array = NULL;
return WERR_NOT_SUPPORTED;
}
struct timeval tval;
time_t t;
struct tm tm;
+ struct srvsvc_NetRemoteTODInfo *info;
- r->out.info = talloc(mem_ctx, struct srvsvc_NetRemoteTODInfo);
- W_ERROR_HAVE_NO_MEMORY(r->out.info);
+ info = talloc(mem_ctx, struct srvsvc_NetRemoteTODInfo);
+ W_ERROR_HAVE_NO_MEMORY(info);
GetTimeOfDay(&tval);
t = tval.tv_sec;
gmtime_r(&t, &tm);
- r->out.info->elapsed = t;
+ info->elapsed = t;
/* TODO: fake the uptime: just return the milliseconds till 0:00:00 today */
- r->out.info->msecs = (tm.tm_hour*60*60*1000)
- + (tm.tm_min*60*1000)
- + (tm.tm_sec*1000)
- + (tval.tv_usec/1000);
- r->out.info->hours = tm.tm_hour;
- r->out.info->mins = tm.tm_min;
- r->out.info->secs = tm.tm_sec;
- r->out.info->hunds = tval.tv_usec/10000;
- r->out.info->timezone = get_time_zone(t)/60;
- r->out.info->tinterval = 310; /* just return the same as windows */
- r->out.info->day = tm.tm_mday;
- r->out.info->month = tm.tm_mon + 1;
- r->out.info->year = tm.tm_year + 1900;
- r->out.info->weekday = tm.tm_wday;
+ info->msecs = (tm.tm_hour*60*60*1000)
+ + (tm.tm_min*60*1000)
+ + (tm.tm_sec*1000)
+ + (tval.tv_usec/1000);
+ info->hours = tm.tm_hour;
+ info->mins = tm.tm_min;
+ info->secs = tm.tm_sec;
+ info->hunds = tval.tv_usec/10000;
+ info->timezone = get_time_zone(t)/60;
+ info->tinterval = 310; /* just return the same as windows */
+ info->day = tm.tm_mday;
+ info->month = tm.tm_mon + 1;
+ info->year = tm.tm_year + 1900;
+ info->weekday = tm.tm_wday;
+
+ *r->out.info = info;
return WERR_OK;
}
sd_buf->sd = io->query_secdesc.out.sd;
- r->out.sd_buf = sd_buf;
+ *r->out.sd_buf = sd_buf;
return WERR_OK;
}
io->set_secdesc.level = RAW_FILEINFO_SEC_DESC;
io->set_secdesc.in.file.path = r->in.file;
io->set_secdesc.in.secinfo_flags = r->in.securityinformation;
- io->set_secdesc.in.sd = r->in.sd_buf.sd;
+ io->set_secdesc.in.sd = r->in.sd_buf->sd;
nt_status = ntvfs_setpathinfo(ntvfs_req, io);
if (!NT_STATUS_IS_OK(nt_status)) return ntstatus_to_werror(nt_status);