Date: Fri, 24 Oct 2008 22:17:10 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 151882 for review Message-ID: <200810242217.m9OMHAZq015720@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=151882 Change 151882 by peter@peter_cheese on 2008/10/24 22:16:53 wrap acl syscalls (bsdtar uses them) Affected files ... .. //depot/projects/valgrind/coregrind/m_syswrap/priv_syswrap-freebsd.h#8 edit .. //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd.c#15 edit .. //depot/projects/valgrind/include/vki/vki-freebsd.h#5 edit Differences ... ==== //depot/projects/valgrind/coregrind/m_syswrap/priv_syswrap-freebsd.h#8 (text+ko) ==== @@ -184,6 +184,10 @@ DECL_TEMPLATE(freebsd, sys___acl_delete_fd); DECL_TEMPLATE(freebsd, sys___acl_aclcheck_file); DECL_TEMPLATE(freebsd, sys___acl_aclcheck_fd); +DECL_TEMPLATE(freebsd, sys___acl_get_link); +DECL_TEMPLATE(freebsd, sys___acl_set_link); +DECL_TEMPLATE(freebsd, sys___acl_delete_link); +DECL_TEMPLATE(freebsd, sys___acl_aclcheck_link); DECL_TEMPLATE(freebsd, sys_extattrctl); DECL_TEMPLATE(freebsd, sys_extattr_set_file); DECL_TEMPLATE(freebsd, sys_extattr_get_file); ==== //depot/projects/valgrind/coregrind/m_syswrap/syswrap-freebsd.c#15 (text+ko) ==== @@ -2508,6 +2508,127 @@ PRE_MEM_RASCIIZ( "faccessat(pathname)", ARG2 ); } +/* --------------------------------------------------------------------- + __acl* wrappers + ------------------------------------------------------------------ */ + +PRE(sys___acl_get_file) +{ + PRINT("sys___acl_get_file ( %#lx(%s), %ld, %#lx )", ARG1,(char *)ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "__acl_get_file", + const char *, path, int, acltype, struct vki_acl *, aclp); + PRE_MEM_WRITE( "__acl_get_file(aclp)", ARG3, sizeof(struct vki_acl) ); +} + +POST(sys___acl_get_file) +{ + vg_assert(SUCCESS); + if (RES == 0) { + POST_MEM_WRITE( ARG3, sizeof(struct vki_acl) ); + } +} + +PRE(sys___acl_set_file) +{ + PRINT("sys___acl_set_file ( %#lx(%s), %ld, %#lx )", ARG1,(char *)ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "__acl_set_file", + const char *, path, int, acltype, struct vki_acl *, aclp); + PRE_MEM_READ( "__acl_set_file(aclp)", ARG3, sizeof(struct vki_acl) ); +} + +PRE(sys___acl_get_fd) +{ + PRINT("sys___acl_get_fd ( %ld, %ld, %#lx )", ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "__acl_get_fd", + int, fd, int, acltype, struct vki_acl *, aclp); + PRE_MEM_WRITE( "__acl_get_file(aclp)", ARG3, sizeof(struct vki_acl) ); +} + +POST(sys___acl_get_fd) +{ + vg_assert(SUCCESS); + if (RES == 0) { + POST_MEM_WRITE( ARG3, sizeof(struct vki_acl) ); + } +} + +PRE(sys___acl_set_fd) +{ + PRINT("sys___acl_set_fd ( %ld, %ld, %#lx )", ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "__acl_set_fd", + int, fd, int, acltype, struct vki_acl *, aclp); + PRE_MEM_READ( "__acl_get_file(aclp)", ARG3, sizeof(struct vki_acl) ); +} + +PRE(sys___acl_delete_file) +{ + PRINT("sys___acl_delete_file ( %#lx(%s), %ld )", ARG1,(char *)ARG1,ARG2); + PRE_REG_READ2(long, "__acl_delete_file", + const char *, path, int, acltype); +} + +PRE(sys___acl_delete_fd) +{ + PRINT("sys___acl_delete_fd ( %ld, %ld )", ARG1,ARG2); + PRE_REG_READ2(long, "__acl_delete_fd", + int, fd, int, acltype); +} + +PRE(sys___acl_aclcheck_file) +{ + PRINT("sys___acl_aclcheck_file ( %#lx(%s), %ld, %#lx )", ARG1,(char *)ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "__acl_aclcheck_file", + const char *, path, int, acltype, struct vki_acl *, aclp); + PRE_MEM_READ( "__acl_aclcheck_file(aclp)", ARG3, sizeof(struct vki_acl) ); +} + +PRE(sys___acl_aclcheck_fd) +{ + PRINT("sys___acl_aclcheck_fd ( %ld, %ld, %#lx )", ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "__acl_aclcheck_fd", + int, fd, int, acltype, struct vki_acl *, aclp); + PRE_MEM_READ( "__acl_aclcheck_fd(aclp)", ARG3, sizeof(struct vki_acl) ); +} + +PRE(sys___acl_get_link) +{ + PRINT("sys___acl_get_link ( %#lx(%s), %ld, %#lx )", ARG1,(char *)ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "__acl_get_link", + const char *, path, int, acltype, struct vki_acl *, aclp); + PRE_MEM_WRITE( "__acl_get_link(aclp)", ARG3, sizeof(struct vki_acl) ); +} + +POST(sys___acl_get_link) +{ + vg_assert(SUCCESS); + if (RES == 0) { + POST_MEM_WRITE( ARG3, sizeof(struct vki_acl) ); + } +} + +PRE(sys___acl_set_link) +{ + PRINT("sys___acl_set_link ( %#lx(%s), %ld, %#lx )", ARG1,(char *)ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "__acl_set_link", + const char *, path, int, acltype, struct vki_acl *, aclp); + PRE_MEM_READ( "__acl_set_link(aclp)", ARG3, sizeof(struct vki_acl) ); +} + +PRE(sys___acl_delete_link) +{ + PRINT("sys___acl_delete_link ( %#lx(%s), %ld )", ARG1,(char *)ARG1,ARG2); + PRE_REG_READ2(long, "__acl_delete_link", + const char *, path, int, acltype); +} + +PRE(sys___acl_aclcheck_link) +{ + PRINT("sys___acl_aclcheck_link ( %#lx(%s), %ld, %#lx )", ARG1,(char *)ARG1,ARG2,ARG3); + PRE_REG_READ3(long, "__acl_aclcheck_link", + const char *, path, int, acltype, struct vki_acl *, aclp); + PRE_MEM_READ( "__acl_aclcheck_link(aclp)", ARG3, sizeof(struct vki_acl) ); +} + #undef PRE #undef POST @@ -2945,16 +3066,16 @@ BSDX_(__NR_sigreturn, sys_sigreturn), // 344 BSDXY(__NR_sigtimedwait, sys_sigtimedwait), // 345 BSDXY(__NR_sigwaitinfo, sys_sigwaitinfo), // 346 - // BSDXY(__NR___acl_get_file, sys___acl_get_file), // 347 + BSDXY(__NR___acl_get_file, sys___acl_get_file), // 347 - // BSDXY(__NR___acl_set_file, sys___acl_set_file), // 348 - // BSDXY(__NR___acl_get_fd, sys___acl_get_fd), // 349 - // BSDXY(__NR___acl_set_fd, sys___acl_set_fd), // 350 - // BSDXY(__NR___acl_delete_file, sys___acl_delete_file), // 351 + BSDX_(__NR___acl_set_file, sys___acl_set_file), // 348 + BSDXY(__NR___acl_get_fd, sys___acl_get_fd), // 349 + BSDX_(__NR___acl_set_fd, sys___acl_set_fd), // 350 + BSDX_(__NR___acl_delete_file, sys___acl_delete_file), // 351 - // BSDXY(__NR___acl_delete_fd, sys___acl_delete_fd), // 352 - // BSDXY(__NR___acl_aclcheck_file, sys___acl_aclcheck_file), // 353 - // BSDXY(__NR___acl_aclcheck_fd, sys___acl_aclcheck_fd), // 354 + BSDX_(__NR___acl_delete_fd, sys___acl_delete_fd), // 352 + BSDX_(__NR___acl_aclcheck_file, sys___acl_aclcheck_file), // 353 + BSDX_(__NR___acl_aclcheck_fd, sys___acl_aclcheck_fd), // 354 // BSDXY(__NR_extattrctl, sys_extattrctl), // 355 // BSDXY(__NR_extattr_set_file, sys_extattr_set_file), // 356 @@ -3043,11 +3164,11 @@ // swapcontext 423 // swapoff 424 - // __acl_get_link 425 - // __acl_set_link 426 - // __acl_delete_link 427 + BSDXY(__NR___acl_get_link, sys___acl_get_link), // 425 + BSDX_(__NR___acl_set_link, sys___acl_set_link), // 426 + BSDX_(__NR___acl_delete_link, sys___acl_delete_link), // 427 - // __acl_aclcheck_link 428 + BSDX_(__NR___acl_aclcheck_link, sys___acl_aclcheck_link), // 428 //!sigwait 429 // thr_create 430 // thr_exit 431 ==== //depot/projects/valgrind/include/vki/vki-freebsd.h#5 (text+ko) ==== @@ -1710,6 +1710,22 @@ #define VKI_UMTX_OP_MAX 11 +//---------------------------------------------------------------------- +// From sys/acl.h +//---------------------------------------------------------------------- + +struct vki_acl_entry { + int ae_tag; + vki_uid_t ae_uid; + vki_mode_t ae_perm; +}; + +#define VKI_ACL_MAX_ENTRIES 32 +struct vki_acl { + int acl_cnt; + struct vki_acl_entry acl_entry[VKI_ACL_MAX_ENTRIES]; +}; + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810242217.m9OMHAZq015720>