Ignore:
Timestamp:
Nov 25, 2016, 8:04:54 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.7

File:
1 edited

Legend:

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

    r988 r989  
    169169        TALLOC_CTX *frame = talloc_stackframe();
    170170        NTSTATUS status;
     171        bool saved_posix_pathnames;
    171172
    172173        status = vfs_streaminfo(conn, NULL, fname, talloc_tos(),
     
    192193                return NT_STATUS_OK;
    193194        }
     195
     196        /*
     197         * Any stream names *must* be treated as Windows
     198         * pathnames, even if we're using UNIX extensions.
     199         */
     200
     201        saved_posix_pathnames = lp_set_posix_pathnames(false);
    194202
    195203        for (i=0; i<num_streams; i++) {
     
    224232
    225233 fail:
     234
     235        (void)lp_set_posix_pathnames(saved_posix_pathnames);
    226236        TALLOC_FREE(frame);
    227237        return status;
     
    247257        bool got_tokens = false;
    248258        bool normal_close;
    249         int ret_flock;
    250259
    251260        /* Ensure any pending write time updates are done. */
     
    268277                          "lock for file %s\n", fsp_str_dbg(fsp)));
    269278                return NT_STATUS_INVALID_PARAMETER;
     279        }
     280
     281        /* Remove the oplock before potentially deleting the file. */
     282        if(fsp->oplock_type) {
     283                remove_oplock_under_lock(fsp, lck);
    270284        }
    271285
     
    471485        }
    472486
    473         /* remove filesystem sharemodes */
    474         ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, 0, 0);
    475         if (ret_flock == -1) {
    476                 DEBUG(2, ("close_remove_share_mode: removing kernel flock for "
    477                                         "%s failed: %s\n", fsp_str_dbg(fsp),
    478                                         strerror(errno)));
     487        if (fsp->kernel_share_modes_taken) {
     488                int ret_flock;
     489
     490                /* remove filesystem sharemodes */
     491                ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, 0, 0);
     492                if (ret_flock == -1) {
     493                        DEBUG(2, ("close_remove_share_mode: removing kernel "
     494                                  "flock for %s failed: %s\n",
     495                                  fsp_str_dbg(fsp), strerror(errno)));
     496                }
    479497        }
    480498
     
    732750                file_free(req, fsp);
    733751                return NT_STATUS_OK;
    734         }
    735 
    736         /* Remove the oplock before potentially deleting the file. */
    737         if(fsp->oplock_type) {
    738                 remove_oplock(fsp);
    739752        }
    740753
Note: See TracChangeset for help on using the changeset viewer.