2 Unix SMB/CIFS implementation.
4 common share info functions
6 Copyright (C) Stefan (metze) Metzmacher 2004
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 Here are common server info functions used by some dcerpc server interfaces
29 /* This hardcoded value should go into a ldb database! */
30 uint32_t dcesrv_common_get_count_of_shares(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
32 /* what's about int -> uint32_t overflow */
33 return lp_numservices();
36 const char *dcesrv_common_get_share_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
38 return lp_servicename(snum);
41 const char *dcesrv_common_get_share_comment(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
43 return lp_comment(snum);
46 /* This hardcoded value should go into a ldb database! */
47 uint32_t dcesrv_common_get_share_permissions(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
52 /* This hardcoded value should go into a ldb database! */
53 uint32_t dcesrv_common_get_share_max_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
58 /* This hardcoded value should go into a ldb database! */
59 uint32_t dcesrv_common_get_share_current_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
64 /* This hardcoded value should go into a ldb database! */
65 uint32_t dcesrv_common_get_share_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
67 /* for disk share 0x00000000
68 * for print share 0x00000001
69 * for IPC$ share 0x00000003
71 * administrative shares:
72 * ADMIN$, IPC$, C$, D$, E$ ... are type |= 0x80000000
73 * this ones are hidden in NetShareEnum, but shown in NetShareEnumAll
75 if (strcasecmp(lp_servicename(snum), "IPC$") == 0) {
78 if (lp_print_ok(snum)) {
84 /* This hardcoded value should go into a ldb database! */
85 const char *dcesrv_common_get_share_path(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
90 /* This hardcoded value should go into a ldb database! */
91 const char *dcesrv_common_get_share_password(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
96 /* This hardcoded value should go into a ldb database! */
97 uint32_t dcesrv_common_get_share_csc_policy(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
102 /* This hardcoded value should go into a ldb database! */
103 uint32_t dcesrv_common_get_share_unknown(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
108 /* This hardcoded value should go into a ldb database! */
109 struct security_descriptor *dcesrv_common_get_security_descriptor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)