Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- a/linux-user/syscall.c 2014-01-05 17:53:52.931343033 +0400
- +++ b/linux-user/syscall.c 2014-01-05 18:50:44.167192784 +0400
- @@ -109,6 +109,7 @@
- #include <linux/filter.h>
- #include "linux_loop.h"
- #include "cpu-uname.h"
- +#include "sys/capability.h"
- #include "qemu.h"
- @@ -7723,9 +7724,35 @@
- unlock_user(p, arg1, ret);
- break;
- case TARGET_NR_capget:
- - goto unimplemented;
- + {
- + struct __user_cap_header_struct *target_hdrp;
- + struct __user_cap_data_struct *target_datap;
- +
- + if (!lock_user_struct(VERIFY_READ, target_hdrp, arg1, 1)) goto efault;
- + if (!lock_user_struct(VERIFY_WRITE, target_datap, arg2, 1)) {
- + unlock_user_struct(target_hdrp, arg1, 0);
- + goto efault;
- + }
- + ret = get_errno( capget( target_hdrp, target_datap) );
- + unlock_user_struct(target_hdrp, arg1, 0);
- + unlock_user_struct(target_datap, arg2, 1);
- + break;
- + }
- case TARGET_NR_capset:
- - goto unimplemented;
- + {
- + struct __user_cap_header_struct *target_hdrp;
- + struct __user_cap_data_struct *target_datap;
- +
- + if (!lock_user_struct(VERIFY_READ, target_hdrp, arg1, 1)) goto efault;
- + if (!lock_user_struct(VERIFY_READ, target_datap, arg2, 1)) {
- + unlock_user_struct(target_hdrp, arg1, 0);
- + goto efault;
- + }
- + ret = get_errno( capset( target_hdrp, target_datap) );
- + unlock_user_struct(target_hdrp, arg1, 0);
- + unlock_user_struct(target_datap, arg2, 0);
- + break;
- + }
- case TARGET_NR_sigaltstack:
- #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_MIPS) || \
- defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_ALPHA) || \
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement