From 8fe7d2974ca1c5e73177560a5138f73ae42bb66a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 19 Dec 2004 03:31:57 +0000 Subject: r4274: make the prototype RAP netshareenum call return something a bit more sensible. (This used to be commit b2e29756c2084f11d841d027e7d32952daae18d0) --- source4/ntvfs/ipc/rap_server.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/source4/ntvfs/ipc/rap_server.c b/source4/ntvfs/ipc/rap_server.c index 70b65442ff..0e6c18ca3b 100644 --- a/source4/ntvfs/ipc/rap_server.c +++ b/source4/ntvfs/ipc/rap_server.c @@ -28,20 +28,21 @@ NTSTATUS rap_netshareenum(struct smbsrv_request *req, struct rap_NetShareEnum *r) { + int i; r->out.status = 0; - r->out.available = 2; + r->out.available = dcesrv_common_get_count_of_shares(req, NULL); r->out.info = talloc_array_p(req, - union rap_shareenum_info, 2); + union rap_shareenum_info, r->out.available); - strncpy(r->out.info[0].info1.name, "C$", sizeof(r->out.info[0].info1.name)); - r->out.info[0].info1.pad = 0; - r->out.info[0].info1.type = 0; - r->out.info[0].info1.comment = talloc_strdup(req, "Bla"); - - strncpy(r->out.info[1].info1.name, "IPC$", sizeof(r->out.info[0].info1.name)); - r->out.info[1].info1.pad = 0; - r->out.info[1].info1.type = 1; - r->out.info[1].info1.comment = talloc_strdup(req, "Blub"); + for (i=0;iout.available;i++) { + strncpy(r->out.info[i].info1.name, + dcesrv_common_get_share_name(req, NULL, 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(req, NULL, i); + r->out.info[i].info1.comment = talloc_strdup(req, + dcesrv_common_get_share_comment(req, NULL, i)); + } return NT_STATUS_OK; } -- cgit