svn commit: samba r3322 - in branches/SAMBA_4_0/source: lib libcli/auth libcli/raw libcli/util librpc/idl librpc/ndr librpc/rpc

tridge at samba.org tridge at samba.org
Thu Oct 28 12:46:59 GMT 2004


Author: tridge
Date: 2004-10-28 12:46:59 +0000 (Thu, 28 Oct 2004)
New Revision: 3322

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3322&nolog=1

Log:
fixed a bunch of warnings in the build, including one case where it was a real bug

Modified:
   branches/SAMBA_4_0/source/lib/iconv.c
   branches/SAMBA_4_0/source/libcli/auth/clikrb5.c
   branches/SAMBA_4_0/source/libcli/auth/ntlmssp_parse.c
   branches/SAMBA_4_0/source/libcli/auth/spnego.c
   branches/SAMBA_4_0/source/libcli/auth/spnego.h
   branches/SAMBA_4_0/source/libcli/raw/rawrequest.c
   branches/SAMBA_4_0/source/libcli/raw/rawsearch.c
   branches/SAMBA_4_0/source/libcli/util/asn1.c
   branches/SAMBA_4_0/source/librpc/idl/epmapper.idl
   branches/SAMBA_4_0/source/librpc/ndr/ndr.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/iconv.c
===================================================================
--- branches/SAMBA_4_0/source/lib/iconv.c	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/lib/iconv.c	2004-10-28 12:46:59 UTC (rev 3322)
@@ -131,7 +131,6 @@
 		 char **outbuf, size_t *outbytesleft)
 {
 	char cvtbuf[2048];
-	char *bufp = cvtbuf;
 	size_t bufsize;
 
 	/* in many cases we can go direct */
@@ -143,18 +142,19 @@
 
 	/* otherwise we have to do it chunks at a time */
 	while (*inbytesleft > 0) {
-		bufp = cvtbuf;
+		char *bufp1 = cvtbuf;
+		const char *bufp2 = cvtbuf;
+
 		bufsize = sizeof(cvtbuf);
 		
 		if (cd->pull(cd->cd_pull, 
-			     inbuf, inbytesleft, &bufp, &bufsize) == -1
+			     inbuf, inbytesleft, &bufp1, &bufsize) == -1
 		    && errno != E2BIG) return -1;
 
-		bufp = cvtbuf;
 		bufsize = sizeof(cvtbuf) - bufsize;
 
 		if (cd->push(cd->cd_push, 
-			     &bufp, &bufsize, 
+			     &bufp2, &bufsize, 
 			     outbuf, outbytesleft) == -1) return -1;
 	}
 

Modified: branches/SAMBA_4_0/source/libcli/auth/clikrb5.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/auth/clikrb5.c	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/libcli/auth/clikrb5.c	2004-10-28 12:46:59 UTC (rev 3322)
@@ -386,7 +386,7 @@
 {
 	static krb5_data kdata;
 
-	kdata.data = krb5_principal_get_comp_string(context, principal, i);
+	kdata.data = discard_const(krb5_principal_get_comp_string(context, principal, i));
 	kdata.length = strlen(kdata.data);
 	return &kdata;
 }

Modified: branches/SAMBA_4_0/source/libcli/auth/ntlmssp_parse.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/auth/ntlmssp_parse.c	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/libcli/auth/ntlmssp_parse.c	2004-10-28 12:46:59 UTC (rev 3322)
@@ -64,7 +64,7 @@
 		case 'U':
 			s = va_arg(ap, char *);
 			head_size += 8;
-			n = push_ucs2_talloc(pointers, &pointers[i].data, s);
+			n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s);
 			if (n == -1) {
 				return False;
 			}
@@ -87,7 +87,7 @@
 			n = va_arg(ap, int);
 			intargs[i] = n;
 			s = va_arg(ap, char *);
-			n = push_ucs2_talloc(pointers, &pointers[i].data, s);
+			n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s);
 			if (n == -1) {
 				return False;
 			}

Modified: branches/SAMBA_4_0/source/libcli/auth/spnego.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/auth/spnego.c	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/libcli/auth/spnego.c	2004-10-28 12:46:59 UTC (rev 3322)
@@ -483,7 +483,7 @@
 	{
 		/* The server offers a list of mechanisms */
 		
-		char *my_mechs[] = {NULL, NULL};
+		const char *my_mechs[] = {NULL, NULL};
 		NTSTATUS nt_status = NT_STATUS_INVALID_PARAMETER;
 
 		if (!in.length) {

Modified: branches/SAMBA_4_0/source/libcli/auth/spnego.h
===================================================================
--- branches/SAMBA_4_0/source/libcli/auth/spnego.h	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/libcli/auth/spnego.h	2004-10-28 12:46:59 UTC (rev 3322)
@@ -41,7 +41,7 @@
 };
 
 struct spnego_negTokenInit {
-	char **mechTypes;
+	const char **mechTypes;
 	int reqFlags;
 	DATA_BLOB mechToken;
 	DATA_BLOB mechListMIC;

Modified: branches/SAMBA_4_0/source/libcli/raw/rawrequest.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/rawrequest.c	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/libcli/raw/rawrequest.c	2004-10-28 12:46:59 UTC (rev 3322)
@@ -548,7 +548,7 @@
   of bytes consumed in the packet is returned
 */
 size_t smbcli_req_pull_ascii(struct smbcli_request *req, TALLOC_CTX *mem_ctx,
-			  char **dest, const char *src, int byte_len, uint_t flags)
+			     char **dest, const char *src, int byte_len, uint_t flags)
 {
 	int src_len, src_len2;
 	ssize_t ret;

Modified: branches/SAMBA_4_0/source/libcli/raw/rawsearch.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/rawsearch.c	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/libcli/raw/rawsearch.c	2004-10-28 12:46:59 UTC (rev 3322)
@@ -42,6 +42,8 @@
 	p = req->in.data + 3;
 
 	for (i=0; i < count; i++) {
+		char *name;
+
 		search_data.search.id.reserved      = CVAL(p, 0);
 		memcpy(search_data.search.id.name,    p+1, 11);
 		search_data.search.id.handle        = CVAL(p, 12);
@@ -51,7 +53,8 @@
 		search_data.search.write_time       = raw_pull_dos_date(req->transport,
 									p + 22);
 		search_data.search.size             = IVAL(p, 26);
-		smbcli_req_pull_ascii(req, mem_ctx, &search_data.search.name, p+30, 13, STR_ASCII);
+		smbcli_req_pull_ascii(req, mem_ctx, &name, p+30, 13, STR_ASCII);
+		search_data.search.name = name;
 		if (!callback(private, &search_data)) {
 			break;
 		}

Modified: branches/SAMBA_4_0/source/libcli/util/asn1.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/util/asn1.c	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/libcli/util/asn1.c	2004-10-28 12:46:59 UTC (rev 3322)
@@ -494,7 +494,7 @@
 }
 
 /* read an object ID from a ASN1 buffer */
-BOOL asn1_read_OID(ASN1_DATA *data, char **OID)
+BOOL asn1_read_OID(ASN1_DATA *data, const char **OID)
 {
 	uint8_t b;
 	char *tmp_oid = NULL;
@@ -525,7 +525,7 @@
 /* check that the next object ID is correct */
 BOOL asn1_check_OID(ASN1_DATA *data, const char *OID)
 {
-	char *id;
+	const char *id;
 
 	if (!asn1_read_OID(data, &id)) return False;
 

Modified: branches/SAMBA_4_0/source/librpc/idl/epmapper.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/epmapper.idl	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/librpc/idl/epmapper.idl	2004-10-28 12:46:59 UTC (rev 3322)
@@ -222,12 +222,12 @@
 	   non-aligned. I wonder what sort of wicked substance these
 	   guys were smoking?
 	*/
-	typedef [flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN)] struct {
+	typedef [gensize,flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN)] struct {
 		uint16 num_floors;
 		epm_floor floors[num_floors];
 	} epm_tower;
 
-	typedef [gensize] struct {
+	typedef struct {
 		[value(ndr_size_epm_tower(0, &r->tower,ndr->flags))] uint32  tower_length;
 		[subcontext(4)] epm_tower tower;
 	} epm_twr_t;

Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/ndr/ndr.c	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c	2004-10-28 12:46:59 UTC (rev 3322)
@@ -390,6 +390,8 @@
 		return NT_STATUS_BUFFER_TOO_SMALL;
 	case NDR_ERR_ALLOC:
 		return NT_STATUS_NO_MEMORY;
+	default:
+		break;
 	}
 
 	/* we should all error codes to different status codes */

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c	2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c	2004-10-28 12:46:59 UTC (rev 3322)
@@ -394,7 +394,7 @@
 	io.ntcreatex.in.security_flags = 0;
 	io.ntcreatex.in.fname = pipe_name;
 
-	status = smb_raw_open(tree, pipe_name, &io);
+	status = smb_raw_open(tree, tree, &io);
 
 	if (!NT_STATUS_IS_OK(status)) {
                 return status;



More information about the samba-cvs mailing list