From e9ea36e4d2270bd7d32da12ef6d6e2299641582d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 5 Sep 1998 05:07:05 +0000 Subject: tridge the destroyer returns! prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static? (This used to be commit 2204475c87f3024ea8fd1fbd7385b2def617a46f) --- source3/rpc_parse/parse_lsa.c | 113 +++--------------------------------------- 1 file changed, 6 insertions(+), 107 deletions(-) (limited to 'source3/rpc_parse/parse_lsa.c') diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index 638222590d..0818057d48 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -26,6 +26,7 @@ extern int DEBUGLEVEL; +static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth); /******************************************************************* creates a LSA_TRANS_NAME structure. @@ -43,7 +44,7 @@ void make_lsa_trans_name(LSA_TRANS_NAME *trn, uint32 sid_name_use, char *name, u /******************************************************************* reads or writes a LSA_TRANS_NAME structure. ********************************************************************/ -void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth) +static void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int depth) { if (trn == NULL) return; @@ -63,7 +64,7 @@ void lsa_io_trans_name(char *desc, LSA_TRANS_NAME *trn, prs_struct *ps, int dept /******************************************************************* reads or writes a DOM_R_REF structure. ********************************************************************/ -void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth) +static void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth) { int i; @@ -99,27 +100,11 @@ void lsa_io_dom_r_ref(char *desc, DOM_R_REF *r_r, prs_struct *ps, int depth) } } -/******************************************************************* -makes an LSA_OBJ_ATTR structure. -********************************************************************/ -void make_lsa_obj_attr(LSA_OBJ_ATTR *attr, uint32 attributes, uint32 sec_qos) -{ - if (attr == NULL) return; - - DEBUG(5,("make_lsa_obj_attr\n")); - - attr->len = 0x18; /* length of object attribute block, in bytes */ - attr->ptr_root_dir = 0; - attr->ptr_obj_name = 0; - attr->attributes = attributes; - attr->ptr_sec_desc = 0; - attr->sec_qos = sec_qos; -} /******************************************************************* reads or writes an LSA_OBJ_ATTR structure. ********************************************************************/ -void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth) +static void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth) { int start; @@ -148,24 +133,6 @@ void lsa_io_obj_attr(char *desc, LSA_OBJ_ATTR *attr, prs_struct *ps, int depth) attr->len, ps->offset - start)); } } -/******************************************************************* -makes an LSA_Q_OPEN_POL structure. -********************************************************************/ -void make_q_open_pol(LSA_Q_OPEN_POL *r_q, char *server_name, - uint32 attributes, uint32 sec_qos, - uint32 desired_access) -{ - if (r_q == NULL) return; - - DEBUG(5,("make_open_pol\n")); - - r_q->ptr = 1; /* undocumented pointer */ - - make_unistr2 (&(r_q->uni_server_name), server_name, strlen(server_name)); - make_lsa_obj_attr(&(r_q->attr ), attributes, sec_qos); - - r_q->des_access = desired_access; -} /******************************************************************* reads or writes an LSA_Q_OPEN_POL structure. @@ -201,20 +168,6 @@ void lsa_io_r_open_pol(char *desc, LSA_R_OPEN_POL *r_p, prs_struct *ps, int dep prs_uint32("status", ps, depth, &(r_p->status)); } -/******************************************************************* -makes an LSA_Q_QUERY_INFO structure. -********************************************************************/ -void make_q_query(LSA_Q_QUERY_INFO *q_q, POLICY_HND *hnd, uint16 info_class) -{ - if (q_q == NULL || hnd == NULL) return; - - DEBUG(5,("make_q_query\n")); - - memcpy(&(q_q->pol), hnd, sizeof(q_q->pol)); - - q_q->info_class = info_class; -} - /******************************************************************* reads or writes an LSA_Q_QUERY_INFO structure. ********************************************************************/ @@ -306,60 +259,6 @@ void lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM *r_e, prs_struct prs_uint32("status", ps, depth, &(r_e->status)); } -/******************************************************************* -makes an LSA_Q_CLOSE structure. -********************************************************************/ -void make_lsa_q_close(LSA_Q_CLOSE *q_c, POLICY_HND *hnd) -{ - if (q_c == NULL || hnd == NULL) return; - - DEBUG(5,("make_lsa_q_close\n")); - - memcpy(&(q_c->pol), hnd, sizeof(q_c->pol)); -} - - -/******************************************************************* -reads or writes an LSA_Q_CLOSE structure. -********************************************************************/ -void lsa_io_q_close(char *desc, LSA_Q_CLOSE *q_c, prs_struct *ps, int depth) -{ - if (q_c == NULL) return; - - prs_debug(ps, depth, desc, "lsa_io_q_close"); - depth++; - - smb_io_pol_hnd("", &(q_c->pol), ps, depth); -} - -/******************************************************************* -makes an LSA_R_CLOSE structure. -********************************************************************/ -void make_lsa_r_close(LSA_R_CLOSE *q_r, POLICY_HND *hnd) -{ - if (q_r == NULL || hnd == NULL) return; - - DEBUG(5,("make_lsa_r_close\n")); - - memcpy(&(q_r->pol), hnd, sizeof(q_r->pol)); -} - - -/******************************************************************* -reads or writes an LSA_R_CLOSE structure. -********************************************************************/ -void lsa_io_r_close(char *desc, LSA_R_CLOSE *r_c, prs_struct *ps, int depth) -{ - if (r_c == NULL) return; - - prs_debug(ps, depth, desc, "lsa_io_r_close"); - depth++; - - smb_io_pol_hnd("", &(r_c->pol), ps, depth); - - prs_uint32("status", ps, depth, &(r_c->status)); -} - /******************************************************************* reads or writes an LSA_Q_QUERY_INFO structure. ********************************************************************/ @@ -402,7 +301,7 @@ void lsa_io_r_query(char *desc, LSA_R_QUERY_INFO *r_q, prs_struct *ps, int dept /******************************************************************* reads or writes a LSA_SID_ENUM structure. ********************************************************************/ -void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth) +static void lsa_io_sid_enum(char *desc, LSA_SID_ENUM *sen, prs_struct *ps, int depth) { int i; @@ -459,7 +358,7 @@ void lsa_io_q_lookup_sids(char *desc, LSA_Q_LOOKUP_SIDS *q_s, prs_struct *ps, in /******************************************************************* reads or writes a structure. ********************************************************************/ -void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth) +static void lsa_io_trans_names(char *desc, LSA_TRANS_NAME_ENUM *trn, prs_struct *ps, int depth) { int i; int i2; -- cgit