Re: fix usermod -Z / -S

2016-08-04 Thread Todd C. Miller
I'd prefer it if we just removed the invalid password check entirely. - todd

Re: fix usermod -Z / -S

2016-08-05 Thread Todd C. Miller
Here is a diff to remove the encrypted password length check. I don't believe that user(8) has any business mucking about with either existing encrypted passwords in master.password or with the password specified by the user. This also eliminates the exceptionally ugly 13 '*' character entries th

Re: fix usermod -Z / -S

2016-08-10 Thread Todd C. Miller
On Fri, 05 Aug 2016 13:04:42 -0600, "Todd C. Miller" wrote: > Here is a diff to remove the encrypted password length check. I > don't believe that user(8) has any business mucking about with > either existing encrypted passwords in master.password or with the > pas

Re: cvs(1): default to a)bort for empty commit log

2016-08-16 Thread Todd C. Miller
I agree, the default should be to abort in thise case. - todd

Re: ksh: "l.beg may be used uninitialized"

2016-08-16 Thread Todd C. Miller
You might want to make "XPtrV l;" local to the "if (i == nwords)" block. OK millert@ either way. - todd

connect(2): add example

2016-08-18 Thread Todd C. Miller
Handling EINTR with connect(2) is tricky enough that I think it deserves an example that people can copy & paste into their own code. Is it worth expanding the part before connect_wait()? - todd Index: lib/libc/sys/connect.2 === RC

Re: connect_sync

2016-08-19 Thread Todd C. Miller
Another option is to use the connect_wait() function I added to EXAMPLES in connect(2). You would only call it if connect(2) returns -1 with errno == EINTR. - todd

Re: connect_sync

2016-08-19 Thread Todd C. Miller
Here's a rewrite of my connect_sync() changes to use connect_wait() instead. Unlike the version in the connect(2) manual, this one returns EINTR when interrupted by a signal which is probably better. - todd Index: usr.bin/ftp/extern.h

Re: connect_sync

2016-08-19 Thread Todd C. Miller
On Fri, 19 Aug 2016 19:14:54 -0400, "Ted Unangst" wrote: > hmm. so I was trying to avoid the need for two different functions. I think > there's a mental overhead to "do this, then maybe that". this loop reads > very strangely to me. it's hard to mentally trace the code. it's not really a > loop,

ftp: avoid casts in networking functions

2016-08-21 Thread Todd C. Miller
This adds struct sockaddr to sockunion so we can just use &foo.su_sa instead of (struct sockaddr *)&foo. No functional difference but it lets the compiler warn when appropriate. The diff also sync the types in struct sockinet to match the first three fields of struct sockaddr_in. We could get ri

Re: ftp: avoid casts in networking functions

2016-08-21 Thread Todd C. Miller
On Sun, 21 Aug 2016 14:23:33 -0600, "Todd C. Miller" wrote: > We could get rid of struct sockinet entirely but I wasn't sure it > was worth it. Here's a diff that replaces sockunion with the more common sockaddr_union. - todd

Re: pax: stop getting mode via strcmp(argv0)

2016-08-23 Thread Todd C. Miller
On Mon, 22 Aug 2016 21:05:11 -0700, Philip Guenther wrote: > pax, tar, and cpio are one binary that changes behavior based on the last > component of argv[0]. Lots of shared code, so sure, but I find the > strcmp() tests in the main code overly complex and perhaps an affront to > clear style.

Re: inconsistent error handling in fgetln(3)

2016-08-24 Thread Todd C. Miller
I'm probably not understanding something here but why can't you just test for __SEOF in fp->_flags when __srefill() returns non-zero and treat the absence of __SEOF as an error? - todd

Re: inconsistent error handling in fgetln(3)

2016-08-24 Thread Todd C. Miller
On Wed, 24 Aug 2016 19:49:47 +0200, Ingo Schwarze wrote: > See the improved patch below! Looks good. I wouldn't bother with an else after the break but if you think it reads better that way, that's fine with me. - todd

use strnlen() in vfprintf.c

2016-08-25 Thread Todd C. Miller
This is what strnlen(3) is for, let's use it... Alternately, we could unify things like: len = prec >= 0 ? strnlen(cp, prec) : strlen(cp); if (len > INT_MAX) goto overflow; size = (int)len; but that means declaring "size_t len" at the top of the for(;;) lo

Re: use strnlen() in vfprintf.c

2016-08-25 Thread Todd C. Miller
On Thu, 25 Aug 2016 13:56:24 -0700, Philip Guenther wrote: > This: > > if (blah) { > size_t len; > ... > } else { > size_t len; > ... > } > > looks noisy to me, so I would lean towards your latter idea. Yeah, I just liked len being scoped that way. However, I see other places w

Re: use strnlen() in vfprintf.c

2016-08-27 Thread Todd C. Miller
On Sat, 27 Aug 2016 12:12:02 +0200, Ingo Schwarze wrote: > However, in the case at hand, it really helps readability > in a function (unavoidably) already longer than comfortable > for reading it. Now that we have a handy size_t scratch variable, we can use it to store the return value of mbrtowc

Re: constify auth functions

2016-09-01 Thread Todd C. Miller
On Thu, 01 Sep 2016 10:51:06 -0400, "Ted Unangst" wrote: > I'm getting annoying warnings because these functions aren't const. As we're the only users of BSD auth I think this is fine. - todd

Re: constify auth functions

2016-09-01 Thread Todd C. Miller
On Thu, 01 Sep 2016 13:27:49 -0400, "Ted Unangst" wrote: > Ted Unangst wrote: > > I'm getting annoying warnings because these functions aren't const. > > so > > turns out several of these functions *do* modify their parameters. which is > probably chaos, because i think we sometimes call the

Re: mg(1) Initialize stack variables to zero before memmove()

2016-09-02 Thread Todd C. Miller
On Fri, 02 Sep 2016 07:10:38 -, Mark Lumsden wrote: > Source Joachim Nilsson: > > Coverity Scan reported these two stack variables as uninitialized, in > particular the .r_lineno struct member was uninitialized. This patch > clears the 'struct region' rather than setting .r_linen

Re: refactor gzip methods

2016-09-02 Thread Todd C. Miller
On Fri, 02 Sep 2016 12:02:20 -0400, "Ted Unangst" wrote: > this diff doesn't change any behavior, but creates separate read > and write open functions (which currently share quite a bit of code) > that only take the necessary arguments. > > it also deletes a never used zopen function. and removes

Re: Sync getopt with getopt

2016-09-04 Thread Todd C. Miller
On Sun, 04 Sep 2016 11:58:23 -0600, "Anthony J. Bentley" wrote: > This brings /usr/share/misc/getopt in sync with the example in getopt(3). OK, though I wonder if anyone actually looks at this file? - todd

Re: Sync getopt with getopt

2016-09-05 Thread Todd C. Miller
On Mon, 05 Sep 2016 04:02:47 -0400, "Ted Unangst" wrote: > Todd C. Miller wrote: > > On Sun, 04 Sep 2016 11:58:23 -0600, "Anthony J. Bentley" wrote: > > > > > This brings /usr/share/misc/getopt in sync with the example in getopt(3). > > > &

Re: Remove /usr/share/misc/eqnchar

2016-09-05 Thread Todd C. Miller
On Sun, 04 Sep 2016 20:40:47 -0600, "Anthony J. Bentley" wrote: > eqnchar is a collection of eqn(7) definitions to create mathematical > symbols by constructing them from other characters. Creating circled > plus with O, a backspace, and a plus, for example. The results are > quite ugly in both ma

Re: mg: Collect forked off children from M-| command

2016-09-07 Thread Todd C. Miller
On Wed, 07 Sep 2016 12:05:22 -, Mark Lumsden wrote: > Source Joachim Nilsson: > > Collect forked off children from M-| command > > Mg left zombies from commands executed when piping a region of text to > an external command. This patch makes sure to collect for the child > b

look(1): eliminate FOLD and DICT macros

2016-09-07 Thread Todd C. Miller
There's no need to check for isascii() with ANSI ctype macros/functions. Eliminating the macros makes the code clearer. - todd Index: usr.bin/look/look.c === RCS file: /cvs/src/usr.bin/look/look.c,v retrieving revision 1.18 diff -u

Re: ps -o etime

2016-09-08 Thread Todd C. Miller
On Thu, 08 Sep 2016 23:15:01 +1200, Carlin Bingham wrote: > The "etime" keyword is currently an alias for "start". posix says it > should be the amount of time since the program started running, in the > format [[dd-]hh:]mm:ss, I've encountered some code that doesn't work on > openbsd because that

Re: ksh(1): manual says $PPID is read-only

2016-09-08 Thread Todd C. Miller
On Thu, 08 Sep 2016 10:08:23 -0400, Anthony Coulter wrote: > We can fix either the manual or ksh itself; this diff takes the latter > approach. It is tempting to do this with "typeset -ir PPID" but that > actually doesn't work: > > $ FOO=123 > $ typeset -ir FOO > ksh: FOO: is re

Re: ksh(1): manual says $PPID is read-only

2016-09-08 Thread Todd C. Miller
On Thu, 08 Sep 2016 17:33:37 +0200, Theo Buehler wrote: > Your fix looks correct to me and accomplishes the desired effect. Should > we perhaps introduce > > #define NO_RO_CHECK 0x4 > > and replace the 5 occurrences of the magic number in var.c? Yes, I would like that. - todd

Re: ksh(1): manual says $PPID is read-only

2016-09-08 Thread Todd C. Miller
I've committed my fix to make "typeset -ir PPID" work and adjusted the PPID line in initcoms[] accordingly. - todd

Re: db_trace.c: use __func__ instead of hardcoding filename

2016-09-09 Thread Todd C. Miller
On Fri, 09 Sep 2016 20:38:05 +0200, Jasper Lievisse Adriaanse wrote: > Do we really want the filename to be printed in the message? If so we should > use __FILE__. On the other hand, having the function name makes more sense to > me. Much more useful, OK millert@ - todd

Re: /usr/bin/skeyprune owner

2016-09-11 Thread Todd C. Miller
On Sun, 11 Sep 2016 10:06:55 +0200, Martin Natano wrote: > Another ${INSTALL} invokation that doesn't mention the owner. Ok? OK millert@ - todd

Re: date(1): fix description for -a

2016-09-12 Thread Todd C. Miller
On Mon, 12 Sep 2016 19:10:32 +0200, Jeremie Courreges-Anglas wrote: > It seems that date(1) used to have support for timed(8), this support > has been removed in 2011. Let's remove a confusing reference to "remote > time". OK millert@. - todd

Re: acme switch

2016-09-13 Thread Todd C. Miller
On Tue, 13 Sep 2016 12:25:58 -0400, "Ted Unangst" wrote: > convert two if else if chains to switches. OK millert@ - todd

innetgr(3): fix matching when user, host and domain are specified

2016-09-13 Thread Todd C. Miller
Currently, innetgr(3) will return false if all of user, host and domain are specified, even if the tuple would otherwise match. The commented assumption "If a domainname is given, we would have found a match" is simply not true. I also moved the strdup after the "Too bad need the slow recursive w

Re: m_copym2 is unused, let's remove it

2016-09-13 Thread Todd C. Miller
Looks OK. Do you intend to change m_copym0 to m_copym and remove the deep copy code? - todd

Re: regression tests and patch for calendar(1)

2016-09-14 Thread Todd C. Miller
On 31 Aug 2016 07:52:19 -0600, "Andy Bradford" wrote: > While writing a set of regression tests for calendar(1) I discovered a > bug introduced by my last patch. The following patch fixes that and all > regression tests in the attachment of tests passes. I've committed the fix as well as the c

Re: libsa, stop saving memory

2016-09-14 Thread Todd C. Miller
On Wed, 14 Sep 2016 20:41:48 +0200, Jasper Lievisse Adriaanse wrote: > nothing defines SAVE_MEMORY nor has it been modified since -r1.1. > ok to zap it? OK millert@ - todd

Re: rebound quantum entanglement

2016-09-14 Thread Todd C. Miller
On Wed, 14 Sep 2016 20:00:32 -0600, Bob Beck wrote: > wont this also mean if it is not running i have to wait for the localhost > attempt to fail before the resolver moves on? (ASR_STATE_NEXT_NS, etc) so i > slow everything down for a timeout? Not if he connects to the TCP port 53 instead of the

Re: gmtime return value

2016-09-19 Thread Todd C. Miller
Committed, thanks. - todd

Re: libc: remove pointless off_t, size_t, void* and char* casts

2016-09-20 Thread Todd C. Miller
On Mon, 19 Sep 2016 20:27:56 -0700, Philip Guenther wrote: > I'm pretty sure I got all of the "no effect" casts to off_t and size_t. > I picked up the void* and char* casts with a less comprehensize search, so > there may be some that slipped through. > > This diff was checked by comparing the

Re: innetgr(3): fix matching when user, host and domain are specified

2016-09-24 Thread Todd C. Miller
On Sat, 24 Sep 2016 00:49:07 -0700, Philip Guenther wrote: > Hmm, but then in the strdup() fails you need to call > _ng_sl_free(sl, 1); > no? Yes, fixed. > (Speaking of, _ng_sl_free() is now static and its second argument is > always 1, so maybe it should lose that...) That arg can be 0

Re: Unexpected behavior in su/doas

2016-10-04 Thread Todd C. Miller
FYI, sudo supports running the command in a new pty, which should avoid the issue. Commands are always run in a new pty when logging input or output, otherwise the use_pty flag needs to be set in sudoers. - todd

Re: locale in sort(1)

2016-10-07 Thread Todd C. Miller
On Fri, 07 Oct 2016 12:39:18 +0200, Jan Stary wrote: > The sort(1) manpage mentions the LC_* environment variables > and how they affect sorting and efficiency, but we only > support LC_CTYPE, right? Would it be an omprovement > to remove these from the manpage? The code supports collation based

Re: PING: Re: logname turd polish

2016-10-12 Thread Todd C. Miller
On Wed, 12 Oct 2016 15:03:04 +0200, Ingo Schwarze wrote: > please just commit this patch you sent out back in July. > The old, verbose style keeps confusing people, > see for example Jan Stary's recent messages to tech@. > I guess you just overlooked my OK. > There was no opposition when you put t

Re: crontab(5): document -q flag in command

2016-10-12 Thread Todd C. Miller
Whitespace between the -q and the command is optional, not required. - todd Index: crontab.5 === RCS file: /cvs/src/usr.sbin/cron/crontab.5,v retrieving revision 1.33 diff -u -p -u -r1.33 crontab.5 --- crontab.5 30 Jan 2014 20:02:

Re: crontab(5): document -q flag in command

2016-10-12 Thread Todd C. Miller
On Wed, 12 Oct 2016 18:32:42 +0200, Ingo Schwarze wrote: > So, OK to commit my version? OK, though that seems like a bug in the crontab parser. - todd

opencvs: quiet sign warnings

2016-10-13 Thread Todd C. Miller
Quiet some sign warnings from the compiler. The common "st.st_size > SIZE_MAX" check causes many of them. To avoid this we need to cast st_size (which is off_t) to a large unsigned type. I think uintmax_t makes the most sense for this. - todd Index: buf.c =

Re: opencvs - fix update -r and -A

2016-10-14 Thread Todd C. Miller
On Fri, 14 Oct 2016 16:17:45 +0200, Joris Vink wrote: > In certain cases update -r and update -A would not properly set or reset > the sticky tag for file(s). This patch fixes that problem. After reading through the applicable parts of update.c I'm fairly certain this is correct. OK millert@ -

diff3: use boolean OR, not bitwise

2016-10-16 Thread Todd C. Miller
It is effectively the same in this case but using the boolean OR is less surprising and may quiet over zealous compilers. OK? - todd Index: cvs/diff3.c === RCS file: /cvs/src/usr.bin/cvs/diff3.c,v retrieving revision 1.61 diff -u -

Re: diff3: use boolean OR, not bitwise

2016-10-16 Thread Todd C. Miller
On Sun, 16 Oct 2016 16:06:39 +0200, Otto Moerbeek wrote: > On Sun, Oct 16, 2016 at 07:07:36AM -0600, Todd C. Miller wrote: > > > It is effectively the same in this case but using the boolean OR > > is less surprising and may quiet over zealous compilers. > > Are you s

Re: config(8): use {err,warn}{,x} instead of fprintf(stderr, ...)

2016-10-16 Thread Todd C. Miller
On Sun, 16 Oct 2016 11:47:32 +0200, Theo Buehler wrote: > Many files already include and there's a mix of hand-rolled > warning messages and there's incorrect usage warn("config: ..."). This > is a first sweep at unifying them. > > In mkheaders.c, there is an err() function, rename it to emitwar

Re: opencvs - show branch revision in status

2016-10-18 Thread Todd C. Miller
On Mon, 17 Oct 2016 12:59:36 +0200, Joris Vink wrote: > Let's bring status a bit more inline with its GNU cvs counter part. > > This diff adds the branch revision for the sticky tag if set. OK millert@ - todd

syslog_r() should use strerror_r()

2016-10-19 Thread Todd C. Miller
Currently, syslog_r() avoids using strerror() since it is not reentrant. We have a reentrant strerror_r() so let's use it. OK? - todd Index: lib/libc/gen/syslog_r.c === RCS file: /cvs/src/lib/libc/gen/syslog_r.c,v retrieving revis

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Todd C. Miller
On Wed, 19 Oct 2016 17:29:18 +0200, Mark Kettenis wrote: > Perhaps add a comment explicitly stating that OpenBSD's strerror_r() > *is* reentrant? I thought that was implicit in the name. - todd

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Todd C. Miller
On Wed, 19 Oct 2016 09:34:16 -0600, "Theo de Raadt" wrote: > Inside strerror_r, I'm unsure why there is a save_errno dance. I don't see anything called by strerror_r() that would touch errno so we could get rid of the save_errno dance and just do: if (ret_errno) errno = r

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Todd C. Miller
On Wed, 19 Oct 2016 09:11:36 -0600, "Todd C. Miller" wrote: > Currently, syslog_r() avoids using strerror() since it is not > reentrant. We have a reentrant strerror_r() so let's use it. Since strerror_r() always fills in the buffer there is no need to check the return valu

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Todd C. Miller
On Wed, 19 Oct 2016 18:00:16 +0200, Alexander Bluhm wrote: > On Wed, Oct 19, 2016 at 09:34:16AM -0600, Theo de Raadt wrote: > > Inside strerror_r, I'm unsure why there is a save_errno dance. > > That is from the time when we had national language support. > > ok? OK millert@ - todd

Re: make !!= extension

2016-10-20 Thread Todd C. Miller
On Thu, 20 Oct 2016 15:22:44 +0200, Marc Espie wrote: Comments inline. > Index: make.1 > === > RCS file: /cvs/src/usr.bin/make/make.1,v > retrieving revision 1.120 > diff -u -p -r1.120 make.1 > --- make.113 Mar 2015 19:58:41 -000

Re: chown and chmod in includes/Makefile

2016-11-08 Thread Todd C. Miller
On Tue, 08 Nov 2016 16:29:26 +0100, Theo Buehler wrote: > Let's move the chown and chmod to later. I changed chmod -R to chmod -RP > to set the owner and group of symlinks explicitly (the symlinks point to > files under /usr/include, so these files got chowned twice). Set the > permissions of the

Re: smtpd: internal cleanups

2016-11-16 Thread Todd C. Miller
On Wed, 16 Nov 2016 21:13:40 +0100, Eric Faurot wrote: > With this first diff, the user pointer is passed as parameter to the io > callback instead of having the user dereference the io structure. There > are places where the callback function is triggered outside of the io > layer. It's not desir

ftp: avoid printf of NULL in debug mode

2016-12-08 Thread Todd C. Miller
I noticed that Jiri's ftp debug output had two instances where NULL was printed as a string. This fixes it. $ ftp -o /dev/null -M -d -V http://ftp.eu.openbsd.org/pub/OpenBSD/snapshots/amd64/ Before: host ftp.eu.openbsd.org, port (null), path pub/OpenBSD/snapshots/amd64/, save as /dev/null, aut

Re: [ftp] missing new line in debug+verbose mode

2016-12-08 Thread Todd C. Miller
That will add an extra newline in the proxy case where it does: fprintf(ttyout, "Requesting %s", origline); ... fprintf(ttyout, " (via %s)\n", proxyurl); There is actually a newline printed for the non-proxy case but it happens too late. We either need to avoid printing

Re: arm64: add efibind header for efiboot(8)

2016-12-13 Thread Todd C. Miller
The copyright notice says there is a license but doesn't specify what the license is. In constrast, sys/stand/efi/include/arm/efibind.h explicitly states it is under the BSD license and provides a link to the license text. I guess this is the same as sys/stand/efi/include/amd64/efibind.h so it is

Re: arm64: add efibind header for efiboot(8)

2016-12-13 Thread Todd C. Miller
On Tue, 13 Dec 2016 18:06:11 +0100, Patrick Wildt wrote: > Turns out, the copyright seems to be bad. This version is taken from > tianocore/edk2, modified to work with our efiboot(8) checkout. Great, thanks. > The diff to the arm efibind header is comparatively small now. Even better. OK mill

Re: syslogd klog read size

2016-12-23 Thread Todd C. Miller
Nice find, that explains the reports of broken lines. OK millert@ - todd

Re: syslogd chdir

2016-12-25 Thread Todd C. Miller
Another alternative is to use realpath(3) to resolve the path so it can be used after the chdir(2). - todd

Re: syslogd in foreground

2015-06-12 Thread Todd C. Miller
On Fri, 12 Jun 2015 01:07:57 +0200, Alexander Bluhm wrote: > I need a syslogd running in foreground for a project. FreeBSD > also uses the option -F for that. I don't have any objection to that. A few comments inline. - todd > Index: usr.sbin/syslogd/privsep.c > =

Re: syslogd in foreground

2015-06-12 Thread Todd C. Miller
On Fri, 12 Jun 2015 20:43:33 +0200, Alexander Bluhm wrote: > I wanted both places were we close the lockpipe in a consistent > order. Now I think we should compare the fd with 2 in both places > to have the same level of paranoia as with nullfd a few lines below. It is safer to close the lock fd

Re: syslogd in foreground

2015-06-12 Thread Todd C. Miller
On Fri, 12 Jun 2015 21:02:47 +0200, Alexander Bluhm wrote: > You are right. Then this is the correct diff. ok? OK millert@ - todd

Re: [patch]diff: uninitialized values

2015-06-18 Thread Todd C. Miller
On Wed, 17 Jun 2015 20:53:57 +0200, Fritjof Bornebusch wrote: > *edp1* and *edp2* could be used uninitialized, if *goto closem;* is called. I don't think so. If dirp1 is non-NULL, so must edp1 be. Likewise for dirp2 and edp2. The compiler just doesn't know that scandir() does not modify its ou

strtok_r: remove useless casts

2015-06-19 Thread Todd C. Miller
There's no reason to cast delim to char * when we can just make spanp const char * to match it. - todd Index: lib/libc/string/strtok.c === RCS file: /cvs/src/lib/libc/string/strtok.c,v retrieving revision 1.6 diff -u -p -u -r1.6 str

Re: ps %cpu is 0

2015-06-28 Thread Todd C. Miller
On Sun, 28 Jun 2015 12:43:40 +0200, Alexander Bluhm wrote: > After removing the p_swtime from the kernel, ps always prints 0.0 > as %cpu time. The simple fix is to remove the calculation in ps > that includes the process lifetime. Just print the p_pctcpu. I think you want to keep the case 'C':

Re: ps %cpu is 0

2015-06-28 Thread Todd C. Miller
On Sun, 28 Jun 2015 20:26:31 +0200, Alexander Bluhm wrote: > Why? And what should I document in the manpage then? So you don't break existing scripts that might use it. You don't need to document it. - todd

Re: ps %cpu is 0

2015-06-29 Thread Todd C. Miller
OK millert@ - todd

syslogd: remove some unneeded includes

2015-07-03 Thread Todd C. Miller
Also removes all includes from syslogd.h which required including sys/socket.h in two files. - todd Index: usr.sbin/syslogd/evbuffer_tls.c === RCS file: /cvs/src/usr.sbin/syslogd/evbuffer_tls.c,v retrieving revision 1.3 diff -u -p -

Re: faq/current.html: Mention sudo removal

2015-07-04 Thread Todd C. Miller
On Sat, 04 Jul 2015 15:36:58 +0530, Hrishikesh Muruk wrote: > Why is sudo being removed from base? It is pretty useful. I imagine many > use sudo The version of sudo in base was 5 years old and not really maintainable. Theo has been uncomfortable with the amount of code in sudo that runs as root

mail.local: support IPv6 for biff notification

2015-07-06 Thread Todd C. Miller
Simple conversion to getaddrinfo. Noticed while debugging a comsat issue. - todd Index: libexec/mail.local/mail.local.c === RCS file: /cvs/src/libexec/mail.local/mail.local.c,v retrieving revision 1.33 diff -u -p -u -r1.33 mail.loc

mail.local: don't send an extra NUL byte to comsat

2015-07-06 Thread Todd C. Miller
There's no need to send a NUL byte to comsat, it NUL-terminates the buffer itself. - todd Index: libexec/mail.local/mail.local.c === RCS file: /cvs/src/libexec/mail.local/mail.local.c,v retrieving revision 1.34 diff -u -p -u -r1.34

comsat: fix botched strtonum() conversion

2015-07-06 Thread Todd C. Miller
The message sent by mail.local ends in a newline so we need to trim it before calling strtonum(). Also adds some debugging syslogs that were useful along the way (disabled by default). - todd Index: libexec/comsat/comsat.c === RCS

Re: [patch] unsync between ctype and wctype

2015-07-07 Thread Todd C. Miller
On Tue, 07 Jul 2015 10:51:22 +0200, Sebastien Marie wrote: > New patch with lines removed. Makes sense. OK millert@ - todd

Re: unifdef IN6_IFSTAT_STRICT

2015-07-07 Thread Todd C. Miller
On Tue, 07 Jul 2015 15:51:12 +0200, Martin Pieuchot wrote: > I'd like to remove this 16 years old define. We always used the correct > behavior. My goal is to reduce the uses of if_get(). > > Ok? I'm in favor of fewer useless knobs. OK millert@. - todd

Re: Small in6_addr2scopeid() tweak

2015-07-07 Thread Todd C. Miller
On Tue, 07 Jul 2015 15:56:35 +0200, Martin Pieuchot wrote: > Now that packet headers include the interface index of their receiving > interface, pass it directly to in6_addr2scopeid(). > > This does not change anything with regards to the scopeid hack but it > reduces the number of if_get(). OK,

Re: [patch] vi: fix "file modified more recently than this copy ..." error

2015-07-07 Thread Todd C. Miller
I prefer this diff instead. - todd Index: usr.bin/vi/common/exf.c === RCS file: /cvs/src/usr.bin/vi/common/exf.c,v retrieving revision 1.36 diff -u -p -u -r1.36 exf.c --- usr.bin/vi/common/exf.c 24 Apr 2015 21:48:31 - 1

init(8): use volatile sig_atomic_t for state variable

2015-07-14 Thread Todd C. Miller
The requested_transition variable in init(8) is modified by signal handlers and so should be volatile sig_atomic_t. Currently it's a function pointer so this diff changes requested_transition to be an index into an array of function pointers. So instead of the state functions returning the next f

Re: Fix for segfault in find(1)

2015-07-14 Thread Todd C. Miller
On Tue, 14 Jul 2015 17:52:52 +0200, Gregor Best wrote: Comments inline: > Index: misc.c > === > RCS file: /mnt/media/cvs/src/usr.bin/find/misc.c,v > retrieving revision 1.12 > diff -u -p -u -r1.12 misc.c > --- misc.c18 May 2014 0

find(1): replace remaining realloc()

2015-07-14 Thread Todd C. Miller
Use reallocarray() to replace the one remaining realloc() in find. - todd Index: usr.bin/find/misc.c === RCS file: /cvs/src/usr.bin/find/misc.c,v retrieving revision 1.13 diff -u -p -u -r1.13 misc.c --- usr.bin/find/misc.c 14 Jul 20

Re: Fix for segfault in find(1)

2015-07-14 Thread Todd C. Miller
On Tue, 14 Jul 2015 12:55:35 -0400, "Ted Unangst" wrote: > so technically i believe this is still undefined since you're not supposed to > look at freed pointers. an even more better fix would be to save the offset > before the realloc. Yeah, I forgot we had to deref store. - todd Index: misc.

Re: ieee80211.h: update standard references

2015-07-14 Thread Todd C. Miller
On Tue, 14 Jul 2015 20:47:57 +0200, Stefan Sperling wrote: > Updates standard references to 802.11-2012 (except for crypto). > > Also adds some new symbols from 802.11-2012. Some of these names are needlessly different from ieee80211.h in Free and Net. Also, what happened to IEEE80211_ELEMID_TP

Re: ieee80211.h: update standard references

2015-07-14 Thread Todd C. Miller
On Tue, 14 Jul 2015 22:33:39 +0200, Stefan Sperling wrote: > I'd rather have the header be consistent with the standard. > I have no problem with implementing extensions to the standard but I don't > see a point in declaring non-standard elements without using them. OK, fair enough. - todd

passwd(1): describe behavior when user not specified

2015-07-15 Thread Todd C. Miller
This comes up periodically with users being confused when running passwd after su changes the passwd of the user they came from. - todd Index: usr.bin/passwd/passwd.1 === RCS file: /cvs/src/usr.bin/passwd/passwd.1,v retrieving revis

Re: doas with a timeout

2015-07-27 Thread Todd C. Miller
This is harder to make secure than you realize. Once you add it you will people will complain that if you logout and log back in again during the timeout you can still run commands. Next you will get requests for per-tty and per-destination user timeout files. But wait! If someone can change th

Re: doas with a timeout

2015-07-27 Thread Todd C. Miller
On Mon, 27 Jul 2015 11:12:17 +0100, Kevin Chadwick wrote: > It's not a big deal but one feature of sudo that I occasionally use is > sudoedit. You can get sudoedit-like functionality without building it into doas. All you really need is an editor front-end that uses getlogin(2) to figure out the

Re: fixes for coverity warnings to cat(1)

2015-07-29 Thread Todd C. Miller
Note that fileno() does not set errno so you should probably set errno to EBADF before the calls to warn() or err(). - todd

Re: fixes for coverity warnings to cat(1)

2015-07-29 Thread Todd C. Miller
On Wed, 29 Jul 2015 17:41:19 -0400, "Ted Unangst" wrote: > when does fileno(stdin) return -1? It looks like _file in struct __sFILE (aka FILE) is only -1 for non-files, e.g. for things like snprintf(). I've verified that fileno(stdin) still returns 0 even when stdin is closed. This is true rega

Re: buffer overrun in fnmatch.c

2015-07-31 Thread Todd C. Miller
The problem is that classmatch() can change pattern so we need to check to see if it was consumed afterwards. - todd Index: lib/libc/gen/fnmatch.c === RCS file: /cvs/src/lib/libc/gen/fnmatch.c,v retrieving revision 1.18 diff -u -p -

Re: buffer overrun in fnmatch.c

2015-07-31 Thread Todd C. Miller
On Fri, 31 Jul 2015 21:16:51 +0200, Stefan Sperling wrote: > That's much cleaner and I can confirm it fixes the issue. > Can we move the break on the next line? Apart from that, ok with me. Sure. I also verified the fix with valgrind. - todd Index: lib/libc/gen/fnmatch.c =

Re: Potential free uninitialized pointer in kern_ktrace.c

2015-08-01 Thread Todd C. Miller
On Sat, 01 Aug 2015 12:12:01 -0700, Philip Guenther wrote: > Since my error was moving code across a goto, I'm inclined to kill the > goto completely, like this: That is easier to follow to boot. OK millert@ - todd

Re: swapctl: use fork+exec instead of system

2015-08-13 Thread Todd C. Miller
On Thu, 13 Aug 2015 13:59:37 +0200, Sebastien Marie wrote: > The following patch change the system(3) call in swapctl(8) to > vfork(2)+exec(2). > > swapctl use it for invoking mount_nfs(8) when fstab contains option for > swapping to NFS files. > > Comments ? OK ? Since waitpid() can be interru

Re: swapctl: use fork+exec instead of system

2015-08-13 Thread Todd C. Miller
On Thu, 13 Aug 2015 20:06:57 +0200, Sebastien Marie wrote: > yes, it would be better ! thanks. > > updated diff below. Looks OK to me though I prefer my while() loops with braces. - todd

<    5   6   7   8   9   10   11   12   13   14   >