Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-07 Thread Vincent Lefevre
On 2016-09-07 15:41:03 -0500, Derek Martin wrote: > On Wed, Sep 07, 2016 at 09:10:09AM -0500, Derek Martin wrote: > > Like I said, I'm familiar with the do {} while (0) construct, but I > > could swear I ran into an odd case where it caused some sort of > > problem... > > There are several possi

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-07 Thread Vincent Lefevre
On 2016-09-07 09:10:09 -0500, Derek Martin wrote: > On Wed, Sep 07, 2016 at 01:26:35PM +0200, Vincent Lefevre wrote: > > > Firstly, I'll note that, given the existing macros don't seem to have > > > caused anyone any grief, the exact macro syntax is largely an academic > > > consideration. =8^) >

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-07 Thread Derek Martin
On Wed, Sep 07, 2016 at 09:10:09AM -0500, Derek Martin wrote: > Like I said, I'm familiar with the do {} while (0) construct, but I > could swear I ran into an odd case where it caused some sort of > problem... There are several possibilities here. There are probably others, but I can think of

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-07 Thread Derek Martin
On Wed, Sep 07, 2016 at 01:26:35PM +0200, Vincent Lefevre wrote: > > Firstly, I'll note that, given the existing macros don't seem to have > > caused anyone any grief, the exact macro syntax is largely an academic > > consideration. =8^) > > Not really. Code gets modified. So, bugs may appear in

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-07 Thread Vincent Lefevre
On 2016-09-06 12:44:21 -0700, Kevin J. McCarthy wrote: > On Tue, Sep 06, 2016 at 01:39:18PM -0400, Damien Riegel wrote: > > Quick question, mutt has snprintf.c which implements snprintf and > > vsnprintf. Now that mutt requires a C99 compiler, is this file (and > > checks in configure) still needed

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-07 Thread Vincent Lefevre
On 2016-09-06 10:44:12 -0500, Derek Martin wrote: > On Tue, Sep 06, 2016 at 01:10:36PM +0200, Vincent Lefevre wrote: > > On 2016-09-05 19:07:18 -0500, Derek Martin wrote: > > > On Mon, Sep 05, 2016 at 10:32:40AM -0500, Derek Martin wrote: > > > > Is strfcpy() widely available? > > > > > > Ah, no

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-06 Thread Derek Martin
On Tue, Sep 06, 2016 at 12:36:12PM -0700, Kevin J. McCarthy wrote: > On Mon, Sep 05, 2016 at 07:07:18PM -0500, Derek Martin wrote: > I need to think about this. I'm nervous about this approach, because > I'm not convinced all the possible string truncations are of sufficient > severity to warrant

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-06 Thread Kevin J. McCarthy
On Tue, Sep 06, 2016 at 01:39:18PM -0400, Damien Riegel wrote: > Quick question, mutt has snprintf.c which implements snprintf and > vsnprintf. Now that mutt requires a C99 compiler, is this file (and > checks in configure) still needed? Probably not. I'm not really in a hurry to rip it out, thou

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-06 Thread Kevin J. McCarthy
On Mon, Sep 05, 2016 at 07:07:18PM -0500, Derek Martin wrote: > The abort on failure is annoying, but better than a potential security > hole caused by silently truncating sensitive data, and the abort > mostly shouldn't ever happen. I need to think about this. I'm nervous about this approach, be

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-06 Thread Damien Riegel
On Mon, Sep 05, 2016 at 07:07:18PM -0500, Derek Martin wrote: > On Mon, Sep 05, 2016 at 10:32:40AM -0500, Derek Martin wrote: > > Is strfcpy() widely available? > > Ah, now I see that strfcpy() is a Mutt-specific macro that intends to > make strncpy() safer. I was actually thinking of strlcpy()

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-06 Thread Derek Martin
On Tue, Sep 06, 2016 at 01:10:36PM +0200, Vincent Lefevre wrote: > On 2016-09-05 19:07:18 -0500, Derek Martin wrote: > > On Mon, Sep 05, 2016 at 10:32:40AM -0500, Derek Martin wrote: > > > Is strfcpy() widely available? > > > > Ah, now I see that strfcpy() is a Mutt-specific macro that intends t

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-06 Thread Vincent Lefevre
On 2016-09-05 19:07:18 -0500, Derek Martin wrote: > On Mon, Sep 05, 2016 at 10:32:40AM -0500, Derek Martin wrote: > > Is strfcpy() widely available? > > Ah, now I see that strfcpy() is a Mutt-specific macro that intends to > make strncpy() safer. I was actually thinking of strlcpy(), which is >

Re: [SPAM?] Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-05 Thread Derek Martin
On Mon, Sep 05, 2016 at 05:02:33PM -0700, David Champion wrote: > To be clear, I'm totally fine with Kevin's suggested change, and will > make it. I just don't want acceptance of a single patch to depend on an > open-ended discussion about mutt's preferred style or the broader issues > of C string

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-05 Thread Derek Martin
On Mon, Sep 05, 2016 at 10:32:40AM -0500, Derek Martin wrote: > Is strfcpy() widely available? Ah, now I see that strfcpy() is a Mutt-specific macro that intends to make strncpy() safer. I was actually thinking of strlcpy(), which is equivalent to Mutt's strfcpy(); but it does not matter. ALL

[SPAM?] Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-05 Thread David Champion
* On 05 Sep 2016, Lorenzo wrote: Apparently some hook failed to trigger. That was me. > > Is strfcpy() widely available? For instance, on the machine I'm using > > No. (It's a macro in mutt, so it's fine. I'm speaking to whether it's a general thing, which seemed to be Derek's question.) > o

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-05 Thread Derek Martin
On Sun, Sep 04, 2016 at 07:42:01PM -0700, Kevin J. McCarthy wrote: > Lastly, I'd recommend using strfcpy instead of strncpy below, just to > avoid the theoretical possibility where tmp->data is 1024 or bigger. > > > diff --git a/init.c b/init.c > > +/* Format var=value string */ > > +strnc

Re: [PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-09-04 Thread Kevin J. McCarthy
On Tue, Aug 30, 2016 at 05:52:58PM -0700, d...@bikeshed.us wrote: > > # HG changeset patch > # User David Champion > # Date 1472604759 25200 > # Tue Aug 30 17:52:39 2016 -0700 > # Node ID be92ca7a461efd7815d5f6b170292798b7c79b3c > # Parent 788059e7b1182f283c6d21139beaf9dd0d587035 > setenv/u

[PATCH] setenv/unsetenv for altering process environment (to affect children)

2016-08-30 Thread dgc
doc/manual.xml.head | 18 init.c | 113 init.h |3 + main.c | 15 ++- system.c|4 +- 5 files changed, 151 insertions(+), 2 deletions(-) # HG changeset patch # User Da