Ignore:
Timestamp:
May 12, 2014, 8:58:38 PM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.6: updated vendor to latest version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/smbd/filename.c

    r746 r860  
    446446                if (errno == ENOENT) {
    447447                        /* 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;
    449452                        status = check_parent_exists(ctx,
    450453                                                conn,
     
    453456                                                &dirpath,
    454457                                                &start);
     458                        errno = saved_errno;
    455459                        if (!NT_STATUS_IS_OK(status)) {
    456460                                goto fail;
     
    525529                 * is in the last component and the client already
    526530                 * sent the correct case.
     531                 * NOTE : check_parent_exists() doesn't preserve errno.
    527532                 */
     533                int saved_errno = errno;
    528534                status = check_parent_exists(ctx,
    529535                                        conn,
     
    532538                                        &dirpath,
    533539                                        &start);
     540                errno = saved_errno;
    534541                if (!NT_STATUS_IS_OK(status)) {
    535542                        goto fail;
     
    707714                                /*
    708715                                 * 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.
    712717                                 */
    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)) {
    715739                                        /*
    716740                                         * ENOTDIR and ELOOP both map to
Note: See TracChangeset for help on using the changeset viewer.