public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH 0/1] tst API for dropping or requiring capabilities
@ 2019-08-08 15:38 Richard Palethorpe
  2019-08-08 15:38 ` [LTP] [RFC PATCH 1/1] capability: Introduce capability API Richard Palethorpe
  2019-08-09 12:18 ` [LTP] [RFC PATCH 0/1] tst API for dropping or requiring capabilities Cyril Hrubis
  0 siblings, 2 replies; 16+ messages in thread
From: Richard Palethorpe @ 2019-08-08 15:38 UTC (permalink / raw)
  To: ltp

Hello,

This API allows one to drop or require particular capabilities after setup.

It can be used like this:

	.caps = (struct tst_cap []) {
		TST_CAP(TST_DROP, CAP_SYS_ADMIN),
		{0, 0, 0},
	},

or

	.caps = (struct tst_cap []) {
	        TST_CAP(TST_DROP, CAP_SYS_ADMIN)
		TST_CAP(TST_REQUIRE, CAP_SOMETHING),
		{0, 0, 0},
	},

It uses capget and capset directly so that we do not need to link to libcap.

Richard Palethorpe (1):
  capability: Introduce capability API

 include/tst_capability.h | 56 +++++++++++++++++++++++++++++
 include/tst_test.h       |  6 ++++
 lib/tst_capability.c     | 78 ++++++++++++++++++++++++++++++++++++++++
 lib/tst_test.c           |  3 ++
 4 files changed, 143 insertions(+)
 create mode 100644 include/tst_capability.h
 create mode 100644 lib/tst_capability.c

-- 
2.22.0


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

end of thread, other threads:[~2019-08-23  8:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-08 15:38 [LTP] [RFC PATCH 0/1] tst API for dropping or requiring capabilities Richard Palethorpe
2019-08-08 15:38 ` [LTP] [RFC PATCH 1/1] capability: Introduce capability API Richard Palethorpe
2019-08-09 12:27   ` Cyril Hrubis
2019-08-09 14:42     ` Jan Stancek
2019-08-21 11:43     ` Richard Palethorpe
2019-08-15  7:10   ` Li Wang
2019-08-21 11:56     ` Richard Palethorpe
2019-08-22  5:56     ` Yang Xu
2019-08-22  8:41   ` Yang Xu
2019-08-22  9:35     ` Richard Palethorpe
2019-08-22 14:17   ` [LTP] [PATCH v2 1/2] " Richard Palethorpe
2019-08-22 14:17     ` [LTP] [PATCH v2 2/2] capability: library tests Richard Palethorpe
2019-08-23  4:33       ` Yang Xu
2019-08-23  4:24     ` [LTP] [PATCH v2 1/2] capability: Introduce capability API Yang Xu
2019-08-23  8:37       ` Richard Palethorpe
2019-08-09 12:18 ` [LTP] [RFC PATCH 0/1] tst API for dropping or requiring capabilities Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox