Make "struct policy" private to srv_lsa_hnd.c
authorVolker Lendecke <vl@samba.org>
Sat, 18 Apr 2009 14:10:57 +0000 (16:10 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 19 Apr 2009 07:27:14 +0000 (09:27 +0200)
source3/include/ntdomain.h
source3/include/proto.h
source3/rpc_server/srv_lsa_hnd.c
source3/rpc_server/srv_spoolss_nt.c
source3/smbd/conn.c

index c95931b5d03dc36a3be7dc48298dbd7fedb9677b..de53aebb91a21c4b0e06b41862202f1d72bb9d86 100644 (file)
@@ -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 {
index 8eb5c46fbd71d70a5d57732c5dbb03fe7aa5eff6..b99588f71706bcd9f6c4d1e26532c91d5db46d12 100644 (file)
@@ -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);
index e1582840c38e4379f12f796ad806d600f35011ba..9891ff39648e8f41962ba6a7c61e2e8fa182cc3c 100644 (file)
 #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.
index 155d651f3e2a75f1f95bc2ed55464403cbcfc879..629e41c0033444c1b3da3df170fd8a415b67e9aa 100644 (file)
@@ -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;
 }
index a52f2d2e96915de7aaf12814f6c307b1bf12ec63..38006437692a8b81a80153ac0eb8a198374dcf38 100644 (file)
@@ -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;
                }
        }