diff options
author | Elrond <elrond@samba.org> | 2000-04-20 19:35:03 +0000 |
---|---|---|
committer | Elrond <elrond@samba.org> | 2000-04-20 19:35:03 +0000 |
commit | 0df2063902660b059590eeb27d2f994e4d16af44 (patch) | |
tree | d8e5dbb27240bf0f29511e070bafd68a18722b1c | |
parent | a0909d7e1f00705921cb16d44caf69858e2fd339 (diff) | |
download | samba-0df2063902660b059590eeb27d2f994e4d16af44.tar.gz samba-0df2063902660b059590eeb27d2f994e4d16af44.tar.xz samba-0df2063902660b059590eeb27d2f994e4d16af44.zip |
Made some things static, some of those turned out to be
unused currently, if you need them, make them public again:
lib/msrpc-client.c, rpc_client/cli_connect.c,
rpc_parse/parse_lsa.c, rpcclient/display_dfs.c
merged a little of util_sid.c from HEAD (more cosmetic and
ordering)
dropped in profile.c from HEAD
-rw-r--r-- | source/include/proto.h | 13 | ||||
-rw-r--r-- | source/include/rpc_parse_proto.h | 13 | ||||
-rw-r--r-- | source/lib/msrpc-client.c | 10 | ||||
-rw-r--r-- | source/lib/util_sid.c | 81 | ||||
-rw-r--r-- | source/profile/profile.c | 10 | ||||
-rw-r--r-- | source/rpc_client/cli_connect.c | 2 | ||||
-rw-r--r-- | source/rpc_parse/parse_lsa.c | 112 | ||||
-rw-r--r-- | source/rpcclient/display_dfs.c | 8 |
8 files changed, 116 insertions, 133 deletions
diff --git a/source/include/proto.h b/source/include/proto.h index 110a532b41e..1d573e66714 100644 --- a/source/include/proto.h +++ b/source/include/proto.h @@ -338,11 +338,6 @@ void MD5Transform(uint32 buf[4], const uchar inext[64]); BOOL receive_msrpc(int fd, prs_struct * data, unsigned int timeout); BOOL msrpc_send(int fd, prs_struct * ps); BOOL msrpc_receive(int fd, prs_struct * ps); -BOOL ncalrpc_l_connect(struct msrpc_local *msrpc, const char *pipe_name); -void ncalrpc_l_close_socket(struct msrpc_local *msrpc); -void ncalrpc_l_sockopt(struct msrpc_local *msrpc, char *options); -BOOL ncalrpc_l_connect_auth(struct msrpc_local *msrpc, - const vuser_key * key, const char *pipename); struct msrpc_local *ncalrpc_l_initialise(struct msrpc_local *msrpc, const vuser_key * key); void ncalrpc_l_shutdown(struct msrpc_local *msrpc); @@ -765,13 +760,13 @@ BOOL string_to_sid(DOM_SID *sidout, const char *sidstr); BOOL sid_append_rid(DOM_SID *sid, uint32 rid); BOOL sid_split_rid(DOM_SID *sid, uint32 *rid); void sid_copy(DOM_SID *dst, const DOM_SID *src); +DOM_SID *sid_dup(const DOM_SID *src); BOOL sid_front_equal(const DOM_SID *sid1, const DOM_SID *sid2); BOOL sid_equal(const DOM_SID *sid1, const DOM_SID *sid2); -int sid_size(const DOM_SID *sid); -DOM_SID *sid_dup(const DOM_SID *src); BOOL read_sid(char *domain_name, DOM_SID *sid); BOOL write_sid(char *domain_name, DOM_SID *sid); BOOL create_new_sid(DOM_SID *sid); +int sid_size(const DOM_SID *sid); /*The following definitions come from lib/util_sock.c */ @@ -3197,10 +3192,6 @@ void display_at_job_info(FILE *out_hnd, enum action_type action, /*The following definitions come from rpcclient/display_dfs.c */ -void display_dfs_enum_1(FILE *hnd, DFS_INFO_CTR *ctr); -void display_dfs_enum_2(FILE *hnd, DFS_INFO_CTR *ctr); -void display_dfs_enum_3_storages(FILE *hnd, DFS_INFO_3 *info3); -void display_dfs_enum_3(FILE *hnd, DFS_INFO_CTR *ctr); void display_dfs_enum(FILE *hnd, char *srv_name, DFS_INFO_CTR *ctr); /*The following definitions come from rpcclient/display_event.c */ diff --git a/source/include/rpc_parse_proto.h b/source/include/rpc_parse_proto.h index f8134bc3377..7dd3088ac24 100644 --- a/source/include/rpc_parse_proto.h +++ b/source/include/rpc_parse_proto.h @@ -8,11 +8,6 @@ BOOL receive_msrpc(int fd, prs_struct * data, unsigned int timeout); BOOL msrpc_send(int fd, prs_struct * ps); BOOL msrpc_receive(int fd, prs_struct * ps); -BOOL ncalrpc_l_connect(struct msrpc_local *msrpc, const char *pipe_name); -void ncalrpc_l_close_socket(struct msrpc_local *msrpc); -void ncalrpc_l_sockopt(struct msrpc_local *msrpc, char *options); -BOOL ncalrpc_l_connect_auth(struct msrpc_local *msrpc, - const vuser_key * key, const char *pipename); struct msrpc_local *ncalrpc_l_initialise(struct msrpc_local *msrpc, const vuser_key * key); void ncalrpc_l_shutdown(struct msrpc_local *msrpc); @@ -161,8 +156,6 @@ BOOL make_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM * r_e, int32 enum_context, BOOL lsa_io_r_enum_trust_dom(char *desc, LSA_R_ENUM_TRUST_DOM * r_e, prs_struct * ps, int depth); void lsa_free_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM * r_e); -BOOL lsa_io_r_query(char *desc, LSA_R_QUERY_INFO * r_q, prs_struct * ps, - int depth); BOOL make_lsa_sid_enum(LSA_SID_ENUM * sen, uint32 num_entries, DOM_SID **sids); BOOL make_q_lookup_sids(LSA_Q_LOOKUP_SIDS * q_l, POLICY_HND *hnd, int num_sids, DOM_SID ** sids, uint16 level); @@ -181,10 +174,8 @@ BOOL lsa_io_q_close(char *desc, LSA_Q_CLOSE * q_c, prs_struct * ps, int depth); BOOL lsa_io_r_close(char *desc, LSA_R_CLOSE * r_c, prs_struct * ps, int depth); BOOL make_dom_rid2(DOM_RID2 *rid2, uint32 rid, uint16 type, uint32 idx); BOOL smb_io_dom_rid2(char *desc, DOM_RID2 *rid2, prs_struct *ps, int depth); -BOOL lsa_io_dom_query_2(char *desc, DOM_QUERY_2 *d_q, - prs_struct *ps, int depth); -BOOL lsa_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); -BOOL lsa_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth); +BOOL lsa_io_r_query(char *desc, LSA_R_QUERY_INFO * r_q, + prs_struct *ps, int depth); /*The following definitions come from rpc_parse/parse_misc.c */ diff --git a/source/lib/msrpc-client.c b/source/lib/msrpc-client.c index e8bb803c4ce..d34bed95130 100644 --- a/source/lib/msrpc-client.c +++ b/source/lib/msrpc-client.c @@ -146,7 +146,7 @@ BOOL msrpc_receive(int fd, prs_struct * ps) /**************************************************************************** open the msrpcent sockets ****************************************************************************/ -BOOL ncalrpc_l_connect(struct msrpc_local *msrpc, const char *pipe_name) +static BOOL ncalrpc_l_connect(struct msrpc_local *msrpc, const char *pipe_name) { fstring path; fstring pname; @@ -170,7 +170,7 @@ BOOL ncalrpc_l_connect(struct msrpc_local *msrpc, const char *pipe_name) /**************************************************************************** close the socket descriptor ****************************************************************************/ -void ncalrpc_l_close_socket(struct msrpc_local *msrpc) +static void ncalrpc_l_close_socket(struct msrpc_local *msrpc) { if (msrpc->fd != -1) { @@ -183,7 +183,7 @@ void ncalrpc_l_close_socket(struct msrpc_local *msrpc) /**************************************************************************** set socket options on a open connection ****************************************************************************/ -void ncalrpc_l_sockopt(struct msrpc_local *msrpc, char *options) +static void ncalrpc_l_sockopt(struct msrpc_local *msrpc, char *options) { set_socket_options(msrpc->fd, options); } @@ -229,8 +229,8 @@ static BOOL ncalrpc_l_authenticate(struct msrpc_local *msrpc) return len == sizeof(status) && status == 0x0; } -BOOL ncalrpc_l_connect_auth(struct msrpc_local *msrpc, - const vuser_key * key, const char *pipename) +static BOOL ncalrpc_l_connect_auth(struct msrpc_local *msrpc, + const vuser_key * key, const char *pipename) { ZERO_STRUCTP(msrpc); if (!ncalrpc_l_initialise(msrpc, key)) diff --git a/source/lib/util_sid.c b/source/lib/util_sid.c index 44fc81f76a4..26b72495c11 100644 --- a/source/lib/util_sid.c +++ b/source/lib/util_sid.c @@ -115,8 +115,9 @@ BOOL string_to_sid(DOM_SID *sidout, const char *sidstr) } /***************************************************************** - add a rid to the end of a sid + Add a rid to the end of a sid *****************************************************************/ + BOOL sid_append_rid(DOM_SID *sid, uint32 rid) { if (sid->num_auths < MAXSUBAUTHS) @@ -128,8 +129,9 @@ BOOL sid_append_rid(DOM_SID *sid, uint32 rid) } /***************************************************************** - removes the last rid from the end of a sid + Removes the last rid from the end of a sid *****************************************************************/ + BOOL sid_split_rid(DOM_SID *sid, uint32 *rid) { if (sid->num_auths > 0) @@ -145,12 +147,16 @@ BOOL sid_split_rid(DOM_SID *sid, uint32 *rid) } /***************************************************************** - copies a sid + Copies a sid *****************************************************************/ + void sid_copy(DOM_SID *dst, const DOM_SID *src) { int i; + dst->sid_rev_num = src->sid_rev_num; + dst->num_auths = src->num_auths; + for (i = 0; i < 6; i++) { dst->id_auth[i] = src->id_auth[i]; @@ -160,9 +166,25 @@ void sid_copy(DOM_SID *dst, const DOM_SID *src) { dst->sub_auths[i] = src->sub_auths[i]; } +} - dst->num_auths = src->num_auths; - dst->sid_rev_num = src->sid_rev_num; +/***************************************************************** + Duplicates a sid - mallocs the target. +*****************************************************************/ + +DOM_SID *sid_dup(const DOM_SID *src) +{ + DOM_SID *dst; + + if(!src) + return NULL; + + if((dst = (DOM_SID*)malloc(sizeof(DOM_SID))) != NULL) { + memset(dst, '\0', sizeof(DOM_SID)); + sid_copy( dst, src); + } + + return dst; } /***************************************************************** @@ -216,38 +238,6 @@ BOOL sid_equal(const DOM_SID *sid1, const DOM_SID *sid2) } -/***************************************************************** - calculates size of a sid -*****************************************************************/ -int sid_size(const DOM_SID *sid) -{ - if (sid == NULL) - { - return 0; - } - return sid->num_auths * sizeof(uint32) + 8; -} - - -/***************************************************************** - Duplicates a sid - mallocs the target. -*****************************************************************/ - -DOM_SID *sid_dup(const DOM_SID *src) -{ - DOM_SID *dst; - - if(!src) - return NULL; - - if((dst = (DOM_SID*)malloc(sizeof(DOM_SID))) != NULL) { - memset(dst, '\0', sizeof(DOM_SID)); - sid_copy( dst, src); - } - - return dst; -} - /**************************************************************************** Read a SID from a file. @@ -360,7 +350,7 @@ BOOL read_sid(char *domain_name, DOM_SID *sid) } close(fd); return True; -} +} /**************************************************************************** @@ -539,4 +529,17 @@ BOOL create_new_sid(DOM_SID *sid) return True; } - + + +/***************************************************************** + Calculates size of a sid. +*****************************************************************/ + +int sid_size(const DOM_SID *sid) +{ + if (sid == NULL) + { + return 0; + } + return sid->num_auths * sizeof(uint32) + 8; +} diff --git a/source/profile/profile.c b/source/profile/profile.c index b685b119169..72954f90c9f 100644 --- a/source/profile/profile.c +++ b/source/profile/profile.c @@ -30,10 +30,6 @@ extern int DEBUGLEVEL; -#define SHMEM_KEY ((key_t)0x07021999) -#define SHM_MAGIC 0x6349985 -#define SHM_VERSION 1 - #define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6)) static int shm_id; @@ -52,13 +48,13 @@ BOOL profile_setup(BOOL rdonly) again: /* try to use an existing key */ - shm_id = shmget(SHMEM_KEY, 0, 0); + shm_id = shmget(PROF_SHMEM_KEY, 0, 0); /* if that failed then create one. There is a race condition here if we are running from inetd. Bad luck. */ if (shm_id == -1) { if (read_only) return False; - shm_id = shmget(SHMEM_KEY, sizeof(*profile_p), + shm_id = shmget(PROF_SHMEM_KEY, sizeof(*profile_p), IPC_CREAT | IPC_EXCL | IPC_PERMS); } @@ -101,6 +97,8 @@ BOOL profile_setup(BOOL rdonly) if (!read_only && (shm_ds.shm_nattch == 1)) { memset((char *)profile_p, 0, sizeof(*profile_p)); + profile_p->prof_shm_magic = PROF_SHM_MAGIC; + profile_p->prof_shm_version = PROF_SHM_VERSION; DEBUG(3,("Initialised profile area\n")); } diff --git a/source/rpc_client/cli_connect.c b/source/rpc_client/cli_connect.c index d6dc7938720..bb2e5f0f231 100644 --- a/source/rpc_client/cli_connect.c +++ b/source/rpc_client/cli_connect.c @@ -57,7 +57,7 @@ struct cli_connection }; static struct cli_connection **con_list = NULL; -uint32 num_cons = 0; +static uint32 num_cons = 0; void init_connections(void) { diff --git a/source/rpc_parse/parse_lsa.c b/source/rpc_parse/parse_lsa.c index f4d08fab463..1146282baa7 100644 --- a/source/rpc_parse/parse_lsa.c +++ b/source/rpc_parse/parse_lsa.c @@ -1059,58 +1059,6 @@ void lsa_free_r_enum_trust_dom(LSA_R_ENUM_TRUST_DOM * r_e) } /******************************************************************* -reads or writes an LSA_R_QUERY_INFO structure. -********************************************************************/ -BOOL lsa_io_r_query(char *desc, LSA_R_QUERY_INFO * r_q, prs_struct * ps, - int depth) -{ - if (r_q == NULL) - return False; - - prs_debug(ps, depth, desc, "lsa_io_r_query"); - depth++; - - prs_uint32("undoc_buffer", ps, depth, &(r_q->undoc_buffer)); - - if (r_q->undoc_buffer != 0) - { - prs_uint16("info_class", ps, depth, &(r_q->info_class)); - prs_align(ps); - - switch (r_q->info_class) - { - case 2: - { - lsa_io_dom_query_2("", &(r_q->dom.id2), ps, - depth); - break; - } - case 3: - { - lsa_io_dom_query_3("", &(r_q->dom.id3), ps, - depth); - break; - } - case 5: - { - lsa_io_dom_query_5("", &(r_q->dom.id3), ps, - depth); - break; - } - default: - { - /* PANIC! */ - break; - } - } - } - - prs_uint32("status", ps, depth, &(r_q->status)); - - return True; -} - -/******************************************************************* makes a LSA_SID_ENUM structure. ********************************************************************/ BOOL make_lsa_sid_enum(LSA_SID_ENUM * sen, uint32 num_entries, DOM_SID **sids) @@ -1555,8 +1503,8 @@ static BOOL lsa_io_dom_query(char *desc, DOM_QUERY *d_q, prs_struct *ps, int de /******************************************************************* reads or writes a structure. ********************************************************************/ -BOOL lsa_io_dom_query_2(char *desc, DOM_QUERY_2 *d_q, - prs_struct *ps, int depth) +static BOOL lsa_io_dom_query_2(char *desc, DOM_QUERY_2 *d_q, + prs_struct *ps, int depth) { uint32 ptr = 1; @@ -1592,7 +1540,7 @@ BOOL lsa_io_dom_query_2(char *desc, DOM_QUERY_2 *d_q, /******************************************************************* reads or writes a dom query structure. ********************************************************************/ -BOOL lsa_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) +static BOOL lsa_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) { lsa_io_dom_query("", d_q, ps, depth); @@ -1602,9 +1550,61 @@ BOOL lsa_io_dom_query_3(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth /******************************************************************* reads or writes a dom query structure. ********************************************************************/ -BOOL lsa_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) +static BOOL lsa_io_dom_query_5(char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth) { lsa_io_dom_query("", d_q, ps, depth); return True; } + +/******************************************************************* +reads or writes an LSA_R_QUERY_INFO structure. +********************************************************************/ +BOOL lsa_io_r_query(char *desc, LSA_R_QUERY_INFO * r_q, + prs_struct *ps, int depth) +{ + if (r_q == NULL) + return False; + + prs_debug(ps, depth, desc, "lsa_io_r_query"); + depth++; + + prs_uint32("undoc_buffer", ps, depth, &(r_q->undoc_buffer)); + + if (r_q->undoc_buffer != 0) + { + prs_uint16("info_class", ps, depth, &(r_q->info_class)); + prs_align(ps); + + switch (r_q->info_class) + { + case 2: + { + lsa_io_dom_query_2("", &(r_q->dom.id2), ps, + depth); + break; + } + case 3: + { + lsa_io_dom_query_3("", &(r_q->dom.id3), ps, + depth); + break; + } + case 5: + { + lsa_io_dom_query_5("", &(r_q->dom.id3), ps, + depth); + break; + } + default: + { + /* PANIC! */ + break; + } + } + } + + prs_uint32("status", ps, depth, &(r_q->status)); + + return True; +} diff --git a/source/rpcclient/display_dfs.c b/source/rpcclient/display_dfs.c index 84f911d67cf..7d2b49e15dc 100644 --- a/source/rpcclient/display_dfs.c +++ b/source/rpcclient/display_dfs.c @@ -28,7 +28,7 @@ extern FILE* out_hnd; /* * Dfs namespace enumeration (info level 1) */ -void display_dfs_enum_1(FILE *hnd, DFS_INFO_CTR *ctr) +static void display_dfs_enum_1(FILE *hnd, DFS_INFO_CTR *ctr) { int i=0; for(i=0;i<ctr->num_entries;i++) @@ -44,7 +44,7 @@ void display_dfs_enum_1(FILE *hnd, DFS_INFO_CTR *ctr) /* * Dfs namespace enumeration (info level 2) */ -void display_dfs_enum_2(FILE *hnd, DFS_INFO_CTR *ctr) +static void display_dfs_enum_2(FILE *hnd, DFS_INFO_CTR *ctr) { int i=0; for(i=0;i<ctr->num_entries;i++) @@ -77,7 +77,7 @@ void display_dfs_enum_2(FILE *hnd, DFS_INFO_CTR *ctr) /* * Dfs namespace enumeration (info level 3:storages) */ -void display_dfs_enum_3_storages(FILE *hnd, DFS_INFO_3 *info3) +static void display_dfs_enum_3_storages(FILE *hnd, DFS_INFO_3 *info3) { int i=0; if((info3 == NULL) || (info3->storages==NULL)) @@ -102,7 +102,7 @@ void display_dfs_enum_3_storages(FILE *hnd, DFS_INFO_3 *info3) /* * Dfs namespace enumeration (info level 3) */ -void display_dfs_enum_3(FILE *hnd, DFS_INFO_CTR *ctr) +static void display_dfs_enum_3(FILE *hnd, DFS_INFO_CTR *ctr) { int i=0; |