[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-1378-g7a3fe68

Günther Deschner gd at samba.org
Tue Jan 15 15:41:17 GMT 2008


The branch, v3-2-test has been updated
       via  7a3fe68bef7acde9d9f8a7a44ce7e9432f3c5a95 (commit)
      from  561e529a711338b2a3191f1b04f384f5ab3413ac (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 7a3fe68bef7acde9d9f8a7a44ce7e9432f3c5a95
Author: Günther Deschner <gd at samba.org>
Date:   Tue Jan 15 16:40:02 2008 +0100

    Apply const to rpccli_lsa_query_info_policy() and rpccli_lsa_query_info_policy2().
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/rpc_client/cli_lsarpc.c |    8 +++++---
 source/rpcclient/rpcclient.c   |    2 +-
 source/utils/net.h             |    2 +-
 source/utils/net_ads.c         |    7 ++++---
 source/utils/net_domain.c      |    2 +-
 source/utils/net_rpc.c         |   11 ++++++-----
 source/utils/net_rpc_join.c    |    4 ++--
 source/winbindd/winbindd_cm.c  |    6 +++---
 8 files changed, 23 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
index 77ade5c..286cc21 100644
--- a/source/rpc_client/cli_lsarpc.c
+++ b/source/rpc_client/cli_lsarpc.c
@@ -542,7 +542,8 @@ NTSTATUS rpccli_lsa_query_info_policy2_new(struct rpc_pipe_client *cli, TALLOC_C
 NTSTATUS rpccli_lsa_query_info_policy(struct rpc_pipe_client *cli,
 				      TALLOC_CTX *mem_ctx,
 				      POLICY_HND *pol, uint16 info_class,
-				      char **domain_name, DOM_SID **domain_sid)
+				      const char **domain_name,
+				      DOM_SID **domain_sid)
 {
 	prs_struct qbuf, rbuf;
 	LSA_Q_QUERY_INFO q;
@@ -632,8 +633,9 @@ NTSTATUS rpccli_lsa_query_info_policy(struct rpc_pipe_client *cli,
 NTSTATUS rpccli_lsa_query_info_policy2(struct rpc_pipe_client *cli,
 				       TALLOC_CTX *mem_ctx,
 				       POLICY_HND *pol, uint16 info_class,
-				       char **domain_name, char **dns_name,
-				       char **forest_name,
+				       const char **domain_name,
+				       const char **dns_name,
+				       const char **forest_name,
 				       struct GUID **domain_guid,
 				       DOM_SID **domain_sid)
 {
diff --git a/source/rpcclient/rpcclient.c b/source/rpcclient/rpcclient.c
index dd8b911..081e0fb 100644
--- a/source/rpcclient/rpcclient.c
+++ b/source/rpcclient/rpcclient.c
@@ -134,7 +134,7 @@ static void fetch_machine_sid(struct cli_state *cli)
 	POLICY_HND pol;
 	NTSTATUS result = NT_STATUS_OK;
 	uint32 info_class = 5;
-	char *domain_name = NULL;
+	const char *domain_name = NULL;
 	static bool got_domain_sid;
 	TALLOC_CTX *mem_ctx;
 	DOM_SID *dom_sid = NULL;
diff --git a/source/utils/net.h b/source/utils/net.h
index 2ffa4d7..3a4b1da 100644
--- a/source/utils/net.h
+++ b/source/utils/net.h
@@ -42,7 +42,7 @@ struct rpc_sh_ctx {
 	struct cli_state *cli;
 
 	DOM_SID *domain_sid;
-	char *domain_name;
+	const char *domain_name;
 
 	const char *whoami;
 	const char *thiscmd;
diff --git a/source/utils/net_ads.c b/source/utils/net_ads.c
index 0a9020b..732ba8d 100644
--- a/source/utils/net_ads.c
+++ b/source/utils/net_ads.c
@@ -817,7 +817,7 @@ static int net_ads_leave(int argc, const char **argv)
 	struct cli_state *cli = NULL;
 	TALLOC_CTX *ctx;
 	DOM_SID *dom_sid = NULL;
-	char *short_domain_name = NULL;
+	const char *short_domain_name = NULL;
 
 	if (!secrets_init()) {
 		DEBUG(1,("Failed to initialise secrets database\n"));
@@ -961,7 +961,8 @@ static NTSTATUS check_ads_config( void )
  ********************************************************************/
 
 static NTSTATUS net_join_domain(TALLOC_CTX *ctx, const char *servername,
-				struct sockaddr_storage *pss, char **domain,
+				struct sockaddr_storage *pss,
+				const char **domain,
 				DOM_SID **dom_sid,
 				const char *password)
 {
@@ -1445,7 +1446,7 @@ int net_ads_join(int argc, const char **argv)
 	ADS_STRUCT *ads = NULL;
 	ADS_STATUS status;
 	NTSTATUS nt_status;
-	char *short_domain_name = NULL;
+	const char *short_domain_name = NULL;
 	char *tmp_password, *password;
 	TALLOC_CTX *ctx = NULL;
 	DOM_SID *domain_sid = NULL;
diff --git a/source/utils/net_domain.c b/source/utils/net_domain.c
index 3f1908e..da5e61c 100644
--- a/source/utils/net_domain.c
+++ b/source/utils/net_domain.c
@@ -157,7 +157,7 @@ int netdom_store_machine_account( const char *domain, DOM_SID *sid, const char *
  ********************************************************************/
 
 NTSTATUS netdom_get_domain_sid( TALLOC_CTX *mem_ctx, struct cli_state *cli, 
-				char **domain, DOM_SID **sid )
+				const char **domain, DOM_SID **sid )
 {
 	struct rpc_pipe_client *pipe_hnd = NULL;
 	POLICY_HND lsa_pol;
diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c
index 2bd867f..6779246 100644
--- a/source/utils/net_rpc.c
+++ b/source/utils/net_rpc.c
@@ -51,7 +51,8 @@ static bool sync_files(struct copy_clistate *cp_clistate, const char *mask);
  **/
 
 NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx,
-				   DOM_SID **domain_sid, char **domain_name)
+				   DOM_SID **domain_sid,
+				   const char **domain_name)
 {
 	struct rpc_pipe_client *lsa_pipe;
 	POLICY_HND pol;
@@ -112,7 +113,7 @@ int run_rpc_command(struct cli_state *cli_arg,
 	TALLOC_CTX *mem_ctx;
 	NTSTATUS nt_status;
 	DOM_SID *domain_sid;
-	char *domain_name;
+	const char *domain_name;
 
 	/* make use of cli_state handed over as an argument, if possible */
 	if (!cli_arg) {
@@ -5607,7 +5608,7 @@ static int rpc_trustdom_establish(int argc, const char **argv)
 	DOM_SID *domain_sid;
 
 	char* domain_name;
-	char* domain_name_pol;
+	const char* domain_name_pol;
 	char* acct_name;
 	fstring pdc_name;
 	char *dc_name;
@@ -5917,7 +5918,7 @@ static int rpc_trustdom_vampire(int argc, const char **argv)
 	DOM_SID *domain_sids;
 	char **trusted_dom_names;
 	fstring pdc_name;
-	char *dummy;
+	const char *dummy;
 
 	/*
 	 * Listing trusted domains (stored in secrets.tdb, if local)
@@ -6057,7 +6058,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
 	DOM_SID *domain_sids;
 	char **trusted_dom_names;
 	fstring pdc_name;
-	char *dummy;
+	const char *dummy;
 	
 	/* trusting domains listing variables */
 	POLICY_HND domain_hnd;
diff --git a/source/utils/net_rpc_join.c b/source/utils/net_rpc_join.c
index 0c25a53..6e37f3c 100644
--- a/source/utils/net_rpc_join.c
+++ b/source/utils/net_rpc_join.c
@@ -155,7 +155,7 @@ int net_rpc_join_newstyle(int argc, const char **argv)
 
 	NTSTATUS result;
 	int retval = 1;
-	char *domain = NULL;
+	const char *domain = NULL;
 	uint32 num_rids, *name_types, *user_rids;
 	uint32 flags = 0x3e8;
 	char *acct_name;
@@ -413,7 +413,7 @@ int net_rpc_join_newstyle(int argc, const char **argv)
 
 	/* Now store the secret in the secrets database */
 
-	strupper_m(domain);
+	strupper_m(CONST_DISCARD(char *, domain));
 
 	if (!secrets_store_domain_sid(domain, domain_sid)) {
 		DEBUG(0, ("error storing domain sid for %s\n", domain));
diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c
index a9155a5..9082287 100644
--- a/source/winbindd/winbindd_cm.c
+++ b/source/winbindd/winbindd_cm.c
@@ -1799,9 +1799,9 @@ static void set_dc_type_and_flags_connect( struct winbindd_domain *domain )
 	struct rpc_pipe_client  *cli;
 	POLICY_HND pol;
 
-	char *domain_name = NULL;
-	char *dns_name = NULL;
-	char *forest_name = NULL;	
+	const char *domain_name = NULL;
+	const char *dns_name = NULL;
+	const char *forest_name = NULL;
 	DOM_SID *dom_sid = NULL;	
 
 	ZERO_STRUCT( ctr );


-- 
Samba Shared Repository


More information about the samba-cvs mailing list