mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 05:48:05 +00:00
zdtm: check bset in caps00
Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
803321abf6
commit
42d861bb48
@ -2,6 +2,8 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <linux/capability.h>
|
||||
|
||||
#include "zdtmtst.h"
|
||||
|
||||
@ -61,6 +63,11 @@ int main(int argc, char **argv)
|
||||
struct cap_data data[_LINUX_CAPABILITY_U32S_3];
|
||||
struct cap_data data_2[_LINUX_CAPABILITY_U32S_3];
|
||||
|
||||
if (prctl(PR_CAPBSET_DROP, CAP_SETPCAP, 0, 0, 0)) {
|
||||
err("PR_CAPBSET_DROP");
|
||||
return -1;
|
||||
}
|
||||
|
||||
hdr.version = _LINUX_CAPABILITY_VERSION_3;
|
||||
hdr.pid = 0;
|
||||
|
||||
@ -114,6 +121,11 @@ int main(int argc, char **argv)
|
||||
goto bad;
|
||||
}
|
||||
|
||||
if (prctl(PR_CAPBSET_READ, CAP_SETPCAP, 0, 0, 0) != 0) {
|
||||
res='5';
|
||||
goto bad;
|
||||
}
|
||||
|
||||
res = '0';
|
||||
bad:
|
||||
write(result_pipe[1], &res, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user