public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] [v2,1/4] syscalls/chroot01: Convert to new API
Date: Mon, 9 Aug 2021 15:41:19 +0200	[thread overview]
Message-ID: <YREwf0nD/azWBuiy@yuki> (raw)
In-Reply-To: <20210806035952.18150-1-zhanglianjie@uniontech.com>

Hi!
Pushed with a minor changes.

Most important is that the description comment section should be called
[Description] not [DESCRIPTION].

Full diff:

diff --git a/testcases/kernel/syscalls/chroot/chroot01.c b/testcases/kernel/syscalls/chroot/chroot01.c
index bddbf0db5..581bd54ac 100644
--- a/testcases/kernel/syscalls/chroot/chroot01.c
+++ b/testcases/kernel/syscalls/chroot/chroot01.c
@@ -4,9 +4,10 @@
  */
 
 /*\
- * [DESCRIPTION]
+ * [Description]
  *
  * Testcase to check the whether chroot sets errno to EPERM.
+ *
  * As a non-root user attempt to perform chroot() to a directory. The
  * chroot() call should fail with EPERM
  */
@@ -16,18 +17,18 @@
 #include "tst_test.h"
 
 static char *path;
-static char nobody_uid[] = "nobody";
-static struct passwd *ltpuser;
 
 static void verify_chroot(void)
 {
-	TST_EXP_FAIL(chroot(path), EPERM, "chroot set errno to EPERM.");
+	TST_EXP_FAIL(chroot(path), EPERM, "unprivileged chroot()");
 }
 
 static void setup(void)
 {
+	struct passwd *ltpuser;
+
 	path = tst_get_tmpdir();
-	ltpuser = SAFE_GETPWNAM(nobody_uid);
+	ltpuser = SAFE_GETPWNAM("nobody");
 	SAFE_SETEUID(ltpuser->pw_uid);
 }
 

-- 
Cyril Hrubis
chrubis@suse.cz

      reply	other threads:[~2021-08-09 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06  3:59 [LTP] [PATCH] [v2,1/4] syscalls/chroot01: Convert to new API zhanglianjie
2021-08-09 13:41 ` Cyril Hrubis [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=YREwf0nD/azWBuiy@yuki \
    --to=chrubis@suse.cz \
    --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