Re: Gnu radius will not run on a fresh install of fedora 10

Sergey Poznyakoff <[email protected]> Fri, 12 Dec 2008 21:08:12 +0200
Newsgroups gmane.comp.gnu.radius.bugs
Organization GNU.org.ua
Message-ID <[email protected]>
--1804289383-1229108892=:3845
Content-ID: <[email protected]>
Content-Type: text/plain

Jerry <[email protected]> ha escrit:

> I've tried it on fedora 7 without a problem, but there's something with
> gnu radius that I cannot get it to run at all even though it compiles. 

Please try the attached patch.

Regards,
Sergey


--1804289383-1229108892=:3845
Content-transfer-encoding: quoted-printable
Content-Description: 
Content-ID: <[email protected]>
Content-Type: text/x-c; name="radius-1.6.patch-1.diff"

diff --git a/lib/numtostr.c b/lib/numtostr.c
index 97ce981..a319c78 100644
--- a/lib/numtostr.c
+++ b/lib/numtostr.c
@@ -32,8 +32,6 @@ numtostr (inttype i, char *buf, size_t size)
 	char *p =3D ibuf + sizeof ibuf;
 	size_t s;
 	=

-	*p =3D 0;
-
 	if (i < 0) {
 		do
 			*--p =3D '0' - i % 10;
diff --git a/radiusd/rewrite.y b/radiusd/rewrite.y
index e77dc98..34f0926 100644
--- a/radiusd/rewrite.y
+++ b/radiusd/rewrite.y
@@ -661,6 +661,7 @@ static int rw_error_free(char *msg);
 #define rw_code_unlock()
 =

 #define AVPLIST(m) ((m)->req ? (m)->req->avlist : NULL)
+
 %}
 =

 =0C
@@ -729,18 +730,15 @@ input   : dcllist
 	  }
         | expr
           {
-		  FUNCTION fmain;
-
                   if (errcnt) {
                           YYERROR;
                   }
 		  =

 		  mtx_return($1);
-                  =

-		  memset(&fmain, 0, sizeof(fmain));
-		  fmain.name =3D "main";
-		  fmain.rettype =3D return_type =3D $1->gen.datatype;
-		  function =3D &fmain;
+
+		  function =3D grad_emalloc(sizeof(*function));
+		  function->name =3D "main";
+		  function->rettype =3D return_type =3D $1->gen.datatype;
 =

                   if (optimize() =3D=3D 0) {
                           codegen();
@@ -2071,6 +2069,7 @@ _list_insert(RWLIST **first, RWLIST **last, RWLIST *pr=
ev, RWLIST *obj,
 RWLIST *
 _list_remove(RWLIST **first, RWLIST **last, RWLIST *obj)
 {
+	RWLIST *p =3D obj;
         RWLIST *temp;
 =

         if (temp =3D obj->prev) =

@@ -2080,10 +2079,10 @@ _list_remove(RWLIST **first, RWLIST **last, RWLIST *=
obj)
 =

         if (temp =3D obj->next)
                 temp->prev =3D obj->prev;
-        else if (last)
+        else =

                 *last =3D obj->prev;
 =

-        obj->prev =3D obj->next =3D NULL;
+        p->prev =3D p->next =3D NULL;
         =

         return obj;
 }
@@ -5959,6 +5958,7 @@ rewrite_compile(char *expr)
 		}
 		function->name =3D name;
 		function_install(function);
+		grad_free(function);
 	}
 	return name;
 }

--1804289383-1229108892=:3845
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bug-gnu-radius mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnu-radius

--1804289383-1229108892=:3845--