Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@freelists.org, Kirill Yukhin <kyukhin@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] lua: pwd: fix passwd and group traversal
Date: Mon, 26 Aug 2019 12:43:31 +0300	[thread overview]
Message-ID: <20190826094331.pj6kqw3vtbuszy2u@tkn_work_nb> (raw)
In-Reply-To: <22d67148-2b5d-e025-a739-6426d759e546@tarantool.org>

On Sun, Aug 25, 2019 at 08:03:13PM +0200, Vladislav Shpilevoy wrote:
> 
> 
> On 25/08/2019 13:07, Alexander Turenko wrote:
> > On Fri, Aug 23, 2019 at 10:26:05PM +0200, Vladislav Shpilevoy wrote:
> >> Hi! Thanks for the patch!
> >>
> >>> The primary reason of this commit is to overcome a startup hang on
> >>> CentOS 6.
> >>>
> >>> https://github.com/tarantool/tarantool/issues/4428
> >>> https://github.com/tarantool/tarantool/issues/4447
> >>> https://github.com/tarantool/tarantool/issues/4271
> >>> https://github.com/tarantool/tarantool/tree/Totktonada/gh-4447-fix-centos-6-startup-fail-full-ci
> >>>
> >>> Waiting for CI:
> >>> https://gitlab.com/tarantool/tarantool/pipelines/77906160
> >>>
> >>> I manually verified that tarantool starts on CentOS 6 after the change.
> >>> Also verified that the module can be used now on FreeBSD 12.0.
> >>>
> >>> I understood that the commit formally changes a behaviour that can be
> >>> visible for a user: it allows to pass cdata<struct passwd> to
> >>> pwd.getgr() and to pass cdata<struct group> to pwd.getgr(). It is
> >>> unlikely that one will want to use it or will find this ability by an
> >>> occasion. Maybe only with pwd.getpw(1LL) or so, but luajit will report
> >>> an error in the case. My intention was to keep the commit short and
> >>> avoid refactoring of the module code.
> >>
> >> But this module is not a rocket science, even its whole rewrite would
> >> not be hard. Here the refactoring is quite simple, please, consider
> >> my proposal on the branch and below. You can squash it or keep - anyway
> >> LGTM. Note, I didn't test my 'fixes', so perhaps they are totally wrong.
> >>
> >> =========================================================================
> > 
> >> +local function pwtotable(pw)
> >> +    return {
> >>          name    = ffi.string(pw.pw_name),
> >>          id      = tonumber(pw.pw_uid),
> >>          group   = getgr(pw.pw_gid),
> > 
> > I did the exactly same, but then observed that getgr() call should not
> > be part of pwtotable() function.
> 
> Why? It does not affect pw iterators.

It'll affect group iterator.

My idea was to split receiveing of data from 'deserialization'.

WBR, Alexander Turenko.

  reply	other threads:[~2019-08-26  9:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23  1:57 [tarantool-patches] " Alexander Turenko
2019-08-23 20:26 ` [tarantool-patches] " Vladislav Shpilevoy
2019-08-25 11:07   ` Alexander Turenko
2019-08-25 18:03     ` Vladislav Shpilevoy
2019-08-26  9:43       ` Alexander Turenko [this message]
2019-08-26 15:08 ` Kirill Yukhin

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=20190826094331.pj6kqw3vtbuszy2u@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH] lua: pwd: fix passwd and group traversal' \
    /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