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