svn commit: samba r16803 - in trunk/source: libads libndr nsswitch smbd utils

vlendec at samba.org vlendec at samba.org
Tue Jul 4 18:24:37 GMT 2006


Author: vlendec
Date: 2006-07-04 18:24:36 +0000 (Tue, 04 Jul 2006)
New Revision: 16803

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16803

Log:
Fixes from IRIX, some C++ warnings
Modified:
   trunk/source/libads/sasl.c
   trunk/source/libndr/ndr_string.c
   trunk/source/nsswitch/winbindd_async.c
   trunk/source/nsswitch/winbindd_cache.c
   trunk/source/nsswitch/winbindd_rpc.c
   trunk/source/smbd/connection.c
   trunk/source/smbd/trans2.c
   trunk/source/utils/net.c
   trunk/source/utils/net_ads.c


Changeset:
Modified: trunk/source/libads/sasl.c
===================================================================
--- trunk/source/libads/sasl.c	2006-07-04 17:14:37 UTC (rev 16802)
+++ trunk/source/libads/sasl.c	2006-07-04 18:24:36 UTC (rev 16803)
@@ -278,7 +278,6 @@
 	uint8 *p;
 	uint32 max_msg_size;
 	char *sname;
-	unsigned sec_layer;
 	ADS_STATUS status;
 	krb5_principal principal;
 	krb5_context ctx = NULL;
@@ -391,7 +390,6 @@
 	file_save("sasl_gssapi.dat", output_token.value, output_token.length);
 #endif
 	max_msg_size = (p[1]<<16) | (p[2]<<8) | p[3];
-	sec_layer = *p;
 
 	gss_release_buffer(&minor_status, &output_token);
 

Modified: trunk/source/libndr/ndr_string.c
===================================================================
--- trunk/source/libndr/ndr_string.c	2006-07-04 17:14:37 UTC (rev 16802)
+++ trunk/source/libndr/ndr_string.c	2006-07-04 18:24:36 UTC (rev 16803)
@@ -31,7 +31,7 @@
 	uint32_t len1, ofs, len2;
 	uint16_t len3;
 	int ret;
-	int chset = CH_UCS2;
+	charset_t chset = CH_UCS2;
 	unsigned byte_mul = 2;
 	unsigned flags = ndr->flags;
 	unsigned c_len_term = 0;
@@ -282,7 +282,7 @@
 NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s)
 {
 	ssize_t s_len, c_len, d_len;
-	int chset = CH_UCS2;
+	charset_t chset = CH_UCS2;
 	unsigned flags = ndr->flags;
 	unsigned byte_mul = 2;
 	uint8_t *dest = NULL;
@@ -575,7 +575,8 @@
 	return NT_STATUS_OK;
 }
 
-NTSTATUS ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, uint32_t length, uint8_t byte_mul, int chset)
+NTSTATUS ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var,
+			  uint32_t length, uint8_t byte_mul, charset_t chset)
 {
 	ssize_t ret, required;
 

Modified: trunk/source/nsswitch/winbindd_async.c
===================================================================
--- trunk/source/nsswitch/winbindd_async.c	2006-07-04 17:14:37 UTC (rev 16802)
+++ trunk/source/nsswitch/winbindd_async.c	2006-07-04 18:24:36 UTC (rev 16803)
@@ -567,7 +567,8 @@
 	}
 
 	cont(private_data, True, response->data.name.dom_name,
-	     response->data.name.name, response->data.name.type);
+	     response->data.name.name,
+	     (enum SID_NAME_USE)response->data.name.type);
 }
 
 void winbindd_lookupsid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
@@ -659,7 +660,8 @@
 		return;
 	}
 
-	cont(private_data, True, &sid, response->data.sid.type);
+	cont(private_data, True, &sid,
+	     (enum SID_NAME_USE)response->data.sid.type);
 }
 
 void winbindd_lookupname_async(TALLOC_CTX *mem_ctx, const char *dom_name,

Modified: trunk/source/nsswitch/winbindd_cache.c
===================================================================
--- trunk/source/nsswitch/winbindd_cache.c	2006-07-04 17:14:37 UTC (rev 16802)
+++ trunk/source/nsswitch/winbindd_cache.c	2006-07-04 18:24:36 UTC (rev 16803)
@@ -223,8 +223,9 @@
 }
 
 /*
-  pull a time_t from a cache entry 
+  pull a time_t from a cache entry -- apparently unused 
 */
+#if 0 
 static time_t centry_time(struct cache_entry *centry)
 {
 	time_t ret;
@@ -237,6 +238,7 @@
 	centry->ofs += sizeof(time_t);
 	return ret;
 }
+#endif
 
 /* pull a string from a cache entry, using the supplied
    talloc context 
@@ -259,7 +261,7 @@
 		smb_panic("centry_string");
 	}
 
-	ret = TALLOC(mem_ctx, len+1);
+	ret = TALLOC_ARRAY(mem_ctx, char, len+1);
 	if (!ret) {
 		smb_panic("centry_string out of memory\n");
 	}
@@ -567,7 +569,8 @@
 	if (centry->len - centry->ofs >= len)
 		return;
 	centry->len *= 2;
-	centry->data = SMB_REALLOC(centry->data, centry->len);
+	centry->data = SMB_REALLOC_ARRAY(centry->data, unsigned char,
+					 centry->len);
 	if (!centry->data) {
 		DEBUG(0,("out of memory: needed %d bytes in centry_expand\n", centry->len));
 		smb_panic("out of memory in centry_expand");
@@ -840,7 +843,6 @@
 	struct winbind_cache *cache = get_cache(domain);
 	struct cache_entry *centry = NULL;
 	NTSTATUS status;
-	time_t t;
 	uint32 rid;
 
 	if (!cache->tdb) {
@@ -863,7 +865,6 @@
 		return NT_STATUS_OBJECT_NAME_NOT_FOUND;
 	}
 
-	t = centry_time(centry);
 	*cached_nt_pass = (const uint8 *)centry_string(centry, mem_ctx);
 
 #if DEBUG_PASSWORD
@@ -2035,7 +2036,7 @@
 
 	fstr_sprintf(key_str, "DR/%d", pid);
 	if (tdb_store(wcache->tdb, string_tdb_data(key_str), 
-		      make_tdb_data((void *)response, sizeof(*response)),
+		      make_tdb_data((const char *)response, sizeof(*response)),
 		      TDB_REPLACE) == -1)
 		return;
 
@@ -2049,7 +2050,7 @@
 
 	fstr_sprintf(key_str, "DE/%d", pid);
 	if (tdb_store(wcache->tdb, string_tdb_data(key_str),
-		      make_tdb_data(response->extra_data.data,
+		      make_tdb_data((const char *)response->extra_data.data,
 				    response->length - sizeof(*response)),
 		      TDB_REPLACE) == 0)
 		return;

Modified: trunk/source/nsswitch/winbindd_rpc.c
===================================================================
--- trunk/source/nsswitch/winbindd_rpc.c	2006-07-04 17:14:37 UTC (rev 16802)
+++ trunk/source/nsswitch/winbindd_rpc.c	2006-07-04 18:24:36 UTC (rev 16803)
@@ -824,7 +824,6 @@
 	NTSTATUS result;
 	POLICY_HND dom_pol;
 	BOOL got_seq_num = False;
-	int retry;
 	struct rpc_pipe_client *cli;
 
 	DEBUG(10,("rpc: fetch sequence_number for %s\n", domain->name));
@@ -834,8 +833,6 @@
 	if (!(mem_ctx = talloc_init("sequence_number[rpc]")))
 		return NT_STATUS_NO_MEMORY;
 
-	retry = 0;
-
 #ifdef HAVE_LDAP
 	if ( domain->native_mode ) 
 	{

Modified: trunk/source/smbd/connection.c
===================================================================
--- trunk/source/smbd/connection.c	2006-07-04 17:14:37 UTC (rev 16802)
+++ trunk/source/smbd/connection.c	2006-07-04 18:24:36 UTC (rev 16803)
@@ -356,5 +356,5 @@
 	
 done:
 	TALLOC_FREE( prec );
-	return True;
+	return ret;
 }

Modified: trunk/source/smbd/trans2.c
===================================================================
--- trunk/source/smbd/trans2.c	2006-07-04 17:14:37 UTC (rev 16802)
+++ trunk/source/smbd/trans2.c	2006-07-04 18:24:36 UTC (rev 16803)
@@ -4404,7 +4404,7 @@
 		case SMB_FILE_RENAME_INFORMATION:
 		{
 			BOOL overwrite;
-			uint32 root_fid;
+			/* uint32 root_fid; */  /* Not used */
 			uint32 len;
 			pstring newname;
 			pstring base_name;
@@ -4415,7 +4415,7 @@
 			}
 
 			overwrite = (CVAL(pdata,0) ? True : False);
-			root_fid = IVAL(pdata,4);
+			/* root_fid = IVAL(pdata,4); */
 			len = IVAL(pdata,8);
 			srvstr_get_path(inbuf, newname, &pdata[12], sizeof(newname), len, 0, &status);
 			if (!NT_STATUS_IS_OK(status)) {

Modified: trunk/source/utils/net.c
===================================================================
--- trunk/source/utils/net.c	2006-07-04 17:14:37 UTC (rev 16802)
+++ trunk/source/utils/net.c	2006-07-04 18:24:36 UTC (rev 16803)
@@ -77,6 +77,7 @@
 int opt_machine_pass = 0;
 BOOL opt_localgroup = False;
 BOOL opt_domaingroup = False;
+static BOOL do_talloc_report=False;
 const char *opt_newntname = "";
 int opt_rid = 0;
 int opt_acls = 0;
@@ -852,7 +853,6 @@
 	int argc_new = 0;
 	const char ** argv_new;
 	poptContext pc;
-	BOOL do_talloc_report=False;
 
 	struct poptOption long_options[] = {
 		{"help",	'h', POPT_ARG_NONE,   0, 'h'},

Modified: trunk/source/utils/net_ads.c
===================================================================
--- trunk/source/utils/net_ads.c	2006-07-04 17:14:37 UTC (rev 16802)
+++ trunk/source/utils/net_ads.c	2006-07-04 18:24:36 UTC (rev 16803)
@@ -506,7 +506,8 @@
 		return -1;
 	}
 	
-	grouplist = ldap_get_values(ads->ld, res, "memberOf");
+	grouplist = ldap_get_values((LDAP *)ads->ld,
+				    (LDAPMessage *)res, "memberOf");
 
 	if (grouplist) {
 		int i;
@@ -591,7 +592,7 @@
 					  shortattrs, usergrp_display, 
 					  disp_fields);
 		ads_destroy(&ads);
-		return 0;
+		return ADS_ERR_OK(rc) ? 0 : -1;
 	}
 
 	return net_run_function(argc, argv, func, net_ads_user_usage);
@@ -716,7 +717,7 @@
 					  disp_fields);
 
 		ads_destroy(&ads);
-		return 0;
+		return ADS_ERR_OK(rc) ? 0 : -1;
 	}
 	return net_run_function(argc, argv, func, net_ads_group_usage);
 }
@@ -1340,7 +1341,7 @@
 		return -1;
 	}
 
-	srv_dn = ldap_get_dn(ads->ld, res);
+	srv_dn = ldap_get_dn((LDAP *)ads->ld, (LDAPMessage *)res);
 	srv_cn = ldap_explode_dn(srv_dn, 1);
 
 	asprintf(&prt_dn, "cn=%s-%s,%s", srv_cn[0], printername, srv_dn);



More information about the samba-cvs mailing list