public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 1/9] testcases: su: Fix userdel use
Date: Mon, 23 Apr 2018 14:51:50 +0200	[thread overview]
Message-ID: <20180423145150.3e1c9fdc@windsurf> (raw)
In-Reply-To: <20180423101309.GC24481@rei>

Hello,

On Mon, 23 Apr 2018 12:13:09 +0200, Cyril Hrubis wrote:

> > diff --git a/testcases/commands/su/su01 b/testcases/commands/su/su01
> > index 34386d937..1eedcb636 100755
> > --- a/testcases/commands/su/su01
> > +++ b/testcases/commands/su/su01
> > @@ -86,7 +86,8 @@ rm -f $TEST_ENV_FILE > /dev/null 2>&1
> >  #Create 1st test user
> >      #erase user if he may exist , so we can have a clean en
> >          rm -rf /home/$TEST_USER1
> > -        getent passwd $TEST_USER1 > /dev/null 2>&1 && userdel $TEST_USER1
> > +        getent passwd $TEST_USER1 > /dev/null 2>&1
> > +	userdel $TEST_USER1  
> 
> I'm pretty sure this was intended to be:
> 
> "delete user only if it exists already"
> 
> So the whole getent line is useless after this change.

Perhaps the getent line can be replaced with something like:

grep -q "^$TEST_USER1:" /etc/passwd && userdel $TEST_USER1

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-04-23 12:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23  9:46 [LTP] [RFC PATCH 0/9] testcases: small improvements with TCONF =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23  9:46 ` [LTP] [RFC PATCH 1/9] testcases: su: Fix userdel use =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:13   ` Cyril Hrubis
2018-04-23 12:51     ` Thomas Petazzoni [this message]
2018-04-23  9:46 ` [LTP] [RFC PATCH 2/9] testcases: ar: Add TST_NEEDS_CMDS on "ar" =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:25   ` Cyril Hrubis
2018-04-27 13:37     ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16  9:27   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 3/9] testcases: file: Add TST_NEEDS_CMDS on readelf =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16  9:34   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 4/9] testcases: tar: Add TST_NEEDS_CMDS on gzip and bzip =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16  9:38   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 5/9] testcases: logrotate: Check if "file" command exists =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16  9:45   ` Petr Vorel
2018-05-16 10:20   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 6/9] testcases: wc: Add "unrecognized option" as TCONF =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-05-16 10:00   ` Petr Vorel
2018-05-29 16:32     ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-06-04 15:22       ` Petr Vorel
2018-06-05  6:21         ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-06-04 15:33   ` Petr Vorel
2018-04-23  9:46 ` [LTP] [RFC PATCH 7/9] testcases: df: Add "--printf" option as needed commands =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:22   ` Cyril Hrubis
2018-04-23 13:27     ` Petr Vorel
2018-04-27  9:38       ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23  9:46 ` [LTP] [RFC PATCH 8/9] testcases: test.sh: Check if "getconf" is available =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:17   ` Cyril Hrubis
2018-04-27  9:39     ` =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23  9:46 ` [LTP] [RFC PATCH 9/9] testcases: cpuset: " =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-04-23 10:19   ` Cyril Hrubis

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=20180423145150.3e1c9fdc@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=ltp@lists.linux.it \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox