Changeset 860 for vendor/current/source3/smbd/filename.c
- Timestamp:
- May 12, 2014, 8:58:38 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/filename.c
r746 r860 446 446 if (errno == ENOENT) { 447 447 /* Optimization when creating a new file - only 448 the last component doesn't exist. */ 448 the last component doesn't exist. 449 NOTE : check_parent_exists() doesn't preserve errno. 450 */ 451 int saved_errno = errno; 449 452 status = check_parent_exists(ctx, 450 453 conn, … … 453 456 &dirpath, 454 457 &start); 458 errno = saved_errno; 455 459 if (!NT_STATUS_IS_OK(status)) { 456 460 goto fail; … … 525 529 * is in the last component and the client already 526 530 * sent the correct case. 531 * NOTE : check_parent_exists() doesn't preserve errno. 527 532 */ 533 int saved_errno = errno; 528 534 status = check_parent_exists(ctx, 529 535 conn, … … 532 538 &dirpath, 533 539 &start); 540 errno = saved_errno; 534 541 if (!NT_STATUS_IS_OK(status)) { 535 542 goto fail; … … 707 714 /* 708 715 * ENOENT/EACCESS are the only valid errors 709 * here. EACCESS needs handling here for 710 * "dropboxes", i.e. directories where users 711 * can only put stuff with permission -wx. 716 * here. 712 717 */ 713 if ((errno != 0) && (errno != ENOENT) 714 && (errno != EACCES)) { 718 if (errno == EACCES) { 719 if (ucf_flags & UCF_CREATING_FILE) { 720 /* 721 * This is the dropbox 722 * behaviour. A dropbox is a 723 * directory with only -wx 724 * permissions, so 725 * get_real_filename fails 726 * with EACCESS, it needs to 727 * list the directory. We 728 * nevertheless want to allow 729 * users creating a file. 730 */ 731 status = NT_STATUS_OBJECT_PATH_NOT_FOUND; 732 } else { 733 status = NT_STATUS_ACCESS_DENIED; 734 } 735 goto fail; 736 } 737 738 if ((errno != 0) && (errno != ENOENT)) { 715 739 /* 716 740 * ENOTDIR and ELOOP both map to
Note:
See TracChangeset
for help on using the changeset viewer.