r884: convert samba4 to use [u]int32_t instead of [u]int32
[tprouty/samba.git] / source4 / rpc_server / common / share_info.c
1 /* 
2    Unix SMB/CIFS implementation.
3
4    common share info functions
5
6    Copyright (C) Stefan (metze) Metzmacher 2004
7    
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.
12    
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.
17    
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.
21 */
22
23 #include "includes.h"
24
25 /* 
26     Here are common server info functions used by some dcerpc server interfaces
27 */
28
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)
31 {
32         /* what's about int -> uint32_t overflow */
33         return lp_numservices();
34 }
35
36 const char *dcesrv_common_get_share_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
37 {
38         return lp_servicename(snum);
39 }
40
41 const char *dcesrv_common_get_share_comment(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
42 {
43         return lp_comment(snum);
44 }
45
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)
48 {
49         return 0;
50 }
51
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)
54 {
55         return 10;
56 }
57
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)
60 {
61         return 1;
62 }
63
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)
66 {
67         /* for disk share       0x00000000
68          * for print share      0x00000001
69          * for IPC$ share       0x00000003 
70          *
71          * administrative shares:
72          * ADMIN$, IPC$, C$, D$, E$ ...  are type |= 0x80000000
73          * this ones are hidden in NetShareEnum, but shown in NetShareEnumAll
74          */
75         return 0;
76 }
77
78 /* This hardcoded value should go into a ldb database! */
79 const char *dcesrv_common_get_share_path(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
80 {
81         return "C:\\";
82 }
83
84 /* This hardcoded value should go into a ldb database! */
85 const char *dcesrv_common_get_share_password(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
86 {
87         return NULL;
88 }
89
90 /* This hardcoded value should go into a ldb database! */
91 uint32_t dcesrv_common_get_share_csc_policy(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
92 {
93         return 0;
94 }
95
96 /* This hardcoded value should go into a ldb database! */
97 uint32_t dcesrv_common_get_share_unknown(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
98 {
99         return 0;
100 }
101
102 /* This hardcoded value should go into a ldb database! */
103 struct security_descriptor *dcesrv_common_get_security_descriptor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, int snum)
104 {
105         return NULL;
106 }