Ignore:
Timestamp:
Aug 2, 2010, 6:40:21 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.5: vendor update to 3.5.4

File:
1 edited

Legend:

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

    r414 r478  
    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
     
    10611078
    10621079        /* Any data in this call is an EA list. */
    1063         if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) {
    1064                 reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
    1065                 goto out;
    1066         }
    1067 
    1068         if (total_data != 4) {
     1080        if (total_data && (total_data != 4)) {
    10691081                if (total_data < 10) {
    10701082                        reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
     
    10851097                        goto out;
    10861098                }
    1087         } else if (IVAL(pdata,0) != 4) {
    1088                 reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
    1089                 goto out;
     1099
     1100                if (!lp_ea_support(SNUM(conn))) {
     1101                        reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
     1102                        goto out;
     1103                }
    10901104        }
    10911105
     
    14781492        uint64_t file_size = 0;
    14791493        uint64_t allocation_size = 0;
     1494        uint64_t file_index = 0;
    14801495        uint32_t len;
    14811496        struct timespec mdate_ts, adate_ts, cdate_ts, create_date_ts;
     
    14991514        }
    15001515        allocation_size = SMB_VFS_GET_ALLOC_SIZE(conn, NULL, &smb_fname->st);
     1516
     1517        file_index = get_FileIndex(conn, &smb_fname->st);
    15011518
    15021519        mdate_ts = smb_fname->st.st_ex_mtime;
     
    18681885                }
    18691886                SIVAL(p,0,0); p += 4; /* Unknown - reserved ? */
    1870                 SIVAL(p,0,smb_fname->st.st_ex_ino); p += 4; /* FileIndexLow */
    1871                 SIVAL(p,0,smb_fname->st.st_ex_dev); p += 4; /* FileIndexHigh */
     1887                SBVAL(p,0,file_index); p += 8;
    18721888                len = srvstr_push(base_data, flags2, p,
    18731889                                  fname, PTR_DIFF(end_data, p),
     
    19391955                p += 26;
    19401956                SSVAL(p,0,0); p += 2; /* Reserved ? */
    1941                 SIVAL(p,0,smb_fname->st.st_ex_ino); p += 4; /* FileIndexLow */
    1942                 SIVAL(p,0,smb_fname->st.st_ex_dev); p += 4; /* FileIndexHigh */
     1957                SBVAL(p,0,file_index); p += 8;
    19431958                len = srvstr_push(base_data, flags2, p,
    19441959                                  fname, PTR_DIFF(end_data, p),
     
    38543869                                const SMB_STRUCT_STAT *psbuf)
    38553870{
     3871        uint64_t file_index = get_FileIndex(conn, psbuf);
     3872
    38563873        DEBUG(10,("store_file_unix_basic: SMB_QUERY_FILE_UNIX_BASIC\n"));
    38573874        DEBUG(4,("store_file_unix_basic: st_mode=%o\n",(int)psbuf->st_ex_mode));
     
    38873904        pdata += 8;
    38883905
    3889         SINO_T_VAL(pdata,0,(SMB_INO_T)psbuf->st_ex_ino);   /* inode number */
     3906        SINO_T_VAL(pdata,0,(SMB_INO_T)file_index);   /* inode number */
    38903907        pdata += 8;
    38913908
     
    42894306           I think this causes us to fail the IFSKIT
    42904307           BasicFileInformationTest. -tpot */
    4291         file_index =  ((psbuf->st_ex_ino) & UINT32_MAX); /* FileIndexLow */
    4292         file_index |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32; /* FileIndexHigh */
     4308        file_index = get_FileIndex(conn, psbuf);
    42934309
    42944310        switch (info_level) {
     
    59345950                                       req->flags2 & FLAGS2_DFS_PATHNAMES,
    59355951                                       newname,
     5952                                       true,
    59365953                                       &newname,
    59375954                                       &dest_has_wcard);
     
    78067823        }
    78077824
    7808         /* Any data in this call is an EA list. */
    7809         if (total_data && (total_data != 4) && !lp_ea_support(SNUM(conn))) {
    7810                 reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
    7811                 goto out;
    7812         }
    7813 
    78147825        /*
    78157826         * OS/2 workplace shell seems to send SET_EA requests of "null"
     
    78187829         */
    78197830
    7820         if (total_data != 4) {
     7831        if (total_data && (total_data != 4)) {
     7832                /* Any data in this call is an EA list. */
    78217833                if (total_data < 10) {
    78227834                        reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
     
    78357847                if (!ea_list) {
    78367848                        reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
     7849                        goto out;
     7850                }
     7851
     7852                if (!lp_ea_support(SNUM(conn))) {
     7853                        reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
    78377854                        goto out;
    78387855                }
Note: See TracChangeset for help on using the changeset viewer.