Changeset 739 for branches/samba-3.5.x/source3/smbd/posix_acls.c
- Timestamp:
- Nov 12, 2012, 7:37:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.5.x/source3/smbd/posix_acls.c
r733 r739 1343 1343 1344 1344 static bool ensure_canon_entry_valid(canon_ace **pp_ace, 1345 const struct share_params *params, 1346 const bool is_directory, 1347 const DOM_SID *pfile_owner_sid, 1348 const DOM_SID *pfile_grp_sid, 1349 const SMB_STRUCT_STAT *pst, 1350 bool setting_acl) 1345 bool is_default_acl, 1346 const struct share_params *params, 1347 const bool is_directory, 1348 const DOM_SID *pfile_owner_sid, 1349 const DOM_SID *pfile_grp_sid, 1350 const SMB_STRUCT_STAT *pst, 1351 bool setting_acl) 1351 1352 { 1352 1353 canon_ace *pace; … … 1359 1360 if (pace->type == SMB_ACL_USER_OBJ) { 1360 1361 1361 if (setting_acl )1362 if (setting_acl && !is_default_acl) { 1362 1363 apply_default_perms(params, is_directory, pace, S_IRUSR); 1364 } 1363 1365 got_user = True; 1364 1366 … … 1369 1371 */ 1370 1372 1371 if (setting_acl )1373 if (setting_acl && !is_default_acl) { 1372 1374 apply_default_perms(params, is_directory, pace, S_IRGRP); 1375 } 1373 1376 got_grp = True; 1374 1377 … … 1379 1382 */ 1380 1383 1381 if (setting_acl )1384 if (setting_acl && !is_default_acl) { 1382 1385 apply_default_perms(params, is_directory, pace, S_IROTH); 1386 } 1383 1387 got_other = True; 1384 1388 pace_other = pace; 1389 1390 } else if (pace->type == SMB_ACL_USER || pace->type == SMB_ACL_GROUP) { 1391 1392 /* 1393 * Ensure create mask/force create mode is respected on set. 1394 */ 1395 1396 if (setting_acl && !is_default_acl) { 1397 apply_default_perms(params, is_directory, pace, S_IRGRP); 1398 } 1385 1399 } 1386 1400 } … … 1426 1440 } 1427 1441 1428 apply_default_perms(params, is_directory, pace, S_IRUSR); 1442 if (!is_default_acl) { 1443 apply_default_perms(params, is_directory, pace, S_IRUSR); 1444 } 1429 1445 } else { 1430 1446 pace->perms = unix_perms_to_acl_perms(pst->st_ex_mode, S_IRUSR, S_IWUSR, S_IXUSR); … … 1452 1468 else 1453 1469 pace->perms = 0; 1454 apply_default_perms(params, is_directory, pace, S_IRGRP); 1470 if (!is_default_acl) { 1471 apply_default_perms(params, is_directory, pace, S_IRGRP); 1472 } 1455 1473 } else { 1456 1474 pace->perms = unix_perms_to_acl_perms(pst->st_ex_mode, S_IRGRP, S_IWGRP, S_IXGRP); … … 1474 1492 if (setting_acl) { 1475 1493 pace->perms = 0; 1476 apply_default_perms(params, is_directory, pace, S_IROTH); 1494 if (!is_default_acl) { 1495 apply_default_perms(params, is_directory, pace, S_IROTH); 1496 } 1477 1497 } else 1478 1498 pace->perms = unix_perms_to_acl_perms(pst->st_ex_mode, S_IROTH, S_IWOTH, S_IXOTH); … … 2319 2339 print_canon_ace_list( "file ace - before valid", file_ace); 2320 2340 2321 if (!ensure_canon_entry_valid(&file_ace, f sp->conn->params,2341 if (!ensure_canon_entry_valid(&file_ace, false, fsp->conn->params, 2322 2342 fsp->is_directory, pfile_owner_sid, pfile_grp_sid, pst, True)) { 2323 2343 free_canon_ace_list(file_ace); … … 2328 2348 print_canon_ace_list( "dir ace - before valid", dir_ace); 2329 2349 2330 if (dir_ace && !ensure_canon_entry_valid(&dir_ace, fsp->conn->params,2350 if (dir_ace && !ensure_canon_entry_valid(&dir_ace, true, fsp->conn->params, 2331 2351 fsp->is_directory, pfile_owner_sid, pfile_grp_sid, pst, True)) { 2332 2352 free_canon_ace_list(file_ace); … … 2417 2437 canon_ace *next_ace = NULL; 2418 2438 int entry_id = SMB_ACL_FIRST_ENTRY; 2439 bool is_default_acl = (the_acl_type == SMB_ACL_TYPE_DEFAULT); 2419 2440 SMB_ACL_ENTRY_T entry; 2420 2441 size_t ace_count; … … 2504 2525 ace->unix_ug = unix_ug; 2505 2526 ace->owner_type = owner_type; 2506 ace->ace_flags = get_pai_flags(pal, ace, (the_acl_type == SMB_ACL_TYPE_DEFAULT));2527 ace->ace_flags = get_pai_flags(pal, ace, is_default_acl); 2507 2528 2508 2529 DLIST_ADD(l_head, ace); … … 2513 2534 */ 2514 2535 2515 if (!ensure_canon_entry_valid(&l_head, conn->params,2536 if (!ensure_canon_entry_valid(&l_head, is_default_acl, conn->params, 2516 2537 S_ISDIR(psbuf->st_ex_mode), powner, pgroup, 2517 2538 psbuf, False)) … … 2523 2544 */ 2524 2545 2525 DEBUG(10,("canonicalise_acl: %s ace entries before arrange :\n", the_acl_type == SMB_ACL_TYPE_ACCESS ? "Access" : "Default"));2546 DEBUG(10,("canonicalise_acl: %s ace entries before arrange :\n", is_default_acl ? "Default" : "Access")); 2526 2547 2527 2548 for ( ace_count = 0, ace = l_head; ace; ace = next_ace, ace_count++) {
Note:
See TracChangeset
for help on using the changeset viewer.