svn commit: trunk/busybox/libbb

Rob Landley rob at landley.net
Mon Feb 20 18:44:30 UTC 2006


On Monday 20 February 2006 11:51 am, Vladimir N. Oleynik wrote:
> landley at busybox.net wrote:
> > Log:
> > getdomainname() isn't guaranteed to null terminate the string if it was
> > truncated for length.  SVN 14135 made sure that the truncated version
> > would always be null terminated.  SVN 14144 broke this for no readily
> > apparent reason, and I have no idea what it was even trying to
> > accomplish.  Reverted.
>
> Why reverted?
> My changes for gethostname():
>
> 1) full right for me
> 1) synsed with upstream.
>
> Also. 256 legnt is maximal hostname (domainname) lenght from RFC.

1) The previous checkin you replaced was fine.  You gave no explanation why 
you modified it.

2) There is no "upstream" for a libbb file.  There is no reason to "sync" with 
anything.  Each change either makes sense on its own merits or it doesn't go 
in.

3) Here is a hunk of the patch you checked in, which I reverted:

@@ -95,8 +95,8 @@
                                 break;

                         case 'h':
+                                buf[0] = '\0';
                                 gethostname(buf, sizeof(buf) - 1);
-                                buf[sizeof(buf) - 1] = '\0';
                                 break;

                         case 'l':

The previous fix made sure that the buffer ended with a null, whether or not 
gethostname() had put a null at the end (due to size limits).

You set the first character of the buffer to null before calling gethostname 
(which gethostname() will overwrite when it's called) and removed the line 
ensuring that the returned value was always null terminated.

You did not explain why the previous fix was insufficient, and your "fix" was 
clearly BROKEN.

That is why I reverted it.  I've reverted more than one of your checkins in 
the past 24 hours.  I reverted the #undef strlen becuase it was causing 
numerous apps to hang and despite people complaining about this on the list 
you didn't fix it for days.

If your response to having your changes reverted continues to be to make 
another checkin each time, without stopping to ask WHY I objected, then your 
future changes won't be in any of the releases I cut.

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list