Fix AHCI on SUNXI

2014-11-24 Thread Edwin Amsler
Here are the changes needed to make SATA drives available on the Cubieboard A10. It consists of a DMA workaround and fiddling with some register assignments. I’ve successfully built the RAMDISK kernel via an external drive using this driver patch, so it’s been through what I’m hoping is a valid

Re: httpd: don't send error body with HEAD method

2014-11-24 Thread Bertrand Janin
Philip Guenther wrote : > On Mon, Nov 24, 2014 at 11:24 AM, Florian Obser wrote: > ... > > Since we are probably not supposed to send a "Content-Type" header I > > think it makes sense to duplicate the httpmsg generating code in this > > case; > > If a GET of that resource would have a Content-Ty

Re: IFXF_NOINET doesn't make sense any more

2014-11-24 Thread Chris Cappuccio
Henning Brauer [hb-openbsdt...@ml.bsws.de] wrote: > now that we have an uncontaminated, err, inet6-free system by default, > IFXF_NOINET6 just doesn't make sense any more. > fully go for no inet6 by default, get rid of the IFXF_NOINET6 guarded > attachments etc. > introduce IFAFATTACH and IFAFDETAC

Re: Mail: fix handling of -f flag

2014-11-24 Thread Todd C. Miller
On Mon, 24 Nov 2014 18:14:37 +0001, Jason McIntyre wrote: > the thing is, it still looks a bit odd. because you cannot specify > "file" without -f, right? (i'm supposing that - ignore my text > otherwise.) so even if technically -f does not accept an > argument, the logical connection is there. Y

Re: crypt_newhash

2014-11-24 Thread Ted Unangst
On Sun, Nov 23, 2014 at 01:42, Jonas 'Sortie' Termansen wrote: > > This can be easily solved if crypt_checkpass checks the hash doesn't start > with > '$' and then calls the utility crypt_hashpass directly (will need to be > visible > from outside its current translation unit), and storing the temp

Re: httpd: don't send error body with HEAD method

2014-11-24 Thread Philip Guenther
On Mon, Nov 24, 2014 at 11:24 AM, Florian Obser wrote: ... > Since we are probably not supposed to send a "Content-Type" header I > think it makes sense to duplicate the httpmsg generating code in this > case; If a GET of that resource would have a Content-Type, then the HEAD of it should have on

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-24 Thread Tobias Stoeckmann
On Mon, Nov 24, 2014 at 08:37:47PM +0100, Nicolas Bedos wrote: > In locate.code.c 'mbuf' is never free()d: it is only allocated for the > last line of input and after processing this line the program ends. I > hope it is ok. I would free() it nontheless outside the while loop. For the sake of fas

Re: httpd: don't send error body with HEAD method

2014-11-24 Thread Bertrand Janin
Florian Obser wrote : > On Sun, Nov 23, 2014 at 08:15:47PM -0500, Bertrand Janin wrote: > > Hi, > > > > This patch updates server_abort_http() to only send the body of default http > > error if the method is not HEAD. I first noticed that with curl -v -I which > > complains about the excess data:

Re: tcpdump: Ethernet header is not dumped with -xX if IP header is unaligned

2014-11-24 Thread Mike Belopuhov
On Nov 24, 2014 7:10 PM, "Mike Belopuhov" wrote: > > Hi, > > IP header is not always aligned since bpf copies out the mbuf > chain into the contigous buffer provided by the userland. I've > seen this with large packet sizes on VLANs. ip_print will then > copy the packet but the Ethernet header i

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-24 Thread Nicolas Bedos
Tobias Stoeckmann wrote: > I would recommend using fgetln for the actual line parsing. Then this > kinda fragile code can be avoided (fragile: fgets and its users have a > hard time to properly handle '\0' chars inside a file). Thank you for the advice. Here is an updated diff. It does indeed loo

Re: patch: make ed's 'l' command more posixly correct

2014-11-24 Thread Theo de Raadt
> Seems like, Theo was ok with this over in misc@. > > First patch (utterly trivial) am I doing this right? I wasn't ok with your change at all. Your process seems to be "I don't understand the problem, so here is a diff" > --- /usr/src/bin/ed/io.c Wed Nov 12 08:50:07 2014 > +++ /home/ben

Re: httpd: don't send error body with HEAD method

2014-11-24 Thread Florian Obser
On Sun, Nov 23, 2014 at 08:15:47PM -0500, Bertrand Janin wrote: > Hi, > > This patch updates server_abort_http() to only send the body of default http > error if the method is not HEAD. I first noticed that with curl -v -I which > complains about the excess data: > > * Excess found in a non p

patch: make ed's 'l' command more posixly correct

2014-11-24 Thread Benjamin Scher Purcell
Seems like, Theo was ok with this over in misc@. First patch (utterly trivial) am I doing this right? --- /usr/src/bin/ed/io.cWed Nov 12 08:50:07 2014 +++ /home/ben/src/io.c Sun Nov 23 19:47:02 2014 @@ -336,10 +336,8 @@ } else putchar(*s);

Re: patch: correct double-free in dc(1)

2014-11-24 Thread Sébastien Marie
On Mon, Nov 24, 2014 at 05:59:20PM +0100, Otto Moerbeek wrote: > On Mon, Nov 24, 2014 at 01:38:40PM +0100, S??bastien Marie wrote: > > > Hi, > > > > Starting to play with afl-fuzz, I test it with dc(1), and it found a "Bus > > error". > > > > Actually, with this, the init in stack_grow can be l

Re: Mail: fix handling of -f flag

2014-11-24 Thread Jason McIntyre
On Mon, Nov 24, 2014 at 09:56:33AM -0700, Todd C. Miller wrote: > The handling of the argument to the -f option is a hack. > > Currently, this works: > > $ mail -f mbox2 > > But this does not: > > $ mail -fmbox2 > > Instead of fooling around with argv behind getopt()'s back we can > ju

tcpdump: Ethernet header is not dumped with -xX if IP header is unaligned

2014-11-24 Thread Mike Belopuhov
Hi, IP header is not always aligned since bpf copies out the mbuf chain into the contigous buffer provided by the userland. I've seen this with large packet sizes on VLANs. ip_print will then copy the packet but the Ethernet header into the internal buffer so that it can cast it to the IP header

paste: release file descriptors earlier

2014-11-24 Thread Tobias Stoeckmann
Hi, the function parallel() should release file descriptors just like sequential() does: If we reach EOF, close it -- except we were reading stdin. Tobias Index: paste.c === RCS file: /cvs/src/usr.bin/paste/paste.c,v retrieving re

Re: Trimming tcpdump a bit

2014-11-24 Thread Mike Belopuhov
On 24 November 2014 at 16:42, Mike Belopuhov wrote: > Hi, > > I've been trying to fix a bug in tcpdump but the rottenness > of the current code base with it's horrendous APIs is just > getting in the way. What if we trimmed it a bit, say killed > all those pesky 'register' values, kill protocols

Re: Mail: fix handling of -f flag

2014-11-24 Thread Todd C. Miller
Some changes from a different patch snuck in to the version I first sent out. - todd Index: usr.bin/mail/main.c === --- usr.bin/mail/main.c.orig +++ usr.bin/mail/main.c @@ -111,16 +111,10 @@ main(int argc, char **argv)

Re: Trimming tcpdump a bit

2014-11-24 Thread Theo de Raadt
> >> I've been trying to fix a bug in tcpdump but the rottenness > >> of the current code base with it's horrendous APIs is just > >> getting in the way. What if we trimmed it a bit, say killed > >> all those pesky 'register' values, That would be cleanup, which then allows the code to be improve

Re: Trimming tcpdump a bit

2014-11-24 Thread Mike Belopuhov
On 24 November 2014 at 18:01, Mike Belopuhov wrote: > On 24 November 2014 at 17:20, Mike Belopuhov wrote: >> On 24 November 2014 at 16:42, Mike Belopuhov wrote: >>> Hi, >>> >>> I've been trying to fix a bug in tcpdump but the rottenness >>> of the current code base with it's horrendous APIs is j

Re: Mail: remove undocumented -T flag

2014-11-24 Thread Todd C. Miller
On Mon, 24 Nov 2014 06:45:23 -0700, "Todd C. Miller" wrote: > The -T flag just creates a temporary file for use with netnews that > contains the article ids of messages that have been read or deleted. > This is obsolete and should just be removed... Updated diff that removes T from the getopt() s

Re: Trimming tcpdump a bit

2014-11-24 Thread Mike Belopuhov
On 24 November 2014 at 17:20, Mike Belopuhov wrote: > On 24 November 2014 at 16:42, Mike Belopuhov wrote: >> Hi, >> >> I've been trying to fix a bug in tcpdump but the rottenness >> of the current code base with it's horrendous APIs is just >> getting in the way. What if we trimmed it a bit, say

Re: patch: correct double-free in dc(1)

2014-11-24 Thread Otto Moerbeek
On Mon, Nov 24, 2014 at 01:38:40PM +0100, S??bastien Marie wrote: > Hi, > > Starting to play with afl-fuzz, I test it with dc(1), and it found a "Bus > error". > > Basically: > $ echo '1 2:x1Lx1:x1:x' | dc > Bus error (core dumped) > > I traced the bug, and the code before do a double-free (res

Re: Trimming tcpdump a bit

2014-11-24 Thread Theo de Raadt
> On 2014/11/24 16:42, Mike Belopuhov wrote: > > Hi, > > > > I've been trying to fix a bug in tcpdump but the rottenness > > of the current code base with it's horrendous APIs is just > > getting in the way. What if we trimmed it a bit, say killed > > all those pesky 'register' values, kill proto

Mail: fix handling of -f flag

2014-11-24 Thread Todd C. Miller
The handling of the argument to the -f option is a hack. Currently, this works: $ mail -f mbox2 But this does not: $ mail -fmbox2 Instead of fooling around with argv behind getopt()'s back we can just treat the remainder of argv[] after option processing as the file name for -f. It is

Re: Trimming tcpdump a bit

2014-11-24 Thread Stuart Henderson
On 2014/11/24 16:42, Mike Belopuhov wrote: > Hi, > > I've been trying to fix a bug in tcpdump but the rottenness > of the current code base with it's horrendous APIs is just > getting in the way. What if we trimmed it a bit, say killed > all those pesky 'register' values, kill protocols that we >

Re: Trimming tcpdump a bit

2014-11-24 Thread Mike Belopuhov
On 24 November 2014 at 16:42, Mike Belopuhov wrote: > Hi, > > I've been trying to fix a bug in tcpdump but the rottenness > of the current code base with it's horrendous APIs is just > getting in the way. What if we trimmed it a bit, say killed > all those pesky 'register' values, kill protocols

Trimming tcpdump a bit

2014-11-24 Thread Mike Belopuhov
Hi, I've been trying to fix a bug in tcpdump but the rottenness of the current code base with it's horrendous APIs is just getting in the way. What if we trimmed it a bit, say killed all those pesky 'register' values, kill protocols that we cannot really test (appletalk, fddi, etc.), kill dissect

patch: fix segfault on revision + empty file

2014-11-24 Thread Tobias Stoeckmann
Hi, patch will fail with a segmentation fault in "plan a" if it encounters a diff with a revision (Prereq line) when the input file is empty. i_womp will be set to NULL to avoid mmapping 0 bytes, but later on it will be scanned for the supplied revision. The fix is simple: avoid scanning i_womp

Re: ip_input() refactoring

2014-11-24 Thread Martin Pieuchot
On 13/11/14(Thu) 15:42, Martin Pieuchot wrote: > In order to do *only one* route lookup without using a global variable > (yes, I'm looking at you netinet6) and without doing too much spaghetti, > here's a refactoring of ip_input(). > > It basically merges in_ouraddr() into ip_input(), but some op

Kill if_lladdr

2014-11-24 Thread Martin Pieuchot
This field is really only used by enc(4) in order to have an ifa to attach the encap routes to. Diff below adds an "struct ifaddr" to this driver and kill if_lladdr. There's one place where if_lladdr was temporarily used, in ifa_ifwithroute(). But the destination of a route is cannot be of type

Mail: remove undocumented -T flag

2014-11-24 Thread Todd C. Miller
The -T flag just creates a temporary file for use with netnews that contains the article ids of messages that have been read or deleted. This is obsolete and should just be removed... - todd Index: usr.bin/mail/glob.h === RCS file:

Re: patch: correct double-free in dc(1)

2014-11-24 Thread Otto Moerbeek
On Mon, Nov 24, 2014 at 01:38:40PM +0100, S??bastien Marie wrote: > Hi, > > Starting to play with afl-fuzz, I test it with dc(1), and it found a "Bus > error". > > Basically: > $ echo '1 2:x1Lx1:x1:x' | dc > Bus error (core dumped) > > I traced the bug, and the code before do a double-free (res

Re: Make every interface with a watchdog register it's own timeout

2014-11-24 Thread Mike Belopuhov
On Sun, Nov 23, 2014 at 12:06 +0100, Martin Pieuchot wrote: > On 23/11/14(Sun) 02:10, Mike Belopuhov wrote: > > Hi, > > > > This removes the system wide if_slowtimo timeout and lets every > > interface with a valid if_watchdog method register it's own. > > The rational is to get rid of the ifnet l

patch: correct double-free in dc(1)

2014-11-24 Thread Sébastien Marie
Hi, Starting to play with afl-fuzz, I test it with dc(1), and it found a "Bus error". Basically: $ echo '1 2:x1Lx1:x1:x' | dc Bus error (core dumped) I traced the bug, and the code before do a double-free (resulting the Bus error). Thanks to malloc(3) junk :) The problem is a lack of initialisa

Re: Make every interface with a watchdog register it's own timeout

2014-11-24 Thread Mike Belopuhov
On Sun, Nov 23, 2014 at 13:39 +0100, Claudio Jeker wrote: > On Sun, Nov 23, 2014 at 02:10:24AM +0100, Mike Belopuhov wrote: > > Hi, > > > > This removes the system wide if_slowtimo timeout and lets every > > interface with a valid if_watchdog method register it's own. > > The rational is to get ri

Re: Rename rt_ifa_addloop(9)

2014-11-24 Thread Mike Belopuhov
On 20 November 2014 at 15:37, Martin Pieuchot wrote: > When I decided to use in6_ifaddloop() for IPv4 I barely though about > the name of the function. Recently mikeb@ told me that the name is > confusing, especially because I'm trying to turn the "loopback hack" > into "local routes". > > So her