Subject: pkg/36186: net/freeradius cannot be compiled on Solaris 10
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <naoto@morishima.net>
List: pkgsrc-bugs
Date: 04/21/2007 11:50:00
>Number:         36186
>Category:       pkg
>Synopsis:       net/freeradius cannot be compiled on Solaris 10
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 21 11:50:00 +0000 2007
>Originator:     Naoto Morishima
>Release:        NetBSD 3.1_STABLE
>Organization:
>Environment:
SunOS XXX 5.8 Generic_117350-46 sun4u sparc SUNW,Sun-Fire-V210

>Description:
There seem to be several problems at compiling freeradius on Solaris.  At least src/modules/rlm_preprocess/rlm_preprocess.c needs a patch to add some casts to strvalue. 

>How-To-Repeat:
Compile net/freeradius on Solaris 10 with PKGSRC_COMPILER=sunpro.
>Fix:
Following patch will resolve one of these problems... (but we still cannot compile it).

--- src/modules/rlm_preprocess/rlm_preprocess.c.orig	2007-04-21 10:13:32.445189000 +0900
+++ src/modules/rlm_preprocess/rlm_preprocess.c	2007-04-21 10:13:34.105233000 +0900
@@ -126,7 +126,7 @@
 		/*
 		 *  No weird packing.  Ignore it.
 		 */
-		ptr = strchr(vp->strvalue, '='); /* find an '=' */
+		ptr = strchr((char *)vp->strvalue, '='); /* find an '=' */
 		if (!ptr) continue;
 
 		/*
@@ -144,7 +144,7 @@
 			char *p;
 			DICT_ATTR	*dattr;
 
-			p = vp->strvalue;
+			p = (char *)vp->strvalue;
 			gettoken(&p, newattr, sizeof(newattr));
 
 			if (((dattr = dict_attrbyname(newattr)) != NULL) &&
@@ -223,10 +223,10 @@
 		 *
 		 *	FIXME: should we handle this as a REALM ?
 		 */
-		if ((ptr = strchr(namepair->strvalue, '\\')) != NULL) {
+		if ((ptr = strchr((char *)namepair->strvalue, '\\')) != NULL) {
 			strNcpy(newname, ptr + 1, sizeof(newname));
 			/* Same size */
-			strcpy(namepair->strvalue, newname);
+			strcpy((char *)namepair->strvalue, newname);
 			namepair->length = strlen(newname);
 		}
 	}
@@ -395,9 +395,9 @@
 					break;
 				}
 
-				strNcpy(vp->strvalue, i->name,
+				strNcpy((char *)vp->strvalue, i->name,
 					sizeof(vp->strvalue));
-				vp->length = strlen(vp->strvalue);
+				vp->length = strlen((char *)vp->strvalue);
 
 				pairadd(&request_pairs, vp);
 			}
@@ -425,7 +425,7 @@
 			return -1;
 		}
 		nas->lvalue = request->packet->src_ipaddr;
-		ip_hostname(nas->strvalue, sizeof(nas->strvalue), nas->lvalue);
+		ip_hostname((char *)nas->strvalue, sizeof(nas->strvalue), nas->lvalue);
 		pairadd(&request->packet->vps, nas);
 	}
 
@@ -446,7 +446,7 @@
 	  return -1;
 	}
 	nas->lvalue = request->packet->src_ipaddr;
-	ip_hostname(nas->strvalue, sizeof(nas->strvalue), nas->lvalue);
+	ip_hostname((char *)nas->strvalue, sizeof(nas->strvalue), nas->lvalue);
 	pairadd(&request->packet->vps, nas);
 	return 0;
 }
@@ -580,7 +580,7 @@
 	if ((r = huntgroup_access(request, data->huntgroups,
 			     request->packet->vps)) != RLM_MODULE_OK) {
 		radlog(L_AUTH, "No huntgroup access: [%s] (%s)",
-		       request->username ? request->username->strvalue : "<No User-Name>",
+		       request->username ? (char *)request->username->strvalue : "<No User-Name>",
 		       auth_name(buf, sizeof(buf), request, 1));
 		return r;
 	}