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

Re: some bugs in netboot



Lo and Behold, Bernard Cassagne said:
> 
> 2/ in file main.c, the function build_cmdline() has the declaration
>    char *toks[strlen(input)];
>    this is incorrect since input can be NULL (it will be everytime the command
>    is simply a <progname> (no booting option, no argument to main)

  This was fixed internally in January.  The changes should be visible 
in the April snapshot we released.  But in any event, this bug has
been fixed, and we'll get a new snapshot out next week.

   The diff, btw, is:

	char *toks[input? strlen(input) : 0];

Index: main.c
===================================================================
RCS file: /n/fast/usr/lsrc/flux/CVS/oskit/boot/net/main.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- main.c      1999/01/14 22:48:58     1.31
+++ main.c      1999/01/20 23:19:04     1.32
@@ -68,7 +68,7 @@
 static char *
 build_cmdline(char *progname, char *default_args[NDEFAULT_ARGS], char *input)
 {
-       char *toks[strlen(input)];
+       char *toks[input? strlen(input) : 0];
        char *tok;
        int ntoks;
        int i;
@@ -78,8 +78,9 @@
 
        /* Tokenize their input. */
        ntoks = 0;
-       for (tok = strtok(input, " \t"); tok; tok = strtok(0, " \t"))
-               toks[ntoks++] = tok;
+       if (input)
+               for (tok = strtok(input, " \t"); tok; tok = strtok(0, " \t"))
+                       toks[ntoks++] = tok;
 
        /* Figure out if they specified a "--". */
        havesep = 0;

> 3/ in file main.c, in the function main(), the variable input is initialized
>    on entry :
>    char *input = buf;
>    It should be initialized at every iteration in the loop beginning with
>    the label reprompt: since input is moved at the begining of the <progname>
> 
>    I know the bug will show up in very rare events (in the case of plenty of
>    erroneous commands beginning with plenty of white spaces) but it
>    is there.

   Yup.  Fixed.  Out in the next snapshot.

> 4/ now something more serious.
>    netboot does not aswer ARP requests : it sends ARP requests and relies on
>    the fact that the server will update its arp table with the information
>    provided with the request of the client.

   I'm working on integrating Klaus' ARP patches right now.  I may or
may not get them in to next week's snapshot, but if not, I'll post a
diff relative to the snapshot.  (He submitted some other bugfixes and
such which we've also been working in to the dist. tree).

   Anyway, keep your eyes peeled for next week's snapshot.  It fixes a 
bunch o' these bugs.

  Thanks again,

  -Dave

-- 
work: danderse@cs.utah.edu                     me:  angio@pobox.com
      University of Utah CS Department         http://www.angio.net/
   "If you haul a geek up a crack, you will bloody their fingers for a day...
    If you teach a geek to climb, you will bloody their fingers for life."

References: