void-packages/srcpkgs/criu/patches/capsetget.patch
Đoàn Trần Công Danh c987560802 srcpkgs/c*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

31 lines
780 B
Diff

diff --git a/criu/namespaces.c b/criu/namespaces.c
index 05d75d5..9d9bf5a 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -9,7 +9,7 @@
#include <stdarg.h>
#include <signal.h>
#include <sched.h>
-#include <sys/capability.h>
+#include <linux/capability.h>
#include <sys/stat.h>
#include <limits.h>
#include <errno.h>
@@ -888,13 +888,13 @@ static int check_user_ns(int pid)
hdr.version = _LINUX_CAPABILITY_VERSION_3;
hdr.pid = 0;
- if (capget(&hdr, data) < 0) {
+ if (syscall(SYS_capget, &hdr, data) < 0) {
pr_perror("capget");
exit(1);
}
data[0].effective = data[0].permitted;
data[1].effective = data[1].permitted;
- if (capset(&hdr, data) < 0) {
+ if (syscall(SYS_capset, &hdr, data) < 0) {
pr_perror("capset");
exit(1);
}