Changeset 599 for trunk/server/source3/smbd/open.c
- Timestamp:
- Jul 6, 2011, 8:21:13 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/server/source3/smbd/open.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/smbd/open.c
r596 r599 233 233 (unsigned int)smb_fname_parent->st.st_ex_uid, 234 234 strerror(errno) )); 235 } 236 237 DEBUG(10,("change_file_owner_to_parent: changed new file %s to " 235 } else { 236 DEBUG(10,("change_file_owner_to_parent: changed new file %s to " 238 237 "parent directory uid %u.\n", fsp_str_dbg(fsp), 239 238 (unsigned int)smb_fname_parent->st.st_ex_uid)); 239 240 241 242 240 243 241 244 TALLOC_FREE(smb_fname_parent); … … 312 315 /* Ensure we're pointing at the same place. */ 313 316 if (smb_fname_cwd->st.st_ex_dev != psbuf->st_ex_dev || 314 smb_fname_cwd->st.st_ex_ino != psbuf->st_ex_ino || 315 smb_fname_cwd->st.st_ex_mode != psbuf->st_ex_mode ) { 317 smb_fname_cwd->st.st_ex_ino != psbuf->st_ex_ino) { 316 318 DEBUG(0,("change_dir_owner_to_parent: " 317 "device/inode /modeon directory %s changed. "319 "device/inode on directory %s changed. " 318 320 "Refusing to chown !\n", fname )); 319 321 status = NT_STATUS_ACCESS_DENIED; … … 338 340 "directory %s to parent directory uid %u.\n", 339 341 fname, (unsigned int)smb_fname_parent->st.st_ex_uid )); 342 343 344 340 345 341 346 chdir: … … 365 370 int local_flags = flags; 366 371 bool file_existed = VALID_STAT(fsp->fsp_name->st); 372 367 373 368 374 fsp->fh->fd = -1; … … 464 470 465 471 if ((local_flags & O_CREAT) && !file_existed) { 466 467 /* Inherit the ACL if required */ 468 if (lp_inherit_perms(SNUM(conn))) { 469 inherit_access_posix_acl(conn, parent_dir, 470 smb_fname->base_name, 471 unx_mode); 472 } 473 474 /* Change the owner if required. */ 475 if (lp_inherit_owner(SNUM(conn))) { 476 change_file_owner_to_parent(conn, parent_dir, 477 fsp); 478 } 479 480 notify_fname(conn, NOTIFY_ACTION_ADDED, 481 FILE_NOTIFY_CHANGE_FILE_NAME, 482 smb_fname->base_name); 472 file_created = true; 483 473 } 484 474 … … 589 579 fd_close(fsp); 590 580 return status; 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 591 604 } 592 605 } … … 2307 2320 NTSTATUS status; 2308 2321 bool posix_open = false; 2322 2309 2323 2310 2324 if(!CAN_WRITE(conn)) { … … 2361 2375 inherit_access_posix_acl(conn, parent_dir, 2362 2376 smb_dname->base_name, mode); 2377 2363 2378 } 2364 2379 … … 2375 2390 (smb_dname->st.st_ex_mode | 2376 2391 (mode & ~smb_dname->st.st_ex_mode))); 2392 2377 2393 } 2378 2394 } … … 2383 2399 smb_dname->base_name, 2384 2400 &smb_dname->st); 2401 2402 2403 2404 2405 2406 2407 2408 2409 2385 2410 } 2386 2411 … … 2945 2970 if (lp_acl_check_permissions(SNUM(conn)) 2946 2971 && (create_disposition != FILE_CREATE) 2947 && (share_access & FILE_SHARE_DELETE)2948 2972 && (access_mask & DELETE_ACCESS) 2949 2973 && (!(can_delete_file_in_directory(conn, smb_fname) ||
Note:
See TracChangeset
for help on using the changeset viewer.
