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

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/smbd/smb2_setinfo.c

    r414 r745  
    44
    55   Copyright (C) Stefan Metzmacher 2009
     6   Copyright (C) Jeremy Allison 2010
    67
    78   This program is free software; you can redistribute it and/or modify
     
    2021
    2122#include "includes.h"
     23#include "smbd/smbd.h"
    2224#include "smbd/globals.h"
    2325#include "../libcli/smb/smb_common.h"
     26#include "trans2.h"
     27#include "../lib/util/tevent_ntstatus.h"
    2428
    2529static struct tevent_req *smbd_smb2_setinfo_send(TALLOC_CTX *mem_ctx,
     
    8892        if (req->compat_chain_fsp) {
    8993                /* skip check */
    90         } else if (in_file_id_persistent != 0) {
     94        } else if (in_file_id_persistent != in_file_id_volatile) {
    9195                return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED);
    9296        }
     
    162166                                                 uint64_t in_file_id_volatile)
    163167{
    164         struct tevent_req *req;
    165         struct smbd_smb2_setinfo_state *state;
    166         struct smb_request *smbreq;
     168        struct tevent_req *req = NULL;
     169        struct smbd_smb2_setinfo_state *state = NULL;
     170        struct smb_request *smbreq = NULL;
    167171        connection_struct *conn = smb2req->tcon->compat_conn;
    168         files_struct *fsp;
     172        files_struct *fsp = NULL;
     173        NTSTATUS status;
    169174
    170175        req = tevent_req_create(mem_ctx, &state,
     
    209214                int data_size;
    210215                int ret_size = 0;
    211                 NTSTATUS status;
    212216
    213217
    214218                file_info_level = in_file_info_class + 1000;
    215219                if (file_info_level == SMB_FILE_RENAME_INFORMATION) {
    216                         file_info_level = 0xFF00 + in_file_info_class;
    217                 }
    218 
    219                 if (fsp->is_directory || fsp->fh->fd == -1) {
     220                        /* SMB2_FILE_RENAME_INFORMATION_INTERNAL == 0xFF00 + in_file_info_class */
     221                        file_info_level = SMB2_FILE_RENAME_INFORMATION_INTERNAL;
     222                        if (fsp->oplock_type != FAKE_LEVEL_II_OPLOCK &&
     223                            fsp->oplock_type != NO_OPLOCK) {
     224                                /* No break, but error. */
     225                                tevent_req_nterror(req, NT_STATUS_SHARING_VIOLATION);
     226                                return tevent_req_post(req, ev);
     227                        }
     228                }
     229
     230                if (fsp->fh->fd == -1) {
    220231                        /*
    221232                         * This is actually a SETFILEINFO on a directory
     
    252263                            && in_input_buffer.length >= 1
    253264                            && CVAL(in_input_buffer.data,0)) {
    254                                 fsp->fh->private_options |= FILE_DELETE_ON_CLOSE;
     265                                fsp->fh->private_options |= NTCREATEX_OPTIONS_PRIVATE_DELETE_ON_CLOSE;
    255266
    256267                                DEBUG(3,("smbd_smb2_setinfo_send: "
     
    285296                        data = (char *)SMB_MALLOC_ARRAY(char, data_size);
    286297                        if (tevent_req_nomem(data, req)) {
    287 
     298                                return tevent_req_post(req, ev);
    288299                        }
    289300                        memcpy(data, in_input_buffer.data, data_size);
     
    308319        }
    309320
     321        case 0x03:/* SMB2_SETINFO_SECURITY */
     322        {
     323                if (!CAN_WRITE(conn)) {
     324                        tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
     325                        return tevent_req_post(req, ev);
     326                }
     327
     328                status = set_sd(fsp,
     329                                in_input_buffer.data,
     330                                in_input_buffer.length,
     331                                in_additional_information);
     332                if (!NT_STATUS_IS_OK(status)) {
     333                        tevent_req_nterror(req, status);
     334                        return tevent_req_post(req, ev);
     335                }
     336                break;
     337        }
     338
    310339        default:
    311340                tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
Note: See TracChangeset for help on using the changeset viewer.