syscalls: add compat_16 tests for getresgid, getresuid
PATCH 1/1 syscalls: add compat_16 tests for getresgid, getresuid
Signed-off-by Steve Muckle <[email protected]>
--- testcases/kernel/syscalls/getresgid/Makefile | 2 +- testcases/kernel/syscalls/getresgid/getresgid01.c | 9 ++++----- testcases/kernel/syscalls/getresgid/getresgid02.c | 9 ++++----- testcases/kernel/syscalls/getresgid/getresgid03.c | 10 ++++------ testcases/kernel/syscalls/getresuid/Makefile | 2 +- testcases/kernel/syscalls/getresuid/getresuid01.c | 9 ++++----- testcases/kernel/syscalls/getresuid/getresuid02.c | 9 ++++----- testcases/kernel/syscalls/getresuid/getresuid03.c | 10 ++++------ testcases/kernel/syscalls/utils/compat_16.h | 12 ++++++++++++ 9 files changed, 38 insertions(+), 34 deletions(-)
testcases/kernel/syscalls/getresgid/Makefile +1 -1
@@ -19,5 +19,5 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk - +include $(abs_srcdir)/../utils/compat_16.mk include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/getresgid/getresgid01.c +4 -5
@@ -73,12 +73,11 @@#include <signal.h> #include "test.h" - -extern int getresgid (gid_t *,gid_t *,gid_t *); +#include "compat_16.h" char *TCID ="getresgid01" ;int TST_TOTAL =1 ; -gid_t pr_gid, pe_gid, ps_gid;/* calling process real/effective/saved gid */ +GID_T pr_gid, pe_gid, ps_gid;/* calling process real/effective/saved gid */ void setup ();/* Main setup function of test */ void cleanup ();/* cleanup function for the test */
@@ -86,7 +85,7 @@ void cleanup(); /* cleanup function for the test */int main (int ac,char **av) {int lc; -gid_t real_gid,/* real/eff./saved user id from getresgid() */ +GID_T real_gid,/* real/eff./saved user id from getresgid() */ eff_gid, sav_gid;tst_parse_opts (ac, av,NULL ,NULL );
@@ -101,7 +100,7 @@ int main(int ac, char **av)* Call getresgid() to get the real/effective/saved * user id's of the calling process. */ -TEST (getresgid (&real_gid, &eff_gid, &sav_gid)); +TEST (GETRESGID (cleanup, &real_gid, &eff_gid, &sav_gid));if (TEST_RETURN ==-1 ) { tst_resm(TFAIL, "getresgid() Failed, errno=%d : %s",
testcases/kernel/syscalls/getresgid/getresgid02.c +4 -5
@@ -75,14 +75,13 @@#include <pwd.h> #include "test.h" +#include "compat_16.h" #define LTPUSER "nobody" -extern int getresgid (gid_t *,gid_t *,gid_t *); -char *TCID ="getresgid02" ;int TST_TOTAL =1 ; -gid_t pr_gid, pe_gid, ps_gid;/* calling process real/effective/saved gid */ +GID_T pr_gid, pe_gid, ps_gid;/* calling process real/effective/saved gid */ void setup ();/* Main setup function of test */ void cleanup ();/* cleanup function for the test */
@@ -90,7 +89,7 @@ void cleanup(); /* cleanup function for the test */int main (int ac,char **av) {int lc; -gid_t real_gid,/* real/eff./saved user id from getresgid() */ +GID_T real_gid,/* real/eff./saved user id from getresgid() */ eff_gid, sav_gid;tst_parse_opts (ac, av,NULL ,NULL );
@@ -106,7 +105,7 @@ int main(int ac, char **av)* user id's of the calling process after * setregid() in setup. */ -TEST (getresgid (&real_gid, &eff_gid, &sav_gid)); +TEST (GETRESGID (cleanup, &real_gid, &eff_gid, &sav_gid));if (TEST_RETURN ==-1 ) { tst_resm(TFAIL, "getresgid() Failed, errno=%d : %s",
testcases/kernel/syscalls/getresgid/getresgid03.c +4 -6
@@ -77,13 +77,11 @@#include <pwd.h> #include "test.h" - -extern int getresgid (gid_t *,gid_t *,gid_t *); -extern int setresgid (gid_t ,gid_t ,gid_t ); +#include "compat_16.h" char *TCID ="getresgid03" ;int TST_TOTAL =1 ; -gid_t pr_gid, pe_gid, ps_gid;/* calling process real/effective/saved gid */ +GID_T pr_gid, pe_gid, ps_gid;/* calling process real/effective/saved gid */ void setup ();/* Main setup function of test */ void cleanup ();/* cleanup function for the test */
@@ -91,7 +89,7 @@ void cleanup(); /* cleanup function for the test */int main (int ac,char **av) {int lc; -gid_t real_gid,/* real/eff./saved user id from getresgid() */ +GID_T real_gid,/* real/eff./saved user id from getresgid() */ eff_gid, sav_gid;tst_parse_opts (ac, av,NULL ,NULL );
@@ -107,7 +105,7 @@ int main(int ac, char **av)* user id's of the calling process after * setregid() in setup. */ -TEST (getresgid (&real_gid, &eff_gid, &sav_gid)); +TEST (GETRESGID (cleanup, &real_gid, &eff_gid, &sav_gid));if (TEST_RETURN ==-1 ) { tst_resm(TFAIL, "getresgid() Failed, errno=%d : %s",
testcases/kernel/syscalls/getresuid/Makefile +1 -1
@@ -19,5 +19,5 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk - +include $(abs_srcdir)/../utils/compat_16.mk include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/getresuid/getresuid01.c +4 -5
@@ -72,12 +72,11 @@#include <signal.h> #include "test.h" - -extern int getresuid (uid_t *,uid_t *,uid_t *); +#include "compat_16.h" char *TCID ="getresuid01" ;int TST_TOTAL =1 ; -uid_t pr_uid, pe_uid, ps_uid;/* calling process real/effective/saved uid */ +UID_T pr_uid, pe_uid, ps_uid;/* calling process real/effective/saved uid */ void setup ();/* Main setup function of test */ void cleanup ();/* cleanup function for the test */
@@ -85,7 +84,7 @@ void cleanup(); /* cleanup function for the test */int main (int ac,char **av) {int lc; -uid_t real_uid,/* real/eff./saved user id from getresuid() */ +UID_T real_uid,/* real/eff./saved user id from getresuid() */ eff_uid, sav_uid;tst_parse_opts (ac, av,NULL ,NULL );
@@ -100,7 +99,7 @@ int main(int ac, char **av)* Call getresuid() to get the real/effective/saved * user id's of the calling process. */ -TEST (getresuid (&real_uid, &eff_uid, &sav_uid)); +TEST (GETRESUID (cleanup, &real_uid, &eff_uid, &sav_uid));if (TEST_RETURN ==-1 ) { tst_resm(TFAIL, "getresuid() Failed, errno=%d : %s",
testcases/kernel/syscalls/getresuid/getresuid02.c +4 -5
@@ -75,14 +75,13 @@#include <pwd.h> #include "test.h" +#include "compat_16.h" #define LTPUSER "nobody" -extern int getresuid (uid_t *,uid_t *,uid_t *); -char *TCID ="getresuid02" ;int TST_TOTAL =1 ; -uid_t pr_uid, pe_uid, ps_uid;/* calling process real/effective/saved uid */ +UID_T pr_uid, pe_uid, ps_uid;/* calling process real/effective/saved uid */ void setup ();/* Main setup function of test */ void cleanup ();/* cleanup function for the test */
@@ -90,7 +89,7 @@ void cleanup(); /* cleanup function for the test */int main (int ac,char **av) {int lc; -uid_t real_uid,/* real/eff./saved user id from getresuid() */ +UID_T real_uid,/* real/eff./saved user id from getresuid() */ eff_uid, sav_uid;tst_parse_opts (ac, av,NULL ,NULL );
@@ -106,7 +105,7 @@ int main(int ac, char **av)* user id's of the calling process after * setreuid() in setup. */ -TEST (getresuid (&real_uid, &eff_uid, &sav_uid)); +TEST (GETRESUID (cleanup, &real_uid, &eff_uid, &sav_uid));if (TEST_RETURN ==-1 ) { tst_resm(TFAIL, "getresuid() Failed, errno=%d : %s",
testcases/kernel/syscalls/getresuid/getresuid03.c +4 -6
@@ -76,13 +76,11 @@#include <pwd.h> #include "test.h" - -extern int getresuid (uid_t *,uid_t *,uid_t *); -extern int setresuid (uid_t ,uid_t ,uid_t ); +#include "compat_16.h" char *TCID ="getresuid03" ;int TST_TOTAL =1 ; -uid_t pr_uid, pe_uid, ps_uid;/* calling process real/effective/saved uid */ +UID_T pr_uid, pe_uid, ps_uid;/* calling process real/effective/saved uid */ void setup ();/* Main setup function of test */ void cleanup ();/* cleanup function for the test */
@@ -90,7 +88,7 @@ void cleanup(); /* cleanup function for the test */int main (int ac,char **av) {int lc; -uid_t real_uid,/* real/eff./saved user id from getresuid() */ +UID_T real_uid,/* real/eff./saved user id from getresuid() */ eff_uid, sav_uid;tst_parse_opts (ac, av,NULL ,NULL );
@@ -106,7 +104,7 @@ int main(int ac, char **av)* user id's of the calling process after * setreuid() in setup. */ -TEST (getresuid (&real_uid, &eff_uid, &sav_uid)); +TEST (GETRESUID (cleanup, &real_uid, &eff_uid, &sav_uid));if (TEST_RETURN ==-1 ) { tst_resm(TFAIL, "getresuid() Failed, errno=%d : %s",
testcases/kernel/syscalls/utils/compat_16.h +12 -0
@@ -35,7 +35,9 @@#include "lapi/syscalls.h" int setresuid (uid_t ruid,uid_t euid,uid_t suid); +int getresuid (uid_t *ruid,uid_t *euid,uid_t *suid);int setresgid (gid_t rgid,gid_t egid,gid_t sgid); +int getresgid (gid_t *rgid,gid_t *egid,gid_t *sgid);/* If the platform has __NR_sys_name32 defined it
@@ -136,11 +138,21 @@ int SETRESUID(void (cleanup)(void), UID_T ruid, UID_T euid, UID_T suid)LTP_CREATE_SYSCALL (setresuid, cleanup, ruid, euid, suid); } +int GETRESUID (void (cleanup )(void ),UID_T *ruid,UID_T *euid,UID_T *suid) +{ +LTP_CREATE_SYSCALL (getresuid, cleanup, ruid, euid, suid); +} +int SETRESGID (void (cleanup )(void ),GID_T rgid,GID_T egid,GID_T sgid) {LTP_CREATE_SYSCALL (setresgid, cleanup, rgid, egid, sgid); } +int GETRESGID (void (cleanup )(void ),GID_T *rgid,GID_T *egid,GID_T *sgid) +{ +LTP_CREATE_SYSCALL (getresgid, cleanup, rgid, egid, sgid); +} +int FCHOWN (void (cleanup )(void ),unsigned int fd,UID_T owner,GID_T group) {LTP_CREATE_SYSCALL (fchown, cleanup, fd, owner, group);
Signature · 1 line
2.20.1.321.g9e740568ce-goog
PATCH 1/1 syscalls: add compat_16 tests for getresgid, getresuid
Hi Steve,
Quoted 1 line
Signed-off-by Steve Muckle <[email protected]>
Reviewed-by Petr Vorel <[email protected]>
Thanks for your patch!
Kind regards,
Petr
Petr Vorel
AppliedPATCH 1/1 syscalls: add compat_16 tests for getresgid, getresuid
In reply to Steve MuckleHi Steve,
Quoted 1 line
Signed-off-by Steve Muckle <[email protected]>
Merged, thanks!
Kind regards,
Petr