All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: Lenny Bruzenak <lenny@magitekltd.com>
Cc: linux-audit@redhat.com
Subject: Re: useradd question
Date: Mon, 20 May 2019 16:12:14 -0400	[thread overview]
Message-ID: <2529210.r6ccOtJCrL@x2> (raw)
In-Reply-To: <75873a5b-255c-9b31-1b0e-6a1552021ab1@magitekltd.com>

On Monday, May 20, 2019 4:05:55 PM EDT Lenny Bruzenak wrote:
> On 5/20/19 2:59 PM, Steve Grubb wrote:
> > So...I went digging through the source code of useradd.c. In main is this
> > 
> > comment:
> >         /*
> >         
> >          * Do the hard stuff:
> >          * - open the files,
> >          * - create the user entries,
> >          * - create the home directory,
> >          * - create user mail spool,
> >          * - flush nscd caches for passwd and group services,
> >          * - then close and update the files.
> >          */
> > 
> > If you dig around, you'll see in the above process it calls usr_update().
> > This is where the audit event is. The very next function call is
> > close_files. This is where it actually writes to the files where it
> > would be visible to auditd. So, it looks like auditing in shadow-utils
> > is busted.
> > 
> > I also see where its calling pam_tally2 which is deprecated for years. It
> > should be calling faillock. I'll chat with upstream maintainers.
> > 
> > -Steve
> 
> Thank you Steve, much appreciated! If they are able to provide a patch,
> would you mind asking them to send me a link and I'll test it ASAP?

Sure. But I think this is an architectural issue and won't be a quick fix. 
Also, I think this race is limited to useradd and groupadd. For everything 
else, the mapping should be on disk and visible.

-Steve

  reply	other threads:[~2019-05-20 20:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 23:00 useradd question Lenny Bruzenak
2019-05-17 12:44 ` Steve Grubb
2019-05-20 15:39   ` Lenny Bruzenak
2019-05-20 19:59     ` Steve Grubb
2019-05-20 20:05       ` Lenny Bruzenak
2019-05-20 20:12         ` Steve Grubb [this message]
2019-05-22 17:34         ` Steve Grubb
2019-05-22 18:23           ` Lenny Bruzenak

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=2529210.r6ccOtJCrL@x2 \
    --to=sgrubb@redhat.com \
    --cc=lenny@magitekltd.com \
    --cc=linux-audit@redhat.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.