summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/Makefile.in4
-rw-r--r--source3/include/proto.h34
-rw-r--r--source3/lib/util_hnd.c7
-rw-r--r--source3/rpc_server/srv_lsa_hnd.c7
-rw-r--r--source3/smbd/server.c5
5 files changed, 29 insertions, 28 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index f39bd51341..1f481f6599 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -112,7 +112,8 @@ LIB_OBJ = lib/charcnv.o lib/charset.o lib/debug.o lib/fault.o \
lib/util_str.o lib/util_unistr.o \
lib/util_file.o mem_man/mem_man.o \
lib/util_sock.o lib/unix_sec_ctxt.o \
- lib/util_array.o
+ lib/util_array.o \
+ lib/util_hnd.o
UBIQX_OBJ = ubiqx/ubi_BinTree.o ubiqx/ubi_Cache.o ubiqx/ubi_SplayTree.o \
ubiqx/ubi_dLinkList.o ubiqx/ubi_sLinkList.o
@@ -126,7 +127,6 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/namequery.o libsmb/nmblib.o \
RPC_SERVER_OBJ = \
rpc_server/srv_lsa.o \
- rpc_server/srv_lsa_hnd.o \
rpc_server/srv_netlog.o \
rpc_server/srv_pipe_hnd.o \
rpc_server/srv_reg.o \
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 2307f67cef..be4183b4fc 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -526,6 +526,23 @@ char *fgets_slash(char *s2,int maxlen,FILE *f);
BOOL file_modified(const char *filename, time_t *lastmodified);
void *open_file_if_modified(const char *filename, char *mode, time_t *lastmodified);
+/*The following definitions come from lib/util_hnd.c */
+
+BOOL init_policy_hnd(int num_pol_hnds);
+BOOL open_policy_hnd(POLICY_HND *hnd);
+int find_policy_by_hnd(POLICY_HND *hnd);
+BOOL set_policy_samr_rid(POLICY_HND *hnd, uint32 rid);
+BOOL set_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status);
+BOOL set_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
+BOOL get_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
+uint32 get_policy_samr_rid(POLICY_HND *hnd);
+BOOL set_policy_reg_name(POLICY_HND *hnd, fstring name);
+BOOL get_policy_reg_name(POLICY_HND *hnd, fstring name);
+BOOL set_policy_cli_state(POLICY_HND *hnd, struct cli_state *cli, uint16 fnum,
+ void (*free_fn)(struct cli_state *, uint16));
+BOOL get_policy_cli_state(POLICY_HND *hnd, struct cli_state **cli, uint16 *fnum);
+BOOL close_policy_hnd(POLICY_HND *hnd);
+
/*The following definitions come from lib/util_pwdb.c */
uint32 lookup_wk_group_name(const char *group_name, const char *domain,
@@ -3500,23 +3517,6 @@ uint32 lookup_name(char *name, DOM_SID *sid, uint8 *type);
BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data);
-/*The following definitions come from rpc_server/srv_lsa_hnd.c */
-
-void init_policy_hnd(int num_pol_hnds);
-BOOL open_policy_hnd(POLICY_HND *hnd);
-int find_policy_by_hnd(POLICY_HND *hnd);
-BOOL set_policy_samr_rid(POLICY_HND *hnd, uint32 rid);
-BOOL set_policy_samr_pol_status(POLICY_HND *hnd, uint32 pol_status);
-BOOL set_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
-BOOL get_policy_samr_sid(POLICY_HND *hnd, DOM_SID *sid);
-uint32 get_policy_samr_rid(POLICY_HND *hnd);
-BOOL set_policy_reg_name(POLICY_HND *hnd, fstring name);
-BOOL get_policy_reg_name(POLICY_HND *hnd, fstring name);
-BOOL set_policy_cli_state(POLICY_HND *hnd, struct cli_state *cli, uint16 fnum,
- void (*free_fn)(struct cli_state *, uint16));
-BOOL get_policy_cli_state(POLICY_HND *hnd, struct cli_state **cli, uint16 *fnum);
-BOOL close_policy_hnd(POLICY_HND *hnd);
-
/*The following definitions come from rpc_server/srv_netlog.c */
BOOL api_netlog_rpc(pipes_struct *p, prs_struct *data);
diff --git a/source3/lib/util_hnd.c b/source3/lib/util_hnd.c
index 7a14437482..36bacad59b 100644
--- a/source3/lib/util_hnd.c
+++ b/source3/lib/util_hnd.c
@@ -101,12 +101,11 @@ static void create_pol_hnd(POLICY_HND *hnd)
/****************************************************************************
initialise policy handle states...
****************************************************************************/
-void init_policy_hnd(int num_pol_hnds)
+BOOL init_policy_hnd(int num_pol_hnds)
{
bmap = bitmap_allocate(num_pol_hnds);
- if (!bmap) {
- exit_server("out of memory in init_policy_hnd\n");
- }
+
+ return bmap != NULL;
}
/****************************************************************************
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c
index 7a14437482..36bacad59b 100644
--- a/source3/rpc_server/srv_lsa_hnd.c
+++ b/source3/rpc_server/srv_lsa_hnd.c
@@ -101,12 +101,11 @@ static void create_pol_hnd(POLICY_HND *hnd)
/****************************************************************************
initialise policy handle states...
****************************************************************************/
-void init_policy_hnd(int num_pol_hnds)
+BOOL init_policy_hnd(int num_pol_hnds)
{
bmap = bitmap_allocate(num_pol_hnds);
- if (!bmap) {
- exit_server("out of memory in init_policy_hnd\n");
- }
+
+ return bmap != NULL;
}
/****************************************************************************
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index c2162a091b..a0c9ab7c56 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -476,7 +476,10 @@ static void init_structs(void)
conn_init();
file_init();
init_rpc_pipe_hnd(); /* for RPC pipes */
- init_policy_hnd(MAX_SERVER_POLICY_HANDLES); /* for policy handles */
+ if (!init_policy_hnd(MAX_SERVER_POLICY_HANDLES))
+ {
+ exit_server("could not allocate policy handles\n");
+ }
init_printer_hnd(); /* for SPOOLSS handles */
init_dptrs();
init_dfs_table();