1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00

Make "struct policy" private to srv_lsa_hnd.c

This commit is contained in:
Volker Lendecke 2009-04-18 16:10:57 +02:00
parent fa4ff87acd
commit 9b3f2e69f7
5 changed files with 31 additions and 19 deletions

View 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 {

View 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);

View File

@ -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.

View 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;
}

View 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;
}
}