Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add extattr_*() and __acl_*() syscall shims.

  • Loading branch information...
commit b231eb105f39dc669284f7734549f9b2b105eb09 1 parent 07badd2
staceyson authored
31 work/qemu-1.4.0/bsd-user/freebsd/strace.list
... ... @@ -1,3 +1,15 @@
  1 +{ TARGET_FREEBSD_NR___acl_aclcheck_fd, "__acl_get_fd", "%s(%d, %d, %#x)", NULL, NULL },
  2 +{ TARGET_FREEBSD_NR___acl_aclcheck_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
  3 +{ TARGET_FREEBSD_NR___acl_aclcheck_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
  4 +{ TARGET_FREEBSD_NR___acl_delete_fd, "__acl_delete_fd", "%s(%d, %d)", NULL, NULL },
  5 +{ TARGET_FREEBSD_NR___acl_delete_file, "__acl_delete_file", "%s(\"%s\", %d)", NULL, NULL },
  6 +{ TARGET_FREEBSD_NR___acl_delete_link, "__acl_delete_link", "%s(\"%s\", %d)", NULL, NULL },
  7 +{ TARGET_FREEBSD_NR___acl_get_fd, "__acl_get_fd", "%s(\"%s\", %d, %#x)", NULL, NULL },
  8 +{ TARGET_FREEBSD_NR___acl_get_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
  9 +{ TARGET_FREEBSD_NR___acl_get_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
  10 +{ TARGET_FREEBSD_NR___acl_set_fd, "__acl_get_fd", "%s(\"%s\", %d, %#x)", NULL, NULL },
  11 +{ TARGET_FREEBSD_NR___acl_set_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
  12 +{ TARGET_FREEBSD_NR___acl_set_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
1 13 { TARGET_FREEBSD_NR___getcwd, "__getcwd", NULL, NULL, NULL },
2 14 { TARGET_FREEBSD_NR___semctl, "__semctl", NULL, NULL, NULL },
3 15 { TARGET_FREEBSD_NR___syscall, "__syscall", NULL, NULL, NULL },
@@ -23,6 +35,19 @@
23 35 { TARGET_FREEBSD_NR_dup2, "dup2", NULL, NULL, NULL },
24 36 { TARGET_FREEBSD_NR_execve, "execve", NULL, print_execve, NULL },
25 37 { TARGET_FREEBSD_NR_exit, "exit", "%s(%d)\n", NULL, NULL },
  38 +{ TARGET_FREEBSD_NR_extattrctl, "extattrctl", "%s(\"%s\", %d, \"%s\", %d, \"%s\"", NULL, NULL },
  39 +{ TARGET_FREEBSD_NR_extattr_delete_fd, "extattr_delete_fd", "%s(%d, %d, \"%s\")", NULL, NULL },
  40 +{ TARGET_FREEBSD_NR_extattr_delete_file, "extattr_delete_file", "%s(\"%s\", %d, \"%s\")", NULL, NULL },
  41 +{ TARGET_FREEBSD_NR_extattr_delete_link, "extattr_delete_link", "%s(\"%s\", %d, \"%s\")", NULL, NULL },
  42 +{ TARGET_FREEBSD_NR_extattr_get_fd, "extattr_get_fd", "%s(%d, %d, \"%s\", %#x, %d)", NULL, NULL },
  43 +{ TARGET_FREEBSD_NR_extattr_get_file, "extattr_get_file", "%s(\"%s\", %d, \"%s\", %#x, %d)", NULL, NULL },
  44 +{ TARGET_FREEBSD_NR_extattr_get_file, "extattr_get_link", "%s(\"%s\", %d, \"%s\", %#x, %d)", NULL, NULL },
  45 +{ TARGET_FREEBSD_NR_extattr_list_fd, "extattr_list_fd", "%s(%d, %d, %#x, %d)", NULL, NULL },
  46 +{ TARGET_FREEBSD_NR_extattr_list_file, "extattr_list_file", "%s(\"%s\", %#x, %d)", NULL, NULL },
  47 +{ TARGET_FREEBSD_NR_extattr_list_link, "extattr_list_link", "%s(\"%s\", %d, %#x, %d)", NULL, NULL },
  48 +{ TARGET_FREEBSD_NR_extattr_set_fd, "extattr_set_fd", "%s(%d, %d, \"%s\", %#x, %d)", NULL, NULL },
  49 +{ TARGET_FREEBSD_NR_extattr_set_file, "extattr_set_file", "%s(\"%s\", %d, \"%s\", %#x, %d)", NULL, NULL },
  50 +{ TARGET_FREEBSD_NR_extattr_set_link, "extattr_set_link", "%s(\"%s\", %d, \"%s\", %#x, %d)", NULL, NULL },
26 51 { TARGET_FREEBSD_NR_fchdir, "fchdir", NULL, NULL, NULL },
27 52 { TARGET_FREEBSD_NR_fchflags, "fchflags", NULL, NULL, NULL },
28 53 { TARGET_FREEBSD_NR_fchmod, "fchmod", "%s(%d,%#o)", NULL, NULL },
@@ -34,8 +59,9 @@
34 59 { TARGET_FREEBSD_NR_flock, "flock", NULL, NULL, NULL },
35 60 { TARGET_FREEBSD_NR_fork, "fork", "%s()", NULL, NULL },
36 61 { TARGET_FREEBSD_NR_fpathconf, "fpathconf", NULL, NULL, NULL },
37   -{ TARGET_FREEBSD_NR_fstat, "fstat", "%s(%d,%p)", NULL, NULL },
38   -{ TARGET_FREEBSD_NR_fstatfs, "fstatfs", "%s(%d,%p)", NULL, NULL },
  62 +{ TARGET_FREEBSD_NR_fstat, "fstat", "%s(%d,%#x)", NULL, NULL },
  63 +{ TARGET_FREEBSD_NR_fstatat, "fstatat", "%s(%d,\"%s\", %#x)", NULL, NULL },
  64 +{ TARGET_FREEBSD_NR_fstatfs, "fstatfs", "%s(%d,%#x)", NULL, NULL },
39 65 { TARGET_FREEBSD_NR_fsync, "fsync", NULL, NULL, NULL },
40 66 { TARGET_FREEBSD_NR_ftruncate, "ftruncate", NULL, NULL, NULL },
41 67 { TARGET_FREEBSD_NR_futimes, "futimes", NULL, NULL, NULL },
@@ -99,6 +125,7 @@
99 125 { TARGET_FREEBSD_NR_nanosleep, "nanosleep", NULL, NULL, NULL },
100 126 { TARGET_FREEBSD_NR_nfssvc, "nfssvc", NULL, NULL, NULL },
101 127 { TARGET_FREEBSD_NR_open, "open", "%s(\"%s\",%#x,%#o)", NULL, NULL },
  128 +{ TARGET_FREEBSD_NR_openat, "openat", "%s(%d, \"%s\",%#x,%#o)", NULL, NULL },
102 129 { TARGET_FREEBSD_NR_pathconf, "pathconf", NULL, NULL, NULL },
103 130 { TARGET_FREEBSD_NR_pathconf, "pathconf", "%s(\"%s\", %d)", NULL, NULL },
104 131 { TARGET_FREEBSD_NR_pipe, "pipe", NULL, NULL, NULL },
455 work/qemu-1.4.0/bsd-user/syscall.c
@@ -70,6 +70,9 @@
70 70 #include <sys/ttycom.h>
71 71 #include <sys/reboot.h>
72 72 #include <sys/timex.h>
  73 +#define _ACL_PRIVATE
  74 +#include <sys/acl.h>
  75 +#include <sys/extattr.h>
73 76 #include <kenv.h>
74 77 #include <pthread.h>
75 78 #include <machine/atomic.h>
@@ -3416,6 +3419,64 @@ host_to_target_sched_param(abi_ulong target_addr, struct sched_param *host_sp)
3416 3419 }
3417 3420
3418 3421 static inline abi_long
  3422 +target_to_host_acl(struct acl *host_acl, abi_ulong target_addr)
  3423 +{
  3424 + uint32_t i;
  3425 + struct target_acl *target_acl;
  3426 +
  3427 + if (!lock_user_struct(VERIFY_READ, target_acl, target_addr, 1))
  3428 + return (-TARGET_EFAULT);
  3429 +
  3430 + __get_user(host_acl->acl_maxcnt, &target_acl->acl_maxcnt);
  3431 + __get_user(host_acl->acl_cnt, &target_acl->acl_cnt);
  3432 +
  3433 + for(i = 0; i < host_acl->acl_maxcnt; i++) {
  3434 + __get_user(host_acl->acl_entry[i].ae_tag,
  3435 + &target_acl->acl_entry[i].ae_tag);
  3436 + __get_user(host_acl->acl_entry[i].ae_id,
  3437 + &target_acl->acl_entry[i].ae_id);
  3438 + __get_user(host_acl->acl_entry[i].ae_perm,
  3439 + &target_acl->acl_entry[i].ae_perm);
  3440 + __get_user(host_acl->acl_entry[i].ae_entry_type,
  3441 + &target_acl->acl_entry[i].ae_entry_type);
  3442 + __get_user(host_acl->acl_entry[i].ae_flags,
  3443 + &target_acl->acl_entry[i].ae_flags);
  3444 + }
  3445 +
  3446 + unlock_user_struct(target_acl, target_addr, 0);
  3447 + return (0);
  3448 +}
  3449 +
  3450 +static inline abi_long
  3451 +host_to_target_acl(abi_ulong target_addr, struct acl *host_acl)
  3452 +{
  3453 + uint32_t i;
  3454 + struct target_acl *target_acl;
  3455 +
  3456 + if (!lock_user_struct(VERIFY_WRITE, target_acl, target_addr, 0))
  3457 + return (-TARGET_EFAULT);
  3458 +
  3459 + __put_user(host_acl->acl_maxcnt, &target_acl->acl_maxcnt);
  3460 + __put_user(host_acl->acl_cnt, &target_acl->acl_cnt);
  3461 +
  3462 + for(i = 0; i < host_acl->acl_maxcnt; i++) {
  3463 + __put_user(host_acl->acl_entry[i].ae_tag,
  3464 + &target_acl->acl_entry[i].ae_tag);
  3465 + __put_user(host_acl->acl_entry[i].ae_id,
  3466 + &target_acl->acl_entry[i].ae_id);
  3467 + __put_user(host_acl->acl_entry[i].ae_perm,
  3468 + &target_acl->acl_entry[i].ae_perm);
  3469 + __get_user(host_acl->acl_entry[i].ae_entry_type,
  3470 + &target_acl->acl_entry[i].ae_entry_type);
  3471 + __get_user(host_acl->acl_entry[i].ae_flags,
  3472 + &target_acl->acl_entry[i].ae_flags);
  3473 + }
  3474 +
  3475 + unlock_user_struct(target_acl, target_addr, 1);
  3476 + return (0);
  3477 +}
  3478 +
  3479 +static inline abi_long
3419 3480 do_sched_setparam(pid_t pid, abi_ulong target_sp_addr)
3420 3481 {
3421 3482 int ret;
@@ -5467,32 +5528,406 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
5467 5528 break;
5468 5529
5469 5530
5470   - case TARGET_FREEBSD_NR___acl_get_file:
5471   - case TARGET_FREEBSD_NR___acl_set_file:
5472   - case TARGET_FREEBSD_NR___acl_get_fd:
5473   - case TARGET_FREEBSD_NR___acl_set_fd:
5474   - case TARGET_FREEBSD_NR___acl_delete_file:
5475   - case TARGET_FREEBSD_NR___acl_delete_fd:
5476   - case TARGET_FREEBSD_NR___acl_aclcheck_file:
5477 5531 case TARGET_FREEBSD_NR___acl_aclcheck_fd:
  5532 + {
  5533 + struct acl host_acl;
  5534 +
  5535 + ret = target_to_host_acl(&host_acl, arg3);
  5536 + if (!is_error(ret))
  5537 + ret = get_errno(__acl_aclcheck_fd(arg1, arg2,
  5538 + &host_acl));
  5539 + }
  5540 + break;
  5541 +
  5542 + case TARGET_FREEBSD_NR___acl_aclcheck_file:
  5543 + {
  5544 + struct acl host_acl;
  5545 +
  5546 + if (!(p = lock_user_string(arg1)))
  5547 + goto efault;
  5548 +
  5549 + ret = target_to_host_acl(&host_acl, arg3);
  5550 + if (!is_error(ret))
  5551 + ret = get_errno(__acl_aclcheck_file(path(p) , arg2,
  5552 + &host_acl));
  5553 +
  5554 + unlock_user(p, arg1, 0);
  5555 + }
  5556 + break;
  5557 +
  5558 + case TARGET_FREEBSD_NR___acl_aclcheck_link:
  5559 + {
  5560 + struct acl host_acl;
  5561 +
  5562 + if (!(p = lock_user_string(arg1)))
  5563 + goto efault;
  5564 +
  5565 + ret = target_to_host_acl(&host_acl, arg3);
  5566 + if (!is_error(ret))
  5567 + ret = get_errno(__acl_aclcheck_link(path(p), arg2,
  5568 + &host_acl));
  5569 +
  5570 + unlock_user(p, arg1, 0);
  5571 + }
  5572 + break;
  5573 +
  5574 + case TARGET_FREEBSD_NR___acl_delete_fd:
  5575 + ret = get_errno(__acl_delete_fd(arg1, arg2));
  5576 + break;
  5577 +
  5578 + case TARGET_FREEBSD_NR___acl_delete_file:
  5579 + if (!(p = lock_user_string(arg1)))
  5580 + goto efault;
  5581 +
  5582 + ret = get_errno(__acl_delete_file(path(p), arg2));
  5583 +
  5584 + unlock_user(p, arg1, 0);
  5585 + break;
  5586 +
  5587 + case TARGET_FREEBSD_NR___acl_delete_link:
  5588 + if (!(p = lock_user_string(arg1)))
  5589 + goto efault;
  5590 +
  5591 + ret = get_errno(__acl_delete_link(path(p), arg2));
  5592 +
  5593 + unlock_user(p, arg1, 0);
  5594 + break;
  5595 +
  5596 + case TARGET_FREEBSD_NR___acl_get_fd:
  5597 + {
  5598 + struct acl host_acl;
  5599 +
  5600 + ret = get_errno(__acl_get_fd(arg1, arg2, &host_acl));
  5601 +
  5602 + if (!is_error(ret))
  5603 + ret = host_to_target_acl(arg3, &host_acl);
  5604 + }
  5605 + break;
  5606 +
  5607 + case TARGET_FREEBSD_NR___acl_get_file:
  5608 + {
  5609 + struct acl host_acl;
  5610 +
  5611 + if (!(p = lock_user_string(arg1)))
  5612 + goto efault;
  5613 +
  5614 + ret = get_errno(__acl_get_file(path(p), arg2, &host_acl));
  5615 +
  5616 + if (!is_error(ret))
  5617 + ret = host_to_target_acl(arg3, &host_acl);
  5618 +
  5619 + unlock_user(p, arg1, 0);
  5620 + }
  5621 + break;
  5622 +
5478 5623 case TARGET_FREEBSD_NR___acl_get_link:
  5624 + {
  5625 + struct acl host_acl;
  5626 +
  5627 + if (!(p = lock_user_string(arg1)))
  5628 + goto efault;
  5629 +
  5630 + ret = get_errno(__acl_get_link(path(p), arg2, &host_acl));
  5631 +
  5632 + if (!is_error(ret))
  5633 + ret = host_to_target_acl(arg3, &host_acl);
  5634 +
  5635 + unlock_user(p, arg1, 0);
  5636 + }
  5637 + break;
  5638 +
  5639 + case TARGET_FREEBSD_NR___acl_set_fd:
  5640 + {
  5641 + struct acl host_acl;
  5642 +
  5643 + if (!(p = lock_user_string(arg1)))
  5644 + goto efault;
  5645 +
  5646 + ret = target_to_host_acl(&host_acl, arg3);
  5647 + if (!is_error(ret))
  5648 + ret = get_errno(__acl_set_fd(arg1, arg2, &host_acl));
  5649 +
  5650 + unlock_user(p, arg1, 0);
  5651 + }
  5652 + break;
  5653 +
  5654 + case TARGET_FREEBSD_NR___acl_set_file:
  5655 + {
  5656 + struct acl host_acl;
  5657 +
  5658 + if (!(p = lock_user_string(arg1)))
  5659 + goto efault;
  5660 +
  5661 + ret = target_to_host_acl(&host_acl, arg3);
  5662 + if (!is_error(ret))
  5663 + ret = get_errno(__acl_set_file(path(p), arg2,
  5664 + &host_acl));
  5665 +
  5666 + unlock_user(p, arg1, 0);
  5667 + }
  5668 + break;
  5669 +
5479 5670 case TARGET_FREEBSD_NR___acl_set_link:
5480   - case TARGET_FREEBSD_NR___acl_delete_link:
5481   - case TARGET_FREEBSD_NR___acl_aclcheck_link:
  5671 + {
  5672 + struct acl host_acl;
  5673 +
  5674 + if (!(p = lock_user_string(arg1)))
  5675 + goto efault;
  5676 +
  5677 + ret = target_to_host_acl(&host_acl, arg3);
  5678 + if (!is_error(ret))
  5679 + ret = get_errno(__acl_set_link(path(p), arg2,
  5680 + &host_acl));
  5681 +
  5682 + unlock_user(p, arg1, 0);
  5683 + }
  5684 + break;
  5685 +
5482 5686 case TARGET_FREEBSD_NR_extattrctl:
  5687 + {
  5688 + void *a, *f;
  5689 +
  5690 + if (!(p = lock_user_string(arg1)))
  5691 + goto efault;
  5692 + if (!(f = lock_user_string(arg3)))
  5693 + goto efault;
  5694 + if (!(a = lock_user_string(arg5)))
  5695 + goto efault;
  5696 +
  5697 + ret = get_errno(extattrctl(path(p), arg2, f, arg4, a));
  5698 +
  5699 + unlock_user(a, arg5, 0);
  5700 + unlock_user(f, arg3, 0);
  5701 + unlock_user(p, arg1, 0);
  5702 + }
  5703 + break;
  5704 +
5483 5705 case TARGET_FREEBSD_NR_extattr_set_file:
  5706 + {
  5707 + void *a, *d;
  5708 +
  5709 + if (!(p = lock_user_string(arg1)))
  5710 + goto efault;
  5711 + if (!(a = lock_user_string(arg3)))
  5712 + goto efault;
  5713 + if (!(d = lock_user(VERIFY_READ, arg4, arg5, 1)))
  5714 + goto efault;
  5715 +
  5716 + ret = get_errno(extattr_set_file(path(p), arg2, a, d, arg5));
  5717 +
  5718 + unlock_user(d, arg4, arg5);
  5719 + unlock_user(a, arg3, 0);
  5720 + unlock_user(p, arg1, 0);
  5721 + }
  5722 + break;
  5723 +
5484 5724 case TARGET_FREEBSD_NR_extattr_get_file:
  5725 + {
  5726 + void *a, *d;
  5727 +
  5728 + if (!(p = lock_user_string(arg1)))
  5729 + goto efault;
  5730 + if (!(a = lock_user_string(arg3)))
  5731 + goto efault;
  5732 +
  5733 + if (arg4 && arg5 > 0) {
  5734 + if (!(d = lock_user(VERIFY_WRITE, arg4, arg5, 0)))
  5735 + goto efault;
  5736 + ret = get_errno(extattr_get_file(path(p), arg2, a, d,
  5737 + arg5));
  5738 + unlock_user(d, arg4, arg5);
  5739 + } else {
  5740 + ret = get_errno(extattr_get_file(path(p), arg2, a,
  5741 + NULL, arg5));
  5742 + }
  5743 + unlock_user(a, arg3, 0);
  5744 + unlock_user(p, arg1, 0);
  5745 + }
  5746 + break;
  5747 +
5485 5748 case TARGET_FREEBSD_NR_extattr_delete_file:
  5749 + {
  5750 + void *a;
  5751 +
  5752 + if (!(p = lock_user_string(arg1)))
  5753 + goto efault;
  5754 + if (!(a = lock_user_string(arg3)))
  5755 + goto efault;
  5756 +
  5757 + ret = get_errno(extattr_delete_file(path(p), arg2, a));
  5758 +
  5759 + unlock_user(a, arg3, 0);
  5760 + unlock_user(p, arg1, 0);
  5761 + }
  5762 + break;
  5763 +
5486 5764 case TARGET_FREEBSD_NR_extattr_set_fd:
  5765 + {
  5766 + void *a, *d;
  5767 +
  5768 + if (!(a = lock_user_string(arg3)))
  5769 + goto efault;
  5770 + if (!(d = lock_user(VERIFY_READ, arg4, arg5, 1)))
  5771 + goto efault;
  5772 +
  5773 + ret = get_errno(extattr_set_fd(arg1, arg2, a, d, arg5));
  5774 +
  5775 + unlock_user(d, arg4, arg5);
  5776 + unlock_user(a, arg3, 0);
  5777 + }
  5778 + break;
  5779 +
5487 5780 case TARGET_FREEBSD_NR_extattr_get_fd:
  5781 + {
  5782 + void *a, *d;
  5783 +
  5784 + if (!(a = lock_user_string(arg3)))
  5785 + goto efault;
  5786 +
  5787 + if (arg4 && arg5 > 0) {
  5788 + if (!(d = lock_user(VERIFY_WRITE, arg4, arg5, 0)))
  5789 + goto efault;
  5790 + ret = get_errno(extattr_get_fd(arg1, arg2, a, d,
  5791 + arg5));
  5792 + unlock_user(d, arg4, arg5);
  5793 + } else {
  5794 + ret = get_errno(extattr_get_fd(arg1, arg2, a,
  5795 + NULL, arg5));
  5796 + }
  5797 + unlock_user(a, arg3, 0);
  5798 + }
  5799 + break;
  5800 +
5488 5801 case TARGET_FREEBSD_NR_extattr_delete_fd:
  5802 + {
  5803 + void *a;
  5804 +
  5805 + if (!(a = lock_user_string(arg3)))
  5806 + goto efault;
  5807 +
  5808 + ret = get_errno(extattr_delete_fd(arg1, arg2, a));
  5809 +
  5810 + unlock_user(a, arg3, 0);
  5811 + }
  5812 + break;
  5813 +
5489 5814 case TARGET_FREEBSD_NR_extattr_get_link:
  5815 + {
  5816 + void *a, *d;
  5817 +
  5818 + if (!(p = lock_user_string(arg1)))
  5819 + goto efault;
  5820 + if (!(a = lock_user_string(arg3)))
  5821 + goto efault;
  5822 +
  5823 + if (arg4 && arg5 > 0) {
  5824 + if (!(d = lock_user(VERIFY_WRITE, arg4, arg5, 0)))
  5825 + goto efault;
  5826 + ret = get_errno(extattr_get_link(path(p), arg2, a, d,
  5827 + arg5));
  5828 + unlock_user(d, arg4, arg5);
  5829 + } else {
  5830 + ret = get_errno(extattr_get_link(path(p), arg2, a,
  5831 + NULL, arg5));
  5832 + }
  5833 + unlock_user(a, arg3, 0);
  5834 + unlock_user(p, arg1, 0);
  5835 + }
  5836 + break;
  5837 +
5490 5838 case TARGET_FREEBSD_NR_extattr_set_link:
  5839 + {
  5840 + void *a, *d;
  5841 +
  5842 + if (!(p = lock_user_string(arg1)))
  5843 + goto efault;
  5844 + if (!(a = lock_user_string(arg3)))
  5845 + goto efault;
  5846 + if (!(d = lock_user(VERIFY_READ, arg4, arg5, 1)))
  5847 + goto efault;
  5848 +
  5849 + ret = get_errno(extattr_set_link(path(p), arg2, a, d, arg5));
  5850 +
  5851 + unlock_user(d, arg4, arg5);
  5852 + unlock_user(a, arg3, 0);
  5853 + unlock_user(p, arg1, 0);
  5854 + }
  5855 + break;
  5856 +
5491 5857 case TARGET_FREEBSD_NR_extattr_delete_link:
  5858 + {
  5859 + void *a;
  5860 +
  5861 + if (!(p = lock_user_string(arg1)))
  5862 + goto efault;
  5863 + if (!(a = lock_user_string(arg3)))
  5864 + goto efault;
  5865 +
  5866 + ret = get_errno(extattr_delete_link(path(p), arg2, a));
  5867 +
  5868 + unlock_user(a, arg3, 0);
  5869 + unlock_user(p, arg1, 0);
  5870 + }
  5871 + break;
  5872 +
5492 5873 case TARGET_FREEBSD_NR_extattr_list_fd:
  5874 + {
  5875 + void *d;
  5876 +
  5877 + if (arg3 && arg4 > 0) {
  5878 + if (!(d = lock_user(VERIFY_WRITE, arg3, arg4, 0)))
  5879 + goto efault;
  5880 + ret = get_errno(extattr_list_fd(arg1, arg2, d,
  5881 + arg4));
  5882 + unlock_user(d, arg3, arg4);
  5883 + } else {
  5884 + ret = get_errno(extattr_list_fd(arg1, arg2,
  5885 + NULL, arg4));
  5886 + }
  5887 + }
  5888 + break;
  5889 +
5493 5890 case TARGET_FREEBSD_NR_extattr_list_file:
  5891 + {
  5892 + void *d;
  5893 +
  5894 + if (!(p = lock_user_string(arg1)))
  5895 + goto efault;
  5896 +
  5897 + if (arg3 && arg4 > 0) {
  5898 + if (!(d = lock_user(VERIFY_WRITE, arg3, arg4, 0)))
  5899 + goto efault;
  5900 + ret = get_errno(extattr_list_file(path(p), arg2, d,
  5901 + arg4));
  5902 + unlock_user(d, arg3, arg4);
  5903 + } else {
  5904 + ret = get_errno(extattr_list_file(path(p), arg2,
  5905 + NULL, arg4));
  5906 + }
  5907 + unlock_user(p, arg1, 0);
  5908 + }
  5909 + break;
  5910 +
5494 5911 case TARGET_FREEBSD_NR_extattr_list_link:
5495   - ret = unimplemented(num);
  5912 + {
  5913 + void *d;
  5914 +
  5915 + if (!(p = lock_user_string(arg1)))
  5916 + goto efault;
  5917 +
  5918 + if (arg3 && arg4 > 0) {
  5919 + if (!(d = lock_user(VERIFY_WRITE, arg3, arg4, 0)))
  5920 + goto efault;
  5921 + ret = get_errno(extattr_list_link(path(p), arg2, d,
  5922 + arg4));
  5923 + unlock_user(d, arg3, arg4);
  5924 + } else {
  5925 + ret = get_errno(extattr_list_link(path(p), arg2,
  5926 + NULL, arg4));
  5927 + }
  5928 +
  5929 + unlock_user(p, arg1, 0);
  5930 + }
5496 5931 break;
5497 5932
5498 5933 case TARGET_FREEBSD_NR_setlogin:
23 work/qemu-1.4.0/bsd-user/syscall_defs.h
@@ -756,3 +756,26 @@ struct target_timex {
756 756 struct target_sched_param {
757 757 int32_t sched_priority;
758 758 };
  759 +
  760 +
  761 +/*
  762 + * sys/acl.h
  763 + */
  764 +
  765 +#define TARGET_ACL_MAX_ENTRIES 254
  766 +
  767 +struct target_acl_entry {
  768 + int32_t ae_tag;
  769 + uint32_t ae_id;
  770 + uint16_t ae_perm;
  771 + uint16_t ae_entry_type;
  772 + uint16_t ae_flags;
  773 +};
  774 +
  775 +struct target_acl {
  776 + uint32_t acl_maxcnt;
  777 + uint32_t acl_cnt;
  778 + int32_t acl_space[4];
  779 + struct target_acl_entry acl_entry[TARGET_ACL_MAX_ENTRIES];
  780 +};
  781 +

0 comments on commit b231eb1

Please sign in to comment.
Something went wrong with that request. Please try again.