Changeset 221 for branches/samba-3.3.x/source/smbd/posix_acls.c
- Timestamp:
- May 24, 2009, 7:17:10 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/smbd/posix_acls.c
r206 r221 564 564 ****************************************************************************/ 565 565 566 static size_t count_canon_ace_list( canon_ace *l ist_head )566 static size_t count_canon_ace_list( canon_ace *l_head ) 567 567 { 568 568 size_t count = 0; 569 569 canon_ace *ace; 570 570 571 for (ace = l ist_head; ace; ace = ace->next)571 for (ace = l_head; ace; ace = ace->next) 572 572 count++; 573 573 … … 579 579 ****************************************************************************/ 580 580 581 static void free_canon_ace_list( canon_ace *l ist_head )581 static void free_canon_ace_list( canon_ace *l_head ) 582 582 { 583 583 canon_ace *list, *next; 584 584 585 for (list = l ist_head; list; list = next) {585 for (list = l_head; list; list = next) { 586 586 next = list->next; 587 DLIST_REMOVE(l ist_head, list);587 DLIST_REMOVE(l_head, list); 588 588 SAFE_FREE(list); 589 589 } … … 761 761 static void merge_aces( canon_ace **pp_list_head ) 762 762 { 763 canon_ace *l ist_head = *pp_list_head;763 canon_ace *l_head = *pp_list_head; 764 764 canon_ace *curr_ace_outer; 765 765 canon_ace *curr_ace_outer_next; … … 770 770 */ 771 771 772 for (curr_ace_outer = l ist_head; curr_ace_outer; curr_ace_outer = curr_ace_outer_next) {772 for (curr_ace_outer = l_head; curr_ace_outer; curr_ace_outer = curr_ace_outer_next) { 773 773 canon_ace *curr_ace; 774 774 canon_ace *curr_ace_next; … … 792 792 793 793 curr_ace_outer->perms |= curr_ace->perms; 794 DLIST_REMOVE(l ist_head, curr_ace);794 DLIST_REMOVE(l_head, curr_ace); 795 795 SAFE_FREE(curr_ace); 796 796 curr_ace_outer_next = curr_ace_outer->next; /* We may have deleted the link. */ … … 805 805 */ 806 806 807 for (curr_ace_outer = l ist_head; curr_ace_outer; curr_ace_outer = curr_ace_outer_next) {807 for (curr_ace_outer = l_head; curr_ace_outer; curr_ace_outer = curr_ace_outer_next) { 808 808 canon_ace *curr_ace; 809 809 canon_ace *curr_ace_next; … … 837 837 */ 838 838 839 DLIST_REMOVE(l ist_head, curr_ace);839 DLIST_REMOVE(l_head, curr_ace); 840 840 SAFE_FREE(curr_ace); 841 841 curr_ace_outer_next = curr_ace_outer->next; /* We may have deleted the link. */ … … 853 853 */ 854 854 855 DLIST_REMOVE(l ist_head, curr_ace_outer);855 DLIST_REMOVE(l_head, curr_ace_outer); 856 856 SAFE_FREE(curr_ace_outer); 857 857 break; … … 864 864 /* We may have modified the list. */ 865 865 866 *pp_list_head = l ist_head;866 *pp_list_head = l_head; 867 867 } 868 868 … … 2148 2148 static void arrange_posix_perms(const char *filename, canon_ace **pp_list_head) 2149 2149 { 2150 canon_ace *l ist_head = *pp_list_head;2150 canon_ace *l_head = *pp_list_head; 2151 2151 canon_ace *owner_ace = NULL; 2152 2152 canon_ace *other_ace = NULL; 2153 2153 canon_ace *ace = NULL; 2154 2154 2155 for (ace = l ist_head; ace; ace = ace->next) {2155 for (ace = l_head; ace; ace = ace->next) { 2156 2156 if (ace->type == SMB_ACL_USER_OBJ) 2157 2157 owner_ace = ace; … … 2174 2174 2175 2175 if (owner_ace) { 2176 DLIST_PROMOTE(l ist_head, owner_ace);2176 DLIST_PROMOTE(l_head, owner_ace); 2177 2177 } 2178 2178 2179 2179 if (other_ace) { 2180 DLIST_DEMOTE(l ist_head, other_ace, canon_ace *);2180 DLIST_DEMOTE(l_head, other_ace, canon_ace *); 2181 2181 } 2182 2182 2183 2183 /* We have probably changed the head of the list. */ 2184 2184 2185 *pp_list_head = l ist_head;2185 *pp_list_head = l_head; 2186 2186 } 2187 2187 … … 2196 2196 { 2197 2197 mode_t acl_mask = (S_IRUSR|S_IWUSR|S_IXUSR); 2198 canon_ace *l ist_head = NULL;2198 canon_ace *l_head = NULL; 2199 2199 canon_ace *ace = NULL; 2200 2200 canon_ace *next_ace = NULL; … … 2300 2300 ace->inherited = get_inherited_flag(pal, ace, (the_acl_type == SMB_ACL_TYPE_DEFAULT)); 2301 2301 2302 DLIST_ADD(l ist_head, ace);2302 DLIST_ADD(l_head, ace); 2303 2303 } 2304 2304 … … 2307 2307 */ 2308 2308 2309 if (!ensure_canon_entry_valid(&l ist_head, conn->params,2309 if (!ensure_canon_entry_valid(&l_head, conn->params, 2310 2310 S_ISDIR(psbuf->st_mode), powner, pgroup, 2311 2311 psbuf, False)) … … 2319 2319 DEBUG(10,("canonicalise_acl: %s ace entries before arrange :\n", the_acl_type == SMB_ACL_TYPE_ACCESS ? "Access" : "Default" )); 2320 2320 2321 for ( ace_count = 0, ace = l ist_head; ace; ace = next_ace, ace_count++) {2321 for ( ace_count = 0, ace = l_head; ace; ace = next_ace, ace_count++) { 2322 2322 next_ace = ace->next; 2323 2323 … … 2327 2327 2328 2328 if (ace->perms == 0) { 2329 DLIST_PROMOTE(l ist_head, ace);2329 DLIST_PROMOTE(l_head, ace); 2330 2330 } 2331 2331 … … 2335 2335 } 2336 2336 2337 arrange_posix_perms(fname,&l ist_head );2338 2339 print_canon_ace_list( "canonicalise_acl: ace entries after arrange", l ist_head );2340 2341 return l ist_head;2337 arrange_posix_perms(fname,&l_head ); 2338 2339 print_canon_ace_list( "canonicalise_acl: ace entries after arrange", l_head ); 2340 2341 return l_head; 2342 2342 2343 2343 fail: 2344 2344 2345 free_canon_ace_list(l ist_head);2345 free_canon_ace_list(l_head); 2346 2346 return NULL; 2347 2347 } … … 4046 4046 SMB_ACL_T def_acl = NULL; 4047 4047 4048 if (num_def_acls && !S_ISDIR(psbuf->st_mode)) { 4049 DEBUG(5,("set_unix_posix_default_acl: Can't set default ACL on non-directory file %s\n", fname )); 4050 errno = EISDIR; 4051 return False; 4048 if (!S_ISDIR(psbuf->st_mode)) { 4049 if (num_def_acls) { 4050 DEBUG(5,("set_unix_posix_default_acl: Can't set default ACL on non-directory file %s\n", fname )); 4051 errno = EISDIR; 4052 return False; 4053 } else { 4054 return True; 4055 } 4052 4056 } 4053 4057
Note:
See TracChangeset
for help on using the changeset viewer.