Ignore:
Timestamp:
Nov 27, 2012, 4:56:06 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated vendor to 3.6.9

File:
1 edited

Legend:

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

    r740 r746  
    202202NTSTATUS delete_all_streams(connection_struct *conn, const char *fname)
    203203{
    204         struct stream_struct *stream_info;
     204        struct stream_struct *stream_info = NULL;
    205205        int i;
    206         unsigned int num_streams;
     206        unsigned int num_streams = 0;
    207207        TALLOC_CTX *frame = talloc_stackframe();
    208208        NTSTATUS status;
    209209
    210         status = SMB_VFS_STREAMINFO(conn, NULL, fname, talloc_tos(),
    211                                     &num_streams, &stream_info);
     210        status = vfs_streaminfo(conn, NULL, fname, talloc_tos(),
     211                                &num_streams, &stream_info);
    212212
    213213        if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) {
     
    218218
    219219        if (!NT_STATUS_IS_OK(status)) {
    220                 DEBUG(10, ("SMB_VFS_STREAMINFO failed: %s\n",
     220                DEBUG(10, ("vfs_streaminfo failed: %s\n",
    221221                           nt_errstr(status)));
    222222                goto fail;
     
    281281        struct file_id id;
    282282        const struct security_unix_token *del_token = NULL;
     283        const struct security_token *del_nt_token = NULL;
     284        bool got_tokens = false;
    283285
    284286        /* Ensure any pending write time updates are done. */
     
    346348                }
    347349                fsp->delete_on_close = true;
    348                 set_delete_on_close_lck(fsp, lck, True, get_current_utok(conn));
     350                set_delete_on_close_lck(fsp, lck, True,
     351                                get_current_nttok(conn),
     352                                get_current_utok(conn));
    349353                if (became_user) {
    350354                        unbecome_user();
     
    399403        fsp->update_write_time_on_close = false;
    400404
    401         del_token = get_delete_on_close_token(lck, fsp->name_hash);
    402         SMB_ASSERT(del_token != NULL);
     405        got_tokens = get_delete_on_close_token(lck, fsp->name_hash,
     406                                        &del_nt_token, &del_token);
     407        SMB_ASSERT(got_tokens);
    403408
    404409        if (!unix_token_equal(del_token, get_current_utok(conn))) {
     
    419424                            del_token->ngroups,
    420425                            del_token->groups,
    421                             NULL);
     426                            del_nt_token);
    422427
    423428                changed_user = true;
     
    492497
    493498        fsp->delete_on_close = false;
    494         set_delete_on_close_lck(fsp, lck, false, NULL);
     499        set_delete_on_close_lck(fsp, lck, false, NULL, NULL);
    495500
    496501 done:
     
    818823        }
    819824
    820         if(((errno == ENOTEMPTY)||(errno == EEXIST)) && lp_veto_files(SNUM(conn))) {
     825        if(((errno == ENOTEMPTY)||(errno == EEXIST)) && *lp_veto_files(SNUM(conn))) {
    821826                /*
    822827                 * Check to see if the only thing in this directory are
     
    963968        NTSTATUS status = NT_STATUS_OK;
    964969        NTSTATUS status1 = NT_STATUS_OK;
     970        const struct security_token *del_nt_token = NULL;
    965971        const struct security_unix_token *del_token = NULL;
    966972
     
    9991005                                               fsp->fsp_name->base_name);
    10001006                set_delete_on_close_lck(fsp, lck, true,
     1007                                get_current_nttok(fsp->conn),
    10011008                                get_current_utok(fsp->conn));
    10021009                fsp->delete_on_close = true;
     
    10061013        }
    10071014
    1008         del_token = get_delete_on_close_token(lck, fsp->name_hash);
    1009         delete_dir = (del_token != NULL);
     1015        delete_dir = get_delete_on_close_token(lck, fsp->name_hash,
     1016                                        &del_nt_token, &del_token);
    10101017
    10111018        if (delete_dir) {
     
    10391046                                del_token->ngroups,
    10401047                                del_token->groups,
    1041                                 NULL);
     1048                                del_nt_token);
    10421049
    10431050                TALLOC_FREE(lck);
     1051
     1052                if ((fsp->conn->fs_capabilities & FILE_NAMED_STREAMS)
     1053                    && !is_ntfs_stream_smb_fname(fsp->fsp_name)) {
     1054
     1055                        status = delete_all_streams(fsp->conn, fsp->fsp_name->base_name);
     1056                        if (!NT_STATUS_IS_OK(status)) {
     1057                                DEBUG(5, ("delete_all_streams failed: %s\n",
     1058                                          nt_errstr(status)));
     1059                                goto out;
     1060                        }
     1061                }
    10441062
    10451063                status = rmdir_internals(talloc_tos(), fsp);
Note: See TracChangeset for help on using the changeset viewer.