compile failure

Kevin Steves stevesk at pobox.com
Tue Mar 26 07:14:54 EST 2002


On Mon, 25 Mar 2002, Tom Holroyd wrote:
:> monitor_mm.h:28:22: sys/tree.h: No such file or directory
:
:OK, I got tree.h (thanks Denis), and there are a few additional
:warnings:
:
:auth-rsa.c: In function `auth_rsa_key_allowed':
:auth-rsa.c:168: warning: return makes integer from pointer without a cast
:auth-rsa.c:176: warning: return makes integer from pointer without a cast
:auth-rsa.c:184: warning: return makes integer from pointer without a cast
:
:auth_rsa_key_allowed() is returning NULL instead of 0.
:
:monitor_mm.c: In function `mm_make_entry':
:monitor_mm.c:60: warning: int format, different type arg (arg 5)
:monitor_mm.c: In function `mm_create':
:monitor_mm.c:88: warning: int format, different type arg (arg 2)
:monitor_mm.c: In function `mm_destroy':
:monitor_mm.c:127: warning: int format, different type arg (arg 3)
:monitor_mm.c: In function `mm_xmalloc':
:monitor_mm.c:141: warning: int format, different type arg (arg 3)
:monitor_mm.c: In function `mm_free':
:monitor_mm.c:227: warning: int format, different type arg (arg 3)
:monitor_mm.c:250: warning: int format, different type arg (arg 4)
:
:These are mostly sizeof(int) == 4, sizeof(long) == 8 bugs.
:
:Other than that it works fine now (+ SRP).

did you try with sshd -oUsePrivilegeSeparation=yes?

the following patch was commited:

Index: monitor_mm.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/monitor_mm.c,v
retrieving revision 1.3
diff -u -1 -0 -r1.3 monitor_mm.c
--- monitor_mm.c	19 Mar 2002 10:41:32 -0000	1.3
+++ monitor_mm.c	25 Mar 2002 20:00:24 -0000
@@ -49,22 +49,22 @@

 	if (mm->mmalloc == NULL)
 		tmp = xmalloc(sizeof(struct mm_share));
 	else
 		tmp = mm_xmalloc(mm->mmalloc, sizeof(struct mm_share));
 	tmp->address = address;
 	tmp->size = size;

 	tmp2 = RB_INSERT(mmtree, head, tmp);
 	if (tmp2 != NULL)
-		fatal("mm_make_entry(%p): double address %p->%p(%d)",
-		    mm, tmp2, address, size);
+		fatal("mm_make_entry(%p): double address %p->%p(%lu)",
+		    mm, tmp2, address, (u_long)size);

 	return (tmp);
 }

 /* Creates a shared memory area of a certain size */

 struct mm_master *
 mm_create(struct mm_master *mmalloc, size_t size)
 {
 	void *address;
@@ -78,21 +78,21 @@
 	/*
 	 * If the memory map has a mm_master it can be completely
 	 * shared including authentication between the child
 	 * and the client.
 	 */
 	mm->mmalloc = mmalloc;

 	address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED,
 	    -1, 0);
 	if (address == MAP_FAILED)
-		fatal("mmap(%d)", size);
+		fatal("mmap(%lu)", (u_long)size);

 	mm->address = address;
 	mm->size = size;

 	RB_INIT(&mm->rb_free);
 	RB_INIT(&mm->rb_allocated);

 	mm_make_entry(mm, &mm->rb_free, address, size);

 	return (mm);
@@ -117,35 +117,35 @@

 /* Destroys a memory mapped area */

 void
 mm_destroy(struct mm_master *mm)
 {
 	mm_freelist(mm->mmalloc, &mm->rb_free);
 	mm_freelist(mm->mmalloc, &mm->rb_allocated);

 	if (munmap(mm->address, mm->size) == -1)
-		fatal("munmap(%p, %d)", mm->address, mm->size);
+		fatal("munmap(%p, %lu)", mm->address, (u_long)mm->size);
 	if (mm->mmalloc == NULL)
 		xfree(mm);
 	else
 		mm_free(mm->mmalloc, mm);
 }

 void *
 mm_xmalloc(struct mm_master *mm, size_t size)
 {
 	void *address;

 	address = mm_malloc(mm, size);
 	if (address == NULL)
-		fatal("%s: mm_malloc(%d)", __FUNCTION__, size);
+		fatal("%s: mm_malloc(%lu)", __FUNCTION__, (u_long)size);
 	return (address);
 }


 /* Allocates data from a memory mapped area */

 void *
 mm_malloc(struct mm_master *mm, size_t size)
 {
 	struct mm_share *mms, *tmp;
@@ -216,22 +216,22 @@
 		else {
 			while (RB_PARENT(prev, next) &&
 			    (prev == RB_LEFT(RB_PARENT(prev, next), next)))
 				prev = RB_PARENT(prev, next);
 			prev = RB_PARENT(prev, next);
 		}
 	}

 	/* Check if range does not overlap */
 	if (prev != NULL && MM_ADDRESS_END(prev) > address)
-		fatal("mm_free: memory corruption: %p(%d) > %p",
-		    prev->address, prev->size, address);
+		fatal("mm_free: memory corruption: %p(%lu) > %p",
+		    prev->address, (u_long)prev->size, address);

 	/* See if we can merge backwards */
 	if (prev != NULL && MM_ADDRESS_END(prev) == address) {
 		prev->size += mms->size;
 		RB_REMOVE(mmtree, &mm->rb_free, mms);
 		if (mm->mmalloc == NULL)
 			xfree(mms);
 		else
 			mm_free(mm->mmalloc, mms);
 	} else
@@ -239,22 +239,22 @@

 	if (prev == NULL)
 		return;

 	/* Check if we can merge forwards */
 	mms = RB_NEXT(mmtree, &mm->rb_free, prev);
 	if (mms == NULL)
 		return;

 	if (MM_ADDRESS_END(prev) > mms->address)
-		fatal("mm_free: memory corruption: %p < %p(%d)",
-		    mms->address, prev->address, prev->size);
+		fatal("mm_free: memory corruption: %p < %p(%lu)",
+		    mms->address, prev->address, (u_long)prev->size);
 	if (MM_ADDRESS_END(prev) != mms->address)
 		return;

 	prev->size += mms->size;
 	RB_REMOVE(mmtree, &mm->rb_free, mms);

 	if (mm->mmalloc == NULL)
 		xfree(mms);
 	else
 		mm_free(mm->mmalloc, mms);
Index: monitor_wrap.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/monitor_wrap.c,v
retrieving revision 1.4
diff -u -1 -0 -r1.4 monitor_wrap.c
--- monitor_wrap.c	19 Mar 2002 14:27:39 -0000	1.4
+++ monitor_wrap.c	25 Mar 2002 20:00:27 -0000
@@ -81,30 +81,30 @@
 	u_char buf[4];
 	ssize_t res;
 	u_int msg_len;

 	debug3("%s entering", __FUNCTION__);

 	res = atomicio(read, socket, buf, sizeof(buf));
 	if (res != sizeof(buf)) {
 		if (res == 0)
 			fatal_cleanup();
-		fatal("%s: read: %d", __FUNCTION__, res);
+		fatal("%s: read: %ld", __FUNCTION__, (long)res);
 	}
 	msg_len = GET_32BIT(buf);
 	if (msg_len > 256 * 1024)
 		fatal("%s: read: bad msg_len %d", __FUNCTION__, msg_len);
 	buffer_clear(m);
 	buffer_append_space(m, msg_len);
 	res = atomicio(read, socket, buffer_ptr(m), msg_len);
 	if (res != msg_len)
-		fatal("%s: read: %d != msg_len", __FUNCTION__, res);
+		fatal("%s: read: %ld != msg_len", __FUNCTION__, (long)res);
 }

 void
 mm_request_receive_expect(int socket, enum monitor_reqtype type, Buffer *m)
 {
 	u_char rtype;

 	debug3("%s entering: type %d", __FUNCTION__, type);

 	mm_request_receive(socket, m);




More information about the openssh-unix-dev mailing list