Changeset 222 for branches/samba-3.3.x/source/smbd/open.c
- Timestamp:
- May 24, 2009, 7:45:16 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/smbd/open.c
r221 r222 59 59 60 60 *access_granted = 0; 61 62 if (conn->server_info->utok.uid == 0 || conn->admin_user) { 63 /* I'm sorry sir, I didn't know you were root... */ 64 *access_granted = access_mask; 65 if (access_mask & SEC_FLAG_MAXIMUM_ALLOWED) { 66 *access_granted |= FILE_GENERIC_ALL; 67 } 68 return NT_STATUS_OK; 69 } 61 70 62 71 status = SMB_VFS_GET_NT_ACL(conn, fname, … … 2383 2392 } 2384 2393 2394 /* We need to support SeSecurityPrivilege for this. */ 2395 if (access_mask & SEC_RIGHT_SYSTEM_SECURITY) { 2396 DEBUG(10, ("open_directory: open on %s " 2397 "failed - SEC_RIGHT_SYSTEM_SECURITY denied.\n", 2398 fname)); 2399 return NT_STATUS_PRIVILEGE_NOT_HELD; 2400 } 2401 2385 2402 switch( create_disposition ) { 2386 2403 case FILE_OPEN: … … 2463 2480 access_mask, 2464 2481 &access_granted); 2482 2483 /* Were we trying to do a directory open 2484 * for delete and didn't get DELETE 2485 * access (only) ? Check if the 2486 * directory allows DELETE_CHILD. 2487 * See here: 2488 * http://blogs.msdn.com/oldnewthing/archive/2004/06/04/148426.aspx 2489 * for details. */ 2490 2491 if ((NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) && 2492 (access_mask & DELETE_ACCESS) && 2493 (access_granted == DELETE_ACCESS) && 2494 can_delete_file_in_directory(conn, fname))) { 2495 DEBUG(10,("open_directory: overrode ACCESS_DENIED " 2496 "on directory %s\n", 2497 fname )); 2498 status = NT_STATUS_OK; 2499 } 2500 2465 2501 if (!NT_STATUS_IS_OK(status)) { 2466 2502 DEBUG(10, ("open_directory: check_open_rights on " … … 2897 2933 goto fail; 2898 2934 } 2935 #else 2936 /* We need to support SeSecurityPrivilege for this. */ 2937 if (access_mask & SEC_RIGHT_SYSTEM_SECURITY) { 2938 status = NT_STATUS_PRIVILEGE_NOT_HELD; 2939 goto fail; 2940 } 2941 /* Don't allow a SACL set from an NTtrans create until we 2942 * support SeSecurityPrivilege. */ 2943 if (!VALID_STAT(sbuf) && 2944 lp_nt_acl_support(SNUM(conn)) && 2945 sd && (sd->sacl != NULL)) { 2946 status = NT_STATUS_PRIVILEGE_NOT_HELD; 2947 goto fail; 2948 } 2899 2949 #endif 2900 2950
Note:
See TracChangeset
for help on using the changeset viewer.