summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/ntdomain.h18
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/rpc_server/srv_lsa_hnd.c26
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c3
-rw-r--r--source3/smbd/conn.c2
5 files changed, 31 insertions, 19 deletions
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index c95931b5d0..de53aebb91 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -110,23 +110,7 @@ typedef struct _input_data {
prs_struct data;
} input_data;
-/*
- * Handle database - stored per pipe.
- */
-
-struct policy {
- struct policy *next, *prev;
-
- struct policy_handle pol_hnd;
-
- void *data_ptr;
-};
-
-struct handle_list {
- struct policy *Policy; /* List of policies. */
- size_t count; /* Current number of handles. */
- size_t pipe_ref_count; /* Number of pipe handles referring to this list. */
-};
+struct handle_list;
/* Domain controller authentication protocol info */
struct dcinfo {
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8eb5c46fbd..b99588f717 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5875,6 +5875,7 @@ NTSTATUS evlog_convert_tdb_to_evt(TALLOC_CTX *mem_ctx,
/* The following definitions come from rpc_server/srv_lsa_hnd.c */
+size_t num_pipe_handles(struct handle_list *list);
bool init_pipe_handle_list(pipes_struct *p,
const struct ndr_syntax_id *syntax);
bool create_policy_hnd(pipes_struct *p, struct policy_handle *hnd, void *data_ptr);
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c
index e1582840c3..9891ff3964 100644
--- a/source3/rpc_server/srv_lsa_hnd.c
+++ b/source3/rpc_server/srv_lsa_hnd.c
@@ -24,6 +24,24 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
+/*
+ * Handle database - stored per pipe.
+ */
+
+struct policy {
+ struct policy *next, *prev;
+
+ struct policy_handle pol_hnd;
+
+ void *data_ptr;
+};
+
+struct handle_list {
+ struct policy *Policy; /* List of policies. */
+ size_t count; /* Current number of handles. */
+ size_t pipe_ref_count; /* Number of pipe handles referring to this list. */
+};
+
/* This is the max handles across all instances of a pipe name. */
#ifndef MAX_OPEN_POLS
#define MAX_OPEN_POLS 1024
@@ -40,6 +58,14 @@ static bool is_samr_lsa_pipe(const struct ndr_syntax_id *syntax)
|| ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id));
}
+size_t num_pipe_handles(struct handle_list *list)
+{
+ if (list == NULL) {
+ return 0;
+ }
+ return list->count;
+}
+
/****************************************************************************
Initialise a policy handle list on a pipe. Handle list is shared between all
pipes of the same name.
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 155d651f3e..629e41c003 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -591,7 +591,8 @@ static bool open_printer_hnd(pipes_struct *p, struct policy_handle *hnd,
new_printer->access_granted = access_granted;
- DEBUG(5, ("%d printer handles active\n", (int)p->pipe_handles->count ));
+ DEBUG(5, ("%d printer handles active\n",
+ (int)num_pipe_handles(p->pipe_handles)));
return true;
}
diff --git a/source3/smbd/conn.c b/source3/smbd/conn.c
index a52f2d2e96..3800643769 100644
--- a/source3/smbd/conn.c
+++ b/source3/smbd/conn.c
@@ -212,7 +212,7 @@ bool conn_idle_all(time_t t)
for (plist = get_first_internal_pipe(); plist;
plist = get_next_internal_pipe(plist)) {
- if (plist->pipe_handles && plist->pipe_handles->count) {
+ if (num_pipe_handles(plist->pipe_handles) != 0) {
return False;
}
}