Ignore:
Timestamp:
Aug 2, 2010, 8:16:45 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: trunk update to 3.5.4

Location:
trunk/server
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

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

    r414 r480  
    556556int dptr_CloseDir(struct dptr_struct *dptr)
    557557{
    558         struct smbd_server_connection *sconn = dptr->conn->sconn;
    559         DLIST_REMOVE(sconn->smb1.searches.dirptrs, dptr);
    560         TALLOC_FREE(dptr->dir_hnd);
     558        dptr_close_internal(dptr);
    561559        return 0;
    562560}
  • trunk/server/source3/smbd/filename.c

    r414 r480  
    11261126{
    11271127        NTSTATUS status;
     1128        bool allow_wcards = (ucf_flags & (UCF_COND_ALLOW_WCARD_LCOMP|UCF_ALWAYS_ALLOW_WCARD_LCOMP));
    11281129        char *fname = NULL;
    11291130
     
    11331134                                dfs_path,
    11341135                                name_in,
     1136                                allow_wcards,
    11351137                                &fname,
    11361138                                ppath_contains_wcard);
  • trunk/server/source3/smbd/msdfs.c

    r414 r480  
    17391739                                bool dfs_pathnames,
    17401740                                const char *name_in,
     1741                                bool allow_wcards,
    17411742                                char **pp_name_out,
    17421743                                bool *ppath_contains_wcard)
     
    17491750                                        conn,
    17501751                                        name_in,
    1751                                         True,
     1752                                        allow_wcards,
    17521753                                        pp_name_out,
    17531754                                        &path_contains_wcard);
  • trunk/server/source3/smbd/service.c

    r454 r480  
    10391039                goto err_root_exit;
    10401040        }
     1041        conn->base_share_dev = smb_fname_cpath->st.st_ex_dev;
    10411042
    10421043        string_set(&conn->origpath,conn->connectpath);
  • trunk/server/source3/smbd/smb2_create.c

    r414 r480  
    652652                if (qfid) {
    653653                        uint8_t p[32];
     654                        uint64_t file_index = get_FileIndex(result->conn,
     655                                                        &result->fsp_name->st);
    654656                        DATA_BLOB blob = data_blob_const(p, sizeof(p));
    655657
    656658                        ZERO_STRUCT(p);
    657659
    658                         /* TODO: maybe use result->file_id */
    659                         SIVAL(p, 0, result->fsp_name->st.st_ex_ino);/* FileIndexLow */
    660                         SIVAL(p, 4, result->fsp_name->st.st_ex_dev);/* FileIndexHigh */
     660                        /* From conversations with Microsoft engineers at
     661                           the MS plugfest. The first 8 bytes are the "volume index"
     662                           == inode, the second 8 bytes are the "volume id",
     663                           == dev. This will be updated in the SMB2 doc. */
     664                        SBVAL(p, 0, file_index);
     665                        SIVAL(p, 8, result->fsp_name->st.st_ex_dev);/* FileIndexHigh */
    661666
    662667                        status = smb2_create_blob_add(state, &out_context_blobs,
  • trunk/server/source3/smbd/trans2.c

    r454 r480  
    5656        }
    5757        return val;
     58}
     59
     60/********************************************************************
     61 Create a 64 bit FileIndex. If the file is on the same device as
     62 the root of the share, just return the 64-bit inode. If it isn't,
     63 mangle as we used to do.
     64********************************************************************/
     65
     66uint64_t get_FileIndex(connection_struct *conn, const SMB_STRUCT_STAT *psbuf)
     67{
     68        uint64_t file_index;
     69        if (conn->base_share_dev == psbuf->st_ex_dev) {
     70                return (uint64_t)psbuf->st_ex_ino;
     71        }
     72        file_index = ((psbuf->st_ex_ino) & UINT32_MAX); /* FileIndexLow */
     73        file_index |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32; /* FileIndexHigh */
     74        return file_index;
    5875}
    5976
     
    133150        } else {
    134151#else
    135                 {
     152                {
    136153#endif
    137154                pea->name = talloc_strdup(mem_ctx, ea_name);
     
    10741091
    10751092        /* Any data in this call is an EA list. */
    1076         if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) {
    1077                 reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
    1078                 goto out;
    1079         }
    1080 
    1081         if (total_data != 4) {
     1093        if (total_data && (total_data != 4)) {
    10821094                if (total_data < 10) {
    10831095                        reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
     
    10981110                        goto out;
    10991111                }
    1100         } else if (IVAL(pdata,0) != 4) {
    1101                 reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
    1102                 goto out;
     1112
     1113                if (!lp_ea_support(SNUM(conn))) {
     1114                        reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
     1115                        goto out;
     1116                }
    11031117        }
    11041118
     
    14911505        uint64_t file_size = 0;
    14921506        uint64_t allocation_size = 0;
     1507        uint64_t file_index = 0;
    14931508        uint32_t len;
    14941509        struct timespec mdate_ts, adate_ts, cdate_ts, create_date_ts;
     
    15121527        }
    15131528        allocation_size = SMB_VFS_GET_ALLOC_SIZE(conn, NULL, &smb_fname->st);
     1529
     1530        file_index = get_FileIndex(conn, &smb_fname->st);
    15141531
    15151532        mdate_ts = smb_fname->st.st_ex_mtime;
     
    18811898                }
    18821899                SIVAL(p,0,0); p += 4; /* Unknown - reserved ? */
    1883                 SIVAL(p,0,smb_fname->st.st_ex_ino); p += 4; /* FileIndexLow */
    1884                 SIVAL(p,0,smb_fname->st.st_ex_dev); p += 4; /* FileIndexHigh */
     1900                SBVAL(p,0,file_index); p += 8;
    18851901                len = srvstr_push(base_data, flags2, p,
    18861902                                  fname, PTR_DIFF(end_data, p),
     
    19521968                p += 26;
    19531969                SSVAL(p,0,0); p += 2; /* Reserved ? */
    1954                 SIVAL(p,0,smb_fname->st.st_ex_ino); p += 4; /* FileIndexLow */
    1955                 SIVAL(p,0,smb_fname->st.st_ex_dev); p += 4; /* FileIndexHigh */
     1970                SBVAL(p,0,file_index); p += 8;
    19561971                len = srvstr_push(base_data, flags2, p,
    19571972                                  fname, PTR_DIFF(end_data, p),
     
    38673882                                const SMB_STRUCT_STAT *psbuf)
    38683883{
     3884        uint64_t file_index = get_FileIndex(conn, psbuf);
     3885
    38693886        DEBUG(10,("store_file_unix_basic: SMB_QUERY_FILE_UNIX_BASIC\n"));
    38703887        DEBUG(4,("store_file_unix_basic: st_mode=%o\n",(int)psbuf->st_ex_mode));
     
    39003917        pdata += 8;
    39013918
    3902         SINO_T_VAL(pdata,0,(SMB_INO_T)psbuf->st_ex_ino);   /* inode number */
     3919        SINO_T_VAL(pdata,0,(SMB_INO_T)file_index);   /* inode number */
    39033920        pdata += 8;
    39043921
     
    43024319           I think this causes us to fail the IFSKIT
    43034320           BasicFileInformationTest. -tpot */
    4304         file_index =  ((psbuf->st_ex_ino) & UINT32_MAX); /* FileIndexLow */
    4305         file_index |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32; /* FileIndexHigh */
     4321        file_index = get_FileIndex(conn, psbuf);
    43064322
    43074323        switch (info_level) {
     
    54735489        else {
    54745490#endif
    5475 
    54765491        DEBUG(10,("smb_set_file_time: setting utimes to modified values.\n"));
    54775492
     
    59575972                                       req->flags2 & FLAGS2_DFS_PATHNAMES,
    59585973                                       newname,
     5974                                       true,
    59595975                                       &newname,
    59605976                                       &dest_has_wcard);
     
    78297845        }
    78307846
    7831         /* Any data in this call is an EA list. */
    7832         if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) {
    7833                 reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
    7834                 goto out;
    7835         }
    7836 
    78377847        /*
    78387848         * OS/2 workplace shell seems to send SET_EA requests of "null"
     
    78417851         */
    78427852
    7843         if (total_data != 4) {
     7853        if (total_data && (total_data != 4)) {
     7854                /* Any data in this call is an EA list. */
    78447855                if (total_data < 10) {
    78457856                        reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
     
    78587869                if (!ea_list) {
    78597870                        reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
     7871                        goto out;
     7872                }
     7873
     7874                if (!lp_ea_support(SNUM(conn))) {
     7875                        reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
    78607876                        goto out;
    78617877                }
Note: See TracChangeset for help on using the changeset viewer.