s3:rpc make num_pipe_handles get an actual pipe as argument
authorSimo Sorce <ssorce@redhat.com>
Mon, 7 Jun 2010 20:02:14 +0000 (16:02 -0400)
committerSimo Sorce <ssorce@redhat.com>
Mon, 7 Jun 2010 21:25:48 +0000 (17:25 -0400)
Let the function abstract out how handles are counted

source3/include/proto.h
source3/rpc_server/rpc_handles.c
source3/rpc_server/srv_spoolss_nt.c

index 9582884c2fe465c7351d764fbd28389e377b5d1b..3d25688cf31cea9a642c8a2ad926512811dbc8df 100644 (file)
@@ -5152,9 +5152,9 @@ bool smb_io_rpc_hdr_auth(const char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, in
 
 /* The following definitions come from rpc_server/srv_eventlog_nt.c  */
 
-/* The following definitions come from rpc_server/srv_lsa_hnd.c  */
+/* The following definitions come from rpc_server/rpc_handles.c  */
 
-size_t num_pipe_handles(struct handle_list *list);
+size_t num_pipe_handles(pipes_struct *p);
 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 7cc1b4361190c8ceae36bde0e3f8a1e433cb5ad5..fa4100fb97c53f9f404e5522afd730d759248ec1 100644 (file)
@@ -62,12 +62,12 @@ 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)
+size_t num_pipe_handles(pipes_struct *p)
 {
-       if (list == NULL) {
+       if (p->pipe_handles == NULL) {
                return 0;
        }
-       return list->count;
+       return p->pipe_handles->count;
 }
 
 /****************************************************************************
index 104efdc274582f8be5c8b3d16bad498496e8b96d..8ebc7fa64f4bde18e216ee03ead6151760c9bdd1 100644 (file)
@@ -593,7 +593,7 @@ 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)num_pipe_handles(p->pipe_handles)));
+                 (int)num_pipe_handles(p)));
 
        return true;
 }