void SAFE_FREE | ( | void * | mem | ) |
char* uidtoname | ( | uid_t | uid | ) |
int sys_acl_get_entry | ( | SMB_ACL_T | the_acl, | |
int | entry_id, | |||
SMB_ACL_ENTRY_T * | entry_p | |||
) |
int sys_acl_get_tag_type | ( | SMB_ACL_ENTRY_T | entry_d, | |
SMB_ACL_TAG_T * | tag_type_p | |||
) |
int sys_acl_get_permset | ( | SMB_ACL_ENTRY_T | entry_d, | |
SMB_ACL_PERMSET_T * | permset_p | |||
) |
void * sys_acl_get_qualifier | ( | SMB_ACL_ENTRY_T | entry_d | ) |
SMB_ACL_T sys_acl_get_file | ( | const char * | path_p, | |
SMB_ACL_TYPE_T | type | |||
) |
SMB_ACL_T sys_acl_get_fd | ( | int | fd | ) |
int sys_acl_clear_perms | ( | SMB_ACL_PERMSET_T | permset | ) |
int sys_acl_add_perm | ( | SMB_ACL_PERMSET_T | permset, | |
SMB_ACL_PERM_T | perm | |||
) |
int sys_acl_get_perm | ( | SMB_ACL_PERMSET_T | permset, | |
SMB_ACL_PERM_T | perm | |||
) |
参照元 unpack_smb_acl().
00134 { 00135 #if defined(HAVE_ACL_GET_PERM_NP) 00136 /* 00137 * Required for TrustedBSD-based ACL implementations where 00138 * non-POSIX.1e functions are denoted by a _np (non-portable) 00139 * suffix. 00140 */ 00141 return acl_get_perm_np(permset, perm); 00142 #else 00143 return acl_get_perm(permset, perm); 00144 #endif 00145 }
char * sys_acl_to_text | ( | SMB_ACL_T | the_acl, | |
ssize_t * | plen | |||
) |
SMB_ACL_T sys_acl_init | ( | int | count | ) |
int sys_acl_create_entry | ( | SMB_ACL_T * | pacl, | |
SMB_ACL_ENTRY_T * | pentry | |||
) |
int sys_acl_set_tag_type | ( | SMB_ACL_ENTRY_T | entry, | |
SMB_ACL_TAG_T | tagtype | |||
) |
int sys_acl_set_qualifier | ( | SMB_ACL_ENTRY_T | entry, | |
void * | qual | |||
) |
int sys_acl_set_permset | ( | SMB_ACL_ENTRY_T | entry, | |
SMB_ACL_PERMSET_T | permset | |||
) |
int sys_acl_valid | ( | SMB_ACL_T | theacl | ) |
int sys_acl_set_file | ( | const char * | name, | |
SMB_ACL_TYPE_T | acltype, | |||
SMB_ACL_T | theacl | |||
) |
int sys_acl_set_fd | ( | int | fd, | |
SMB_ACL_T | theacl | |||
) |
int sys_acl_delete_def_file | ( | const char * | name | ) |
int sys_acl_free_text | ( | char * | text | ) |
int sys_acl_free_acl | ( | SMB_ACL_T | the_acl | ) |
int sys_acl_free_qualifier | ( | void * | qual, | |
UNUSED(SMB_ACL_TAG_T tagtype) | ||||
) |
int sys_acl_free_qualifier | ( | void * | qual, | |
SMB_ACL_TAG_T | tagtype | |||
) |
static int acl_sort | ( | SMB_ACL_T | acl_d | ) | [static] |
参照先 SMB_ACL_T::acl・SMB_ACL_T::count・errno.
00843 { 00844 int fixmask = (acl_d->count <= 4); 00845 00846 if (aclsort(acl_d->count, fixmask, acl_d->acl) != 0) { 00847 errno = EINVAL; 00848 return -1; 00849 } 00850 return 0; 00851 }
int sys_acl_free_qualifier | ( | UNUSED(void *qual) | , | |
UNUSED(SMB_ACL_TAG_T tagtype) | ||||
) |
static BOOL hpux_acl_call_presence | ( | void | ) | [static] |
01023 { 01024 01025 shl_t handle = NULL; 01026 void *value; 01027 int ret_val=0; 01028 static BOOL already_checked=0; 01029 01030 if(already_checked) 01031 return True; 01032 01033 01034 ret_val = shl_findsym(&handle, "acl", TYPE_PROCEDURE, &value); 01035 01036 if(ret_val != 0) { 01037 DEBUG(5, ("hpux_acl_call_presence: shl_findsym() returned %d, errno = %d, error %s\n", 01038 ret_val, errno, strerror(errno))); 01039 DEBUG(5,("hpux_acl_call_presence: acl() system call is not present. Check if you have JFS 3.3 and above?\n")); 01040 return False; 01041 } 01042 01043 DEBUG(10,("hpux_acl_call_presence: acl() system call is present. We have JFS 3.3 or above \n")); 01044 01045 already_checked = True; 01046 return True; 01047 }
static int hpux_count_obj | ( | int | acl_count, | |
struct acl * | aclp, | |||
struct hpux_acl_types * | acl_type_count | |||
) | [static] |
参照先 hpux_acl_types::n_class_obj・hpux_acl_types::n_def_class_obj・hpux_acl_types::n_def_group・hpux_acl_types::n_def_group_obj・hpux_acl_types::n_def_other_obj・hpux_acl_types::n_def_user・hpux_acl_types::n_def_user_obj・hpux_acl_types::n_group・hpux_acl_types::n_group_obj・hpux_acl_types::n_illegal_obj・hpux_acl_types::n_other_obj・hpux_acl_types::n_user・hpux_acl_types::n_user_obj.
参照元 hpux_acl_sort().
01494 { 01495 int i; 01496 01497 memset(acl_type_count, 0, sizeof(struct hpux_acl_types)); 01498 01499 for(i=0;i<acl_count;i++) { 01500 switch(aclp[i].a_type) { 01501 case USER: 01502 acl_type_count->n_user++; 01503 break; 01504 case USER_OBJ: 01505 acl_type_count->n_user_obj++; 01506 break; 01507 case DEF_USER_OBJ: 01508 acl_type_count->n_def_user_obj++; 01509 break; 01510 case GROUP: 01511 acl_type_count->n_group++; 01512 break; 01513 case GROUP_OBJ: 01514 acl_type_count->n_group_obj++; 01515 break; 01516 case DEF_GROUP_OBJ: 01517 acl_type_count->n_def_group_obj++; 01518 break; 01519 case OTHER_OBJ: 01520 acl_type_count->n_other_obj++; 01521 break; 01522 case DEF_OTHER_OBJ: 01523 acl_type_count->n_def_other_obj++; 01524 break; 01525 case CLASS_OBJ: 01526 acl_type_count->n_class_obj++; 01527 break; 01528 case DEF_CLASS_OBJ: 01529 acl_type_count->n_def_class_obj++; 01530 break; 01531 case DEF_USER: 01532 acl_type_count->n_def_user++; 01533 break; 01534 case DEF_GROUP: 01535 acl_type_count->n_def_group++; 01536 break; 01537 default: 01538 acl_type_count->n_illegal_obj++; 01539 break; 01540 } 01541 } 01542 }
static void hpux_swap_acl_entries | ( | struct acl * | aclp0, | |
struct acl * | aclp1 | |||
) | [static] |
参照元 hpux_acl_sort().
01550 { 01551 struct acl temp_acl; 01552 01553 temp_acl.a_type = aclp0->a_type; 01554 temp_acl.a_id = aclp0->a_id; 01555 temp_acl.a_perm = aclp0->a_perm; 01556 01557 aclp0->a_type = aclp1->a_type; 01558 aclp0->a_id = aclp1->a_id; 01559 aclp0->a_perm = aclp1->a_perm; 01560 01561 aclp1->a_type = temp_acl.a_type; 01562 aclp1->a_id = temp_acl.a_id; 01563 aclp1->a_perm = temp_acl.a_perm; 01564 }
static BOOL hpux_prohibited_duplicate_type | ( | int | acl_type | ) | [static] |
参照元 hpux_acl_sort().
01581 { 01582 switch(acl_type) { 01583 case USER: 01584 case GROUP: 01585 case DEF_USER: 01586 case DEF_GROUP: 01587 return True; 01588 default: 01589 return False; 01590 } 01591 }
static int hpux_get_needed_class_perm | ( | struct acl * | aclp | ) | [static] |
参照元 hpux_acl_sort().
01602 { 01603 switch(aclp->a_type) { 01604 case USER: 01605 case GROUP_OBJ: 01606 case GROUP: 01607 case DEF_USER_OBJ: 01608 case DEF_USER: 01609 case DEF_GROUP_OBJ: 01610 case DEF_GROUP: 01611 case DEF_CLASS_OBJ: 01612 case DEF_OTHER_OBJ: 01613 return aclp->a_perm; 01614 default: 01615 return 0; 01616 } 01617 }
static int hpux_acl_sort | ( | int | acl_count, | |
int | calclass, | |||
struct acl * | aclp | |||
) | [static] |
参照先 hpux_count_obj()・hpux_get_needed_class_perm()・hpux_prohibited_duplicate_type()・hpux_swap_acl_entries()・hpux_acl_types::n_class_obj・hpux_acl_types::n_def_class_obj・hpux_acl_types::n_def_group_obj・hpux_acl_types::n_def_other_obj・hpux_acl_types::n_def_user_obj・hpux_acl_types::n_group_obj・hpux_acl_types::n_other_obj・hpux_acl_types::n_user_obj.
01641 { 01642 #if !defined(HAVE_HPUX_ACLSORT) 01643 /* 01644 * The aclsort() system call is availabe on the latest HPUX General 01645 * Patch Bundles. So for HPUX, we developed our version of acl_sort 01646 * function. Because, we don't want to update to a new 01647 * HPUX GR bundle just for aclsort() call. 01648 */ 01649 01650 struct hpux_acl_types acl_obj_count; 01651 int n_class_obj_perm = 0; 01652 int i, j; 01653 01654 if(!acl_count) { 01655 DEBUG(10,("Zero acl count passed. Returning Success\n")); 01656 return 0; 01657 } 01658 01659 if(aclp == NULL) { 01660 DEBUG(0,("Null ACL pointer in hpux_acl_sort. Returning Failure. \n")); 01661 return -1; 01662 } 01663 01664 /* Count different types of ACLs in the ACLs array */ 01665 01666 hpux_count_obj(acl_count, aclp, &acl_obj_count); 01667 01668 /* There should be only one entry each of type USER_OBJ, GROUP_OBJ, 01669 * CLASS_OBJ and OTHER_OBJ 01670 */ 01671 01672 if( (acl_obj_count.n_user_obj != 1) || 01673 (acl_obj_count.n_group_obj != 1) || 01674 (acl_obj_count.n_class_obj != 1) || 01675 (acl_obj_count.n_other_obj != 1) 01676 ) { 01677 DEBUG(0,("hpux_acl_sort: More than one entry or no entries for \ 01678 USER OBJ or GROUP_OBJ or OTHER_OBJ or CLASS_OBJ\n")); 01679 return -1; 01680 } 01681 01682 /* If any of the default objects are present, there should be only 01683 * one of them each. 01684 */ 01685 01686 if( (acl_obj_count.n_def_user_obj > 1) || (acl_obj_count.n_def_group_obj > 1) || 01687 (acl_obj_count.n_def_other_obj > 1) || (acl_obj_count.n_def_class_obj > 1) ) { 01688 DEBUG(0,("hpux_acl_sort: More than one entry for DEF_CLASS_OBJ \ 01689 or DEF_USER_OBJ or DEF_GROUP_OBJ or DEF_OTHER_OBJ\n")); 01690 return -1; 01691 } 01692 01693 /* We now have proper number of OBJ and DEF_OBJ entries. Now sort the acl 01694 * structures. 01695 * 01696 * Sorting crieteria - First sort by ACL type. If there are multiple entries of 01697 * same ACL type, sort by ACL id. 01698 * 01699 * I am using the trival kind of sorting method here because, performance isn't 01700 * really effected by the ACLs feature. More over there aren't going to be more 01701 * than 17 entries on HPUX. 01702 */ 01703 01704 for(i=0; i<acl_count;i++) { 01705 for (j=i+1; j<acl_count; j++) { 01706 if( aclp[i].a_type > aclp[j].a_type ) { 01707 /* ACL entries out of order, swap them */ 01708 01709 hpux_swap_acl_entries((aclp+i), (aclp+j)); 01710 01711 } else if ( aclp[i].a_type == aclp[j].a_type ) { 01712 01713 /* ACL entries of same type, sort by id */ 01714 01715 if(aclp[i].a_id > aclp[j].a_id) { 01716 hpux_swap_acl_entries((aclp+i), (aclp+j)); 01717 } else if (aclp[i].a_id == aclp[j].a_id) { 01718 /* We have a duplicate entry. */ 01719 if(hpux_prohibited_duplicate_type(aclp[i].a_type)) { 01720 DEBUG(0, ("hpux_acl_sort: Duplicate entry: Type(hex): %x Id: %d\n", 01721 aclp[i].a_type, aclp[i].a_id)); 01722 return -1; 01723 } 01724 } 01725 01726 } 01727 } 01728 } 01729 01730 /* set the class obj permissions to the computed one. */ 01731 if(calclass) { 01732 int n_class_obj_index = -1; 01733 01734 for(i=0;i<acl_count;i++) { 01735 n_class_obj_perm |= hpux_get_needed_class_perm((aclp+i)); 01736 01737 if(aclp[i].a_type == CLASS_OBJ) 01738 n_class_obj_index = i; 01739 } 01740 aclp[n_class_obj_index].a_perm = n_class_obj_perm; 01741 } 01742 01743 return 0; 01744 #else 01745 return aclsort(acl_count, calclass, aclp); 01746 #endif 01747 }
int sys_acl_get_entry | ( | UNUSED(SMB_ACL_T the_acl) | , | |
UNUSED(int entry_id) | , | |||
UNUSED(SMB_ACL_ENTRY_T *entry_p) | ||||
) |
int sys_acl_get_tag_type | ( | UNUSED(SMB_ACL_ENTRY_T entry_d) | , | |
UNUSED(SMB_ACL_TAG_T *tag_type_p) | ||||
) |
int sys_acl_get_permset | ( | UNUSED(SMB_ACL_ENTRY_T entry_d) | , | |
UNUSED(SMB_ACL_PERMSET_T *permset_p) | ||||
) |
void* sys_acl_get_qualifier | ( | UNUSED(SMB_ACL_ENTRY_T entry_d) | ) |
SMB_ACL_T sys_acl_get_file | ( | UNUSED(const char *path_p) | , | |
UNUSED(SMB_ACL_TYPE_T type) | ||||
) |
SMB_ACL_T sys_acl_get_fd | ( | UNUSED(int fd) | ) |
int sys_acl_clear_perms | ( | UNUSED(SMB_ACL_PERMSET_T permset) | ) |
int sys_acl_add_perm | ( | UNUSED(SMB_ACL_PERMSET_T permset) | , | |
UNUSED(SMB_ACL_PERM_T perm) | ||||
) |
char* sys_acl_to_text | ( | UNUSED(SMB_ACL_T the_acl) | , | |
UNUSED(ssize_t *plen) | ||||
) |
int sys_acl_free_text | ( | UNUSED(char *text) | ) |
SMB_ACL_T sys_acl_init | ( | UNUSED(int count) | ) |
int sys_acl_create_entry | ( | UNUSED(SMB_ACL_T *pacl) | , | |
UNUSED(SMB_ACL_ENTRY_T *pentry) | ||||
) |
int sys_acl_set_tag_type | ( | UNUSED(SMB_ACL_ENTRY_T entry) | , | |
UNUSED(SMB_ACL_TAG_T tagtype) | ||||
) |
int sys_acl_set_qualifier | ( | UNUSED(SMB_ACL_ENTRY_T entry) | , | |
UNUSED(void *qual) | ||||
) |
int sys_acl_set_permset | ( | UNUSED(SMB_ACL_ENTRY_T entry) | , | |
UNUSED(SMB_ACL_PERMSET_T permset) | ||||
) |
int sys_acl_valid | ( | UNUSED(SMB_ACL_T theacl) | ) |
int sys_acl_set_file | ( | UNUSED(const char *name) | , | |
UNUSED(SMB_ACL_TYPE_T acltype) | , | |||
UNUSED(SMB_ACL_T theacl) | ||||
) |
int sys_acl_set_fd | ( | UNUSED(int fd) | , | |
UNUSED(SMB_ACL_T theacl) | ||||
) |
int sys_acl_delete_def_file | ( | UNUSED(const char *name) | ) |
int sys_acl_free_acl | ( | UNUSED(SMB_ACL_T the_acl) | ) |
int no_acl_syscall_error | ( | int | err | ) |