[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [d-i][patch] patch against netcfg



* Tollef Fog Heen <tollef@add.no> [2002-06-26 10:21]:
> * thomas poindessous 
> 
> | I did a patch against netcfg.
> | It does :
> | - compile against libdebian-installer (I didn't add a dependancie against
> | it. And you must remove utils.*)
> 
> thanks, that part of it is applied.

I attached a second patch which contains some fixes you didn't applied.
It fixes : 
- length of buffer for command. the length of the command for GNU is
greater than 128. Example:
settrans -fg /servers/socket/2 /hurd/pfinet --interface=eth0 --address=127.127.127.127
--netmask=255.255.255.221 --gateway=127.127.127.128

139 chars (without '\0').

- there is a missing ',' in a line
 
> | - correct some errors
> | 
> | I remove some '\0' affectations (?), because di_snprintfcat adds it.
> 
> no, it doesn't, at leastI couldn't find documentation which supports
> your statement (nor anything which contradicts it -- I am rather safe
> than sorry, so until you can give me a pointer to some docs saying
> that you are right, I will keep them there).

I did some tests before sending you this patch, it worked with adding
'\0'. It works because di_snprintfcat use vsnprintf which adds '\0'. But, I
will send you a test to be sure.

Thanks.
Index: netcfg-static.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/tools/netcfg/netcfg-static.c,v
retrieving revision 1.14
diff -u -r1.14 netcfg-static.c
--- netcfg-static.c	2002/06/25 19:29:37	1.14
+++ netcfg-static.c	2002/06/26 08:58:18
@@ -153,7 +153,7 @@
 netcfg_activate_static ()
 {
   int rv = 0;
-  char buf[128];
+  char buf[150];
 #ifdef __GNU__
 /* I had to do something like this ? */
 /*  di_execlog ("settrans /servers/socket/2 -fg");  */
@@ -161,7 +161,7 @@
   snprintf (buf, sizeof (buf),
 	    "settrans -fg /servers/socket/2 /hurd/pfinet --interface=%s --address=%s",
 	    interface, num2dot (ipaddress));
-  di_snprintfcat (buf, sizeof (buf) " --netmask=%s", num2dot (netmask));
+  di_snprintfcat (buf, sizeof (buf), " --netmask=%s", num2dot (netmask));
   buf[sizeof (buf) - 1] = '\0';
 
   if (gateway)

Reply to: