diff options
author | Jeremy Allison <jra@samba.org> | 2002-11-12 23:20:50 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-11-12 23:20:50 +0000 |
commit | 2f194322d419350f35a48dff750066894d68eccf (patch) | |
tree | b0501eaf874ca8e740a51a8e0f29d261e32e0093 /source3/rpc_server | |
parent | f2b669b37fecda2687860eba4a15801dc89855dc (diff) | |
download | samba-2f194322d419350f35a48dff750066894d68eccf.tar.gz samba-2f194322d419350f35a48dff750066894d68eccf.tar.bz2 samba-2f194322d419350f35a48dff750066894d68eccf.zip |
Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit f755711df8f74f9b8e8c1a2b0d07d02a931eeb89)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_dfs.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_dfs_nt.c | 10 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 41 | ||||
-rw-r--r-- | source3/rpc_server/srv_netlog_nt.c | 5 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 16 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 4 | ||||
-rw-r--r-- | source3/rpc_server/srv_srvsvc_nt.c | 8 | ||||
-rw-r--r-- | source3/rpc_server/srv_wkssvc_nt.c | 4 |
8 files changed, 36 insertions, 54 deletions
diff --git a/source3/rpc_server/srv_dfs.c b/source3/rpc_server/srv_dfs.c index 5edc1222a8..676ad8e3f3 100644 --- a/source3/rpc_server/srv_dfs.c +++ b/source3/rpc_server/srv_dfs.c @@ -31,8 +31,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV -extern pstring global_myname; - /********************************************************************** api_dfs_exist **********************************************************************/ diff --git a/source3/rpc_server/srv_dfs_nt.c b/source3/rpc_server/srv_dfs_nt.c index 65e387176d..da92e5c06b 100644 --- a/source3/rpc_server/srv_dfs_nt.c +++ b/source3/rpc_server/srv_dfs_nt.c @@ -29,8 +29,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV -extern pstring global_myname; - #define MAX_MSDFS_JUNCTIONS 256 /* This function does not return a WERROR or NTSTATUS code but rather 1 if @@ -197,7 +195,7 @@ static BOOL init_reply_dfs_info_1(struct junction_map* j, DFS_INFO_1* dfs1, int { pstring str; dfs1[i].ptr_entrypath = 1; - slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname, + slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(), j[i].service_name, j[i].volume_name); DEBUG(5,("init_reply_dfs_info_1: %d) initing entrypath: %s\n",i,str)); init_unistr2(&dfs1[i].entrypath,str,strlen(str)+1); @@ -212,7 +210,7 @@ static BOOL init_reply_dfs_info_2(struct junction_map* j, DFS_INFO_2* dfs2, int { pstring str; dfs2[i].ptr_entrypath = 1; - slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname, + slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(), j[i].service_name, j[i].volume_name); init_unistr2(&dfs2[i].entrypath, str, strlen(str)+1); dfs2[i].ptr_comment = 0; @@ -231,9 +229,9 @@ static BOOL init_reply_dfs_info_3(TALLOC_CTX *ctx, struct junction_map* j, DFS_I dfs3[i].ptr_entrypath = 1; if (j[i].volume_name[0] == '\0') slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s", - global_myname, j[i].service_name); + global_myname(), j[i].service_name); else - slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname, + slprintf(str, sizeof(pstring)-1, "\\\\%s\\%s\\%s", global_myname(), j[i].service_name, j[i].volume_name); init_unistr2(&dfs3[i].entrypath, str, strlen(str)+1); diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index c4fc0a5de7..fc51d7ef2f 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -30,13 +30,11 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV -extern fstring global_myworkgroup; -extern pstring global_myname; extern PRIVS privs[]; struct lsa_info { - DOM_SID sid; - uint32 access; + DOM_SID sid; + uint32 access; }; struct generic_mapping lsa_generic_mapping = { @@ -61,7 +59,7 @@ static void free_lsa_info(void *ptr) Init dom_query ***************************************************************************/ -static void init_dom_query(DOM_QUERY *d_q, char *dom_name, DOM_SID *dom_sid) +static void init_dom_query(DOM_QUERY *d_q, const char *dom_name, DOM_SID *dom_sid) { int domlen = (dom_name != NULL) ? strlen(dom_name) : 0; @@ -343,10 +341,11 @@ static NTSTATUS lsa_get_generic_sd(TALLOC_CTX *mem_ctx, SEC_DESC **sd, size_t *s } /*************************************************************************** - init_dns_dom_info. - ***************************************************************************/ -static void init_dns_dom_info(LSA_DNS_DOM_INFO *r_l, char *nb_name, - char *dns_name, char *forest_name, + Init_dns_dom_info. +***************************************************************************/ + +static void init_dns_dom_info(LSA_DNS_DOM_INFO *r_l, const char *nb_name, + const char *dns_name, const char *forest_name, GUID *dom_guid, DOM_SID *dom_sid) { if (nb_name && *nb_name) { @@ -513,7 +512,7 @@ NTSTATUS _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INF struct lsa_info *handle; LSA_INFO_UNION *info = &r_u->dom; DOM_SID domain_sid; - char *name = NULL; + const char *name; DOM_SID *sid = NULL; r_u->status = NT_STATUS_OK; @@ -548,20 +547,19 @@ NTSTATUS _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INF switch (lp_server_role()) { case ROLE_DOMAIN_PDC: case ROLE_DOMAIN_BDC: - name = global_myworkgroup; + name = lp_workgroup(); sid = get_global_sam_sid(); break; case ROLE_DOMAIN_MEMBER: - name = global_myworkgroup; + name = lp_workgroup(); /* We need to return the Domain SID here. */ - if (secrets_fetch_domain_sid(global_myworkgroup, - &domain_sid)) + if (secrets_fetch_domain_sid(lp_workgroup(), &domain_sid)) sid = &domain_sid; else return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; break; case ROLE_STANDALONE: - name = global_myworkgroup; + name = lp_workgroup(); sid = NULL; break; default: @@ -578,15 +576,15 @@ NTSTATUS _lsa_query_info(pipes_struct *p, LSA_Q_QUERY_INFO *q_u, LSA_R_QUERY_INF switch (lp_server_role()) { case ROLE_DOMAIN_PDC: case ROLE_DOMAIN_BDC: - name = global_myworkgroup; + name = lp_workgroup(); sid = get_global_sam_sid(); break; case ROLE_DOMAIN_MEMBER: - name = global_myname; + name = global_myname(); sid = get_global_sam_sid(); break; case ROLE_STANDALONE: - name = global_myname; + name = global_myname(); sid = get_global_sam_sid(); break; default: @@ -1214,7 +1212,7 @@ NTSTATUS _lsa_query_secobj(pipes_struct *p, LSA_Q_QUERY_SEC_OBJ *q_u, LSA_R_QUER NTSTATUS _lsa_query_info2(pipes_struct *p, LSA_Q_QUERY_INFO2 *q_u, LSA_R_QUERY_INFO2 *r_u) { struct lsa_info *handle; - char *nb_name = NULL; + const char *nb_name; char *dns_name = NULL; char *forest_name = NULL; DOM_SID *sid = NULL; @@ -1236,13 +1234,12 @@ NTSTATUS _lsa_query_info2(pipes_struct *p, LSA_Q_QUERY_INFO2 *q_u, LSA_R_QUERY_I switch (lp_server_role()) { case ROLE_DOMAIN_PDC: case ROLE_DOMAIN_BDC: - nb_name = global_myworkgroup; + nb_name = lp_workgroup(); /* ugly temp hack for these next two */ dns_name = lp_realm(); forest_name = lp_realm(); sid = get_global_sam_sid(); - secrets_fetch_domain_guid(global_myworkgroup, - &guid); + secrets_fetch_domain_guid(lp_workgroup(), &guid); break; default: return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c index 69d619a2b0..12841a2e08 100644 --- a/source3/rpc_server/srv_netlog_nt.c +++ b/source3/rpc_server/srv_netlog_nt.c @@ -29,8 +29,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV -extern pstring global_myname; - /************************************************************************* init_net_r_req_chal: *************************************************************************/ @@ -687,8 +685,7 @@ NTSTATUS _net_sam_logon(pipes_struct *p, NET_Q_SAM_LOGON *q_u, NET_R_SAM_LOGON * return NT_STATUS_UNSUCCESSFUL; } - pstrcpy(my_name, global_myname); - strupper(my_name); + pstrcpy(my_name, global_myname()); /* * This is the point at which we get the group diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 0b5870b16c..603dcd0017 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -34,8 +34,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV -extern fstring global_myworkgroup; -extern pstring global_myname; extern DOM_SID global_sid_Builtin; extern rid_name domain_group_rids[]; @@ -2123,7 +2121,7 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA free_samr_db(info); /* The time call below is to get a sequence number for the sam. FIXME !!! JRA. */ - init_unk_info2(&ctr->info.inf2, global_myworkgroup, global_myname, (uint32) time(NULL), + init_unk_info2(&ctr->info.inf2, lp_workgroup(), global_myname(), (uint32) time(NULL), num_users, num_groups, num_aliases); break; case 0x03: @@ -2133,7 +2131,7 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA init_unk_info3(&ctr->info.inf3, nt_logout); break; case 0x05: - init_unk_info5(&ctr->info.inf5, global_myname); + init_unk_info5(&ctr->info.inf5, global_myname()); break; case 0x06: init_unk_info6(&ctr->info.inf6); @@ -2564,7 +2562,7 @@ NTSTATUS _samr_enum_domains(pipes_struct *p, SAMR_Q_ENUM_DOMAINS *q_u, SAMR_R_EN struct samr_info *info; uint32 num_entries = 2; fstring dom[2]; - char *name; + const char *name; r_u->status = NT_STATUS_OK; @@ -2578,10 +2576,10 @@ NTSTATUS _samr_enum_domains(pipes_struct *p, SAMR_Q_ENUM_DOMAINS *q_u, SAMR_R_EN switch (lp_server_role()) { case ROLE_DOMAIN_PDC: case ROLE_DOMAIN_BDC: - name = global_myworkgroup; + name = lp_workgroup(); break; default: - name = global_myname; + name = global_myname(); } fstrcpy(dom[0],name); @@ -4313,7 +4311,7 @@ NTSTATUS _samr_unknown_2e(pipes_struct *p, SAMR_Q_UNKNOWN_2E *q_u, SAMR_R_UNKNOW free_samr_db(info); /* The time call below is to get a sequence number for the sam. FIXME !!! JRA. */ - init_unk_info2(&ctr->info.inf2, global_myworkgroup, global_myname, (uint32) time(NULL), + init_unk_info2(&ctr->info.inf2, lp_workgroup(), global_myname(), (uint32) time(NULL), num_users, num_groups, num_aliases); break; case 0x03: @@ -4325,7 +4323,7 @@ NTSTATUS _samr_unknown_2e(pipes_struct *p, SAMR_Q_UNKNOWN_2E *q_u, SAMR_R_UNKNOW init_unk_info3(&ctr->info.inf3, nt_logout); break; case 0x05: - init_unk_info5(&ctr->info.inf5, global_myname); + init_unk_info5(&ctr->info.inf5, global_myname()); break; case 0x06: init_unk_info6(&ctr->info.inf6); diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 871aac8e68..ad55ea6a49 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -2332,8 +2332,6 @@ done: static BOOL spoolss_connect_to_client(struct cli_state *the_cli, const char *remote_machine) { - extern pstring global_myname; - ZERO_STRUCTP(the_cli); if(cli_initialise(the_cli) == NULL) { DEBUG(0,("connect_to_client: unable to initialize client connection.\n")); @@ -2358,7 +2356,7 @@ static BOOL spoolss_connect_to_client(struct cli_state *the_cli, const char *rem return False; } - if (!attempt_netbios_session_request(the_cli, global_myname, remote_machine, &the_cli->dest_ip)) { + if (!attempt_netbios_session_request(the_cli, global_myname(), remote_machine, &the_cli->dest_ip)) { DEBUG(0,("connect_to_client: machine %s rejected the NetBIOS session request.\n", remote_machine)); cli_shutdown(the_cli); diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index ecde51df9f..0384bb81a3 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -27,8 +27,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV -extern pstring global_myname; - /******************************************************************* Utility function to get the 'type' of a share from an snum. ********************************************************************/ @@ -1211,7 +1209,7 @@ WERROR _srv_net_srv_get_info(pipes_struct *p, SRV_Q_NET_SRV_GET_INFO *q_u, SRV_R case 102: init_srv_info_102(&ctr->srv.sv102, - 500, global_myname, + 500, global_myname(), string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH), lp_major_announce_version(), lp_minor_announce_version(), lp_default_server_announce(), @@ -1225,13 +1223,13 @@ WERROR _srv_net_srv_get_info(pipes_struct *p, SRV_Q_NET_SRV_GET_INFO *q_u, SRV_R break; case 101: init_srv_info_101(&ctr->srv.sv101, - 500, global_myname, + 500, global_myname(), lp_major_announce_version(), lp_minor_announce_version(), lp_default_server_announce(), string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH)); break; case 100: - init_srv_info_100(&ctr->srv.sv100, 500, global_myname); + init_srv_info_100(&ctr->srv.sv100, 500, global_myname()); break; default: status = WERR_UNKNOWN_LEVEL; diff --git a/source3/rpc_server/srv_wkssvc_nt.c b/source3/rpc_server/srv_wkssvc_nt.c index 7687e7b00a..bda7b14a42 100644 --- a/source3/rpc_server/srv_wkssvc_nt.c +++ b/source3/rpc_server/srv_wkssvc_nt.c @@ -28,8 +28,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV -extern pstring global_myname; - /******************************************************************* create_wks_info_100 ********************************************************************/ @@ -41,7 +39,7 @@ static void create_wks_info_100(WKS_INFO_100 *inf) DEBUG(5,("create_wks_info_100: %d\n", __LINE__)); - pstrcpy (my_name, global_myname); + pstrcpy (my_name, global_myname()); strupper(my_name); pstrcpy (domain, lp_workgroup()); |