Re: remove ifdef from ftpd

2016-08-31 Thread Ted Unangst
Jeremie Courreges-Anglas wrote: > > As discussed I prefer this direction, but: > - the fgets code will make the server hang > - it's not the ftp user's business to know that IPv4 mapped addresses > aren't supported. I'd rather log something to syslog. yeah, ok

Re: remove ifdef from ftpd

2016-08-31 Thread Jeremie Courreges-Anglas
"Ted Unangst" writes: > Jeremie Courreges-Anglas wrote: >> I think that's a better choice. >> >> > >> >> >> >> > -#else >> >> > - while (fgets(line, sizeof(line), fd) != NULL) { >> >> > - line[strcspn(line, "\n")] = '\0'; >> >> > -

Re: remove ifdef from ftpd

2016-08-30 Thread Ted Unangst
Jeremie Courreges-Anglas wrote: > I think that's a better choice. > > > > >> > >> > -#else > >> > -while (fgets(line, sizeof(line), fd) != NULL) { > >> > -line[strcspn(line, "\n")] = '\0'; > >> > -lreply(530, "%s", line); > >> > -

Re: remove ifdef from ftpd

2016-08-30 Thread Ted Unangst
Jeremie Courreges-Anglas wrote: > Here the code attempts to deal with IPv4-mapped IPv6 addresses, > something that won't show up on OpenBSD. We don't support them on > purpose, to avoid surprises and this kind of ugly code. > > One could argue that if someone ported the ftpd code to another OS,

remove ifdef from ftpd

2016-08-30 Thread Ted Unangst
stop testing for stuff we have. Index: ftpd.c === RCS file: /cvs/src/libexec/ftpd/ftpd.c,v retrieving revision 1.219 diff -u -p -r1.219 ftpd.c --- ftpd.c 26 Aug 2016 06:32:10 - 1.219 +++ ftpd.c 30 Aug 2016