Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Nikita Pettik <korablev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/1] app: os.setenv() affects os.environ()
Date: Wed, 19 Feb 2020 23:44:32 +0100	[thread overview]
Message-ID: <51dab8b1-f1e2-c025-2277-2d517b2f4de3@tarantool.org> (raw)
In-Reply-To: <20200219214245.GD40100@tarantool.org>

Hi! Thanks all for the reviews!

Pushed to master, 2.3, 2.2 and 1.10.

Also added a changelog record to the releases draft.
And here too, since I forgot to add it to the cover
letter (or that rule was added after my patch, don't
remember).

@ChangeLog
- os.environ() was not changed when os.setenv() was
  called (gh-4733).

On 19/02/2020 22:42, Nikita Pettik wrote:
> On 06 Feb 23:47, Vladislav Shpilevoy wrote:
>> os.setenv() and os.environ() are Lua API for
>>
>>     extern char **environ;
>>     int setenv();
>>
>> The Open Group standardized access points for environment
>> variables. But there is no a word about that environ never
>> changes. Programs can't relay on that. For example, addition of
>> a new variable may cause realloc of the whole environ array, and
>> therefore change of its pointer value. That was exactly the case
>> in os.environ() - it was using value of environ array remembered
>> when Tarantool started.
>>
>> And os.setenv() could realloc the array and turn the saved pointer
>> into garbage.
>>
>> Closes #4733
>> ---
> 
> LGTM
> 

      reply	other threads:[~2020-02-19 22:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 22:47 Vladislav Shpilevoy
2020-02-10 11:03 ` Igor Munkin
2020-02-19 21:42 ` Nikita Pettik
2020-02-19 22:44   ` Vladislav Shpilevoy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51dab8b1-f1e2-c025-2277-2d517b2f4de3@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/1] app: os.setenv() affects os.environ()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox