All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] setuid01: use TST_EXP_PASS() macro, docparse comment and reword
@ 2022-08-10  5:14 Avinesh Kumar
  2022-08-10  6:45 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Avinesh Kumar @ 2022-08-10  5:14 UTC (permalink / raw)
  To: ltp

Signed-off-by: Avinesh Kumar <akumar@suse.de>
---
 testcases/kernel/syscalls/setuid/setuid01.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/testcases/kernel/syscalls/setuid/setuid01.c b/testcases/kernel/syscalls/setuid/setuid01.c
index 0a0a03a48..ed42ceda1 100644
--- a/testcases/kernel/syscalls/setuid/setuid01.c
+++ b/testcases/kernel/syscalls/setuid/setuid01.c
@@ -3,10 +3,11 @@
  * Copyright (c) International Business Machines Corp., 2001
  */
 
-/* DESCRIPTION
- *	This test will verify that setuid(2) syscall basic functionality.
- *	setuid(2) returns a value of 0 and uid has been set successfully
- *	as a normal or super user.
+/*
+ * [Description]
+ *
+ * Verify that setuid(2) returns 0 and effective uid has
+ * been set successfully as a normal or super user.
  */
 
 #include <errno.h>
@@ -19,15 +20,10 @@ static void verify_setuid(void)
 {
 	uid_t uid;
 
-	/* Set the effective user ID to the current real uid */
 	uid = getuid();
 	UID16_CHECK(uid, setuid);
 
-	TEST(SETUID(uid));
-	if (TST_RET == -1)
-		tst_res(TFAIL | TTERRNO, "setuid(%d) failed", uid);
-	else
-		tst_res(TPASS, "setuid(%d) successfully", uid);
+	TST_EXP_PASS(SETUID(uid), "setuid(%d)", uid);
 }
 
 static struct tst_test test = {
-- 
2.36.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-10  6:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-10  5:14 [LTP] [PATCH] setuid01: use TST_EXP_PASS() macro, docparse comment and reword Avinesh Kumar
2022-08-10  6:45 ` Petr Vorel

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.