Re: ftp: ctype interfaces need unsigned chars

2015-10-12 Thread Todd C. Miller
On Sat, 10 Oct 2015 16:35:02 -0700, Philip Guenther wrote: > Some isfoo(char) usages crept back into ftp OK. - todd

Re: ftp: ctype interfaces need unsigned chars

2015-10-11 Thread Joerg Jung
> Am 11.10.2015 um 04:38 schrieb Philip Guenther : > >> --- smtpd/rfc2822.c >> +++ /tmp/cocci-output-29655-69b554-rfc2822.c >> @@ -93,13 +93,13 @@ parser_feed_header(struct rfc2822_parser >>char*pos; >> >>/* new header */ >> -if (! isspace(*line) &&

Re: ftp: ctype interfaces need unsigned chars

2015-10-11 Thread Alexander Bluhm
On Sat, Oct 10, 2015 at 08:03:28PM -0700, Philip Guenther wrote: > On Sat, 10 Oct 2015, Michael McConville wrote: > > FWIW, this is a perfect use case for Coccinelle. Below is what I dredged > > up in src/usr.sbin (diff not yet carefully audited, but apparently > > sane). > > These look good to

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Theo de Raadt
> Some isfoo(char) usages crept back into ftp Hmm. I wonder how we can keep these errors out of base. Having to re-audit all the time is painful.

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Philip Guenther
On Sat, 10 Oct 2015, Bob Beck wrote: > On Sat, Oct 10, 2015 at 04:35:02PM -0700, Philip Guenther wrote: ... > > @@ -1409,7 +1410,7 @@ recode_credentials(const char *userinfo) > > char > > hextochar(const char *str) > > { > > - char c, ret; > > + unsigned char c, ret; > > > > c =

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Philip Guenther
On Sat, 10 Oct 2015, Michael McConville wrote: ... > FWIW, this is a perfect use case for Coccinelle. Below is what I dredged > up in src/usr.sbin (diff not yet carefully audited, but apparently > sane). I'm replying to this multiple times, cc'ing in the particular maintainers as appropriate.

ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Philip Guenther
Some isfoo(char) usages crept back into ftp ok? Philip Guenther Index: ftp/fetch.c === RCS file: /cvs/src/usr.bin/ftp/fetch.c,v retrieving revision 1.142 diff -u -p -r1.142 fetch.c --- ftp/fetch.c 10 Sep 2015 13:43:35 -

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Philip Guenther
On Sat, 10 Oct 2015, Michael McConville wrote: > FWIW, this is a perfect use case for Coccinelle. Below is what I dredged > up in src/usr.sbin (diff not yet carefully audited, but apparently > sane). These look good to me. bluhm? Side note: bluhm, please rename the dprintf() macro to

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Philip Guenther
On Sat, 10 Oct 2015, Theo de Raadt wrote: > > Some isfoo(char) usages crept back into ftp > > Hmm. I wonder how we can keep these errors out of base. > Having to re-audit all the time is painful. Right now, _ctype_ is a generic const char * pointer. Maybe there's way to make it a pointer to

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Bob Beck
On Sat, Oct 10, 2015 at 04:35:02PM -0700, Philip Guenther wrote: > > Some isfoo(char) usages crept back into ftp > > ok? > > Philip Guenther > > > Index: ftp/fetch.c > === > RCS file: /cvs/src/usr.bin/ftp/fetch.c,v > retrieving

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Philip Guenther
On Sat, 10 Oct 2015, Michael McConville wrote: > FWIW, this is a perfect use case for Coccinelle. Below is what I dredged > up in src/usr.sbin (diff not yet carefully audited, but apparently > sane). I'm replying to this multiple times, cc'ing in the particular maintainers as appropriate. >

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Philip Guenther
On Sat, 10 Oct 2015, Michael McConville wrote: > FWIW, this is a perfect use case for Coccinelle. Below is what I dredged > up in src/usr.sbin (diff not yet carefully audited, but apparently > sane). The ypserv chunks show your Coccinelle script could use an enhancement... > ---

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Michael McConville
Theo de Raadt wrote: > > Some isfoo(char) usages crept back into ftp > > Hmm. I wonder how we can keep these errors out of base. > Having to re-audit all the time is painful. FWIW, this is a perfect use case for Coccinelle. Below is what I dredged up in src/usr.sbin (diff not yet carefully

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Philip Guenther
On Sat, 10 Oct 2015, Michael McConville wrote: > Theo de Raadt wrote: > > > Some isfoo(char) usages crept back into ftp > > > > Hmm. I wonder how we can keep these errors out of base. > > Having to re-audit all the time is painful. > > FWIW, this is a perfect use case for Coccinelle. Below is

Re: ftp: ctype interfaces need unsigned chars

2015-10-10 Thread Theo de Raadt
> as well as this: > > > --- tcpdump/print-ipsec.c > > +++ /tmp/cocci-output-17550-499a71-print-ipsec.c > > @@ -101,7 +101,7 @@ esp_init (char *espspec) > > s[0] = espkey[2*i]; > > s[1] = espkey[2*i + 1]; > > s[2] = 0; > > - if (!isxdigit(s[0]) ||