diff options
author | 2019-07-07 18:01:21 +0200 | |
---|---|---|
committer | 2019-07-07 18:01:21 +0200 | |
commit | fb7cb5973283533cca7a7df6ca28753176ff310f (patch) | |
tree | a8b11e9e0bab9764cc27fdc69046d5419ca1ed96 /src | |
parent | Add to comment on pip install in youtube-dl.profile (diff) | |
download | firejail-fb7cb5973283533cca7a7df6ca28753176ff310f.tar.gz firejail-fb7cb5973283533cca7a7df6ca28753176ff310f.tar.zst firejail-fb7cb5973283533cca7a7df6ca28753176ff310f.zip |
Use __clone2 on ia64
clone has a different interfaces there, as the stack size
needs to be known.
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/main.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index 34c6f4044..1e2488062 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -38,6 +38,15 @@ | |||
38 | #include <net/if.h> | 38 | #include <net/if.h> |
39 | #include <sys/utsname.h> | 39 | #include <sys/utsname.h> |
40 | 40 | ||
41 | #ifdef __ia64__ | ||
42 | /* clone(2) has a different interface on ia64, as it needs to know | ||
43 | the size of the stack */ | ||
44 | int __clone2(int (*fn)(void *), | ||
45 | void *child_stack_base, size_t stack_size, | ||
46 | int flags, void *arg, ... | ||
47 | /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ ); | ||
48 | #endif | ||
49 | |||
41 | uid_t firejail_uid = 0; | 50 | uid_t firejail_uid = 0; |
42 | gid_t firejail_gid = 0; | 51 | gid_t firejail_gid = 0; |
43 | 52 | ||
@@ -2541,10 +2550,18 @@ int main(int argc, char **argv) { | |||
2541 | 2550 | ||
2542 | EUID_ASSERT(); | 2551 | EUID_ASSERT(); |
2543 | EUID_ROOT(); | 2552 | EUID_ROOT(); |
2553 | #ifdef __ia64__ | ||
2554 | child = __clone2(sandbox, | ||
2555 | child_stack, | ||
2556 | STACK_SIZE, | ||
2557 | flags, | ||
2558 | NULL); | ||
2559 | #else | ||
2544 | child = clone(sandbox, | 2560 | child = clone(sandbox, |
2545 | child_stack + STACK_SIZE, | 2561 | child_stack + STACK_SIZE, |
2546 | flags, | 2562 | flags, |
2547 | NULL); | 2563 | NULL); |
2564 | #endif | ||
2548 | if (child == -1) | 2565 | if (child == -1) |
2549 | errExit("clone"); | 2566 | errExit("clone"); |
2550 | EUID_USER(); | 2567 | EUID_USER(); |