Blame cjdns.cap3.patch

2f8dfd
diff -up ./util/Setuid_linux.c.cap3 ./util/Setuid_linux.c
2f8dfd
--- ./util/Setuid_linux.c.cap3	2016-01-31 22:04:56.591743457 -0500
2f8dfd
+++ ./util/Setuid_linux.c	2016-01-31 22:05:42.699060985 -0500
2f8dfd
@@ -50,9 +50,9 @@ static inline int capGet(cap_user_header
2f8dfd
 void Setuid_preSetuid(struct Allocator* alloc, struct Except* eh)
2f8dfd
 {
2f8dfd
     cap_user_header_t hdr = Allocator_calloc(alloc, sizeof(*hdr), 1);
2f8dfd
-    cap_user_data_t data = Allocator_calloc(alloc, sizeof(*data), 1);
2f8dfd
+    cap_user_data_t data = Allocator_calloc(alloc, sizeof(*data), 2);
2f8dfd
 
2f8dfd
-    hdr->version = _LINUX_CAPABILITY_VERSION;
2f8dfd
+    hdr->version = _LINUX_CAPABILITY_VERSION_3;
2f8dfd
     hdr->pid = 0;
2f8dfd
     if (capGet(hdr, data)) {
2f8dfd
         Except_throw(eh, "Error getting capabilities: [errno:%d (%s)]", errno, strerror(errno));
2f8dfd
@@ -73,9 +73,9 @@ void Setuid_preSetuid(struct Allocator*
2f8dfd
 void Setuid_postSetuid(struct Allocator* alloc, struct Except* eh)
2f8dfd
 {
2f8dfd
     cap_user_header_t hdr = Allocator_calloc(alloc, sizeof(*hdr), 1);
2f8dfd
-    cap_user_data_t data = Allocator_calloc(alloc, sizeof(*data), 1);
2f8dfd
+    cap_user_data_t data = Allocator_calloc(alloc, sizeof(*data), 2);
2f8dfd
 
2f8dfd
-    hdr->version = _LINUX_CAPABILITY_VERSION;
2f8dfd
+    hdr->version = _LINUX_CAPABILITY_VERSION_3;
2f8dfd
     hdr->pid = 0;
2f8dfd
     if (capGet(hdr, data)) {
2f8dfd
         Except_throw(eh, "Error getting capabilities (post-setuid): [errno:%d (%s)]",