diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-12-31 07:42:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:07:50 -0500 |
commit | 85b492bb5b90edd636611eb884c7bcfa9c45bd64 (patch) | |
tree | 52c9f866632c97f3ab3d8c4882582da2e71d81c7 /source4/rpc_server/common/share_info.c | |
parent | f53293ffbfe37fd8a3bb1a7ec509b356ef2259c7 (diff) | |
download | samba-85b492bb5b90edd636611eb884c7bcfa9c45bd64.tar.gz samba-85b492bb5b90edd636611eb884c7bcfa9c45bd64.tar.bz2 samba-85b492bb5b90edd636611eb884c7bcfa9c45bd64.zip |
r4440: - add a start of srvsvc_NetShareCheck() server code
- filterout hidden shares in NetShareEnum()
- get max_connections right
metze
(This used to be commit c685823c5d75f22177549566866301523a64a1dd)
Diffstat (limited to 'source4/rpc_server/common/share_info.c')
-rw-r--r-- | source4/rpc_server/common/share_info.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/source4/rpc_server/common/share_info.c b/source4/rpc_server/common/share_info.c index 824ad5758f..6440c70676 100644 --- a/source4/rpc_server/common/share_info.c +++ b/source4/rpc_server/common/share_info.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "librpc/gen_ndr/ndr_srvsvc.h" /* Here are common server info functions used by some dcerpc server interfaces @@ -52,7 +53,7 @@ uint32_t dcesrv_common_get_share_permissions(TALLOC_CTX *mem_ctx, struct dcesrv_ /* This hardcoded value should go into a ldb database! */ uint32_t dcesrv_common_get_share_max_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum) { - return 10; + return lp_max_connections(snum); } /* This hardcoded value should go into a ldb database! */ @@ -72,18 +73,33 @@ uint32_t dcesrv_common_get_share_type(TALLOC_CTX *mem_ctx, struct dcesrv_context * ADMIN$, IPC$, C$, D$, E$ ... are type |= 0x80000000 * this ones are hidden in NetShareEnum, but shown in NetShareEnumAll */ - if (strcasecmp(lp_servicename(snum), "IPC$") == 0) { - return 3; + uint32_t share_type = 0; + + if (!lp_browseable(snum)) { + share_type |= STYPE_HIDDEN; + } + + if (strcasecmp(lp_fstype(snum), "IPC") == 0) { + share_type |= STYPE_IPC; + return share_type; } + if (lp_print_ok(snum)) { - return 1; + share_type |= STYPE_PRINTQ; + return share_type; } - return 0; + + share_type |= STYPE_DISKTREE; + + return share_type; } /* This hardcoded value should go into a ldb database! */ const char *dcesrv_common_get_share_path(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum) { + if (strcasecmp(lp_fstype(snum), "IPC") == 0) { + return talloc_strdup(mem_ctx, ""); + } return talloc_strdup(mem_ctx, "C:\\"); } |