Ignore:
Timestamp:
May 29, 2008, 12:22:03 PM (17 years ago)
Author:
Paul Smedley
Message:

Update trunk to 3.2.0rc1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/smbd/trans2.c

    r133 r136  
    12061206        return NT_STATUS_OK;
    12071207}
     1208
     1209/****************************************************************************
     1210 Needed to show the msdfs symlinks as directories. Modifies psbuf
     1211 to be a directory if it's a msdfs link.
     1212****************************************************************************/
     1213
     1214static bool check_msdfs_link(connection_struct *conn,
     1215                                const char *pathname,
     1216                                SMB_STRUCT_STAT *psbuf)
     1217{
     1218        int saved_errno = errno;
     1219        if(lp_host_msdfs() &&
     1220                lp_msdfs_root(SNUM(conn)) &&
     1221                is_msdfs_link(conn, pathname, psbuf)) {
     1222
     1223                DEBUG(5,("check_msdfs_link: Masquerading msdfs link %s "
     1224                        "as a directory\n",
     1225                        pathname));
     1226                psbuf->st_mode = (psbuf->st_mode & 0xFFF) | S_IFDIR;
     1227                errno = saved_errno;
     1228                return true;
     1229        }
     1230        errno = saved_errno;
     1231        return false;
     1232}
     1233
    12081234
    12091235/****************************************************************************
     
    13721398                                 * directories */
    13731399
    1374                                 if(lp_host_msdfs() &&
    1375                                    lp_msdfs_root(SNUM(conn)) &&
    1376                                    ((ms_dfs_link = is_msdfs_link(conn, pathreal, &sbuf)) == True)) {
    1377                                         DEBUG(5,("get_lanman2_dir_entry: Masquerading msdfs link %s "
    1378                                                 "as a directory\n",
    1379                                                 pathreal));
    1380                                         sbuf.st_mode = (sbuf.st_mode & 0xFFF) | S_IFDIR;
    1381 
    1382                                 } else {
    1383 
     1400                                ms_dfs_link = check_msdfs_link(conn, pathreal, &sbuf);
     1401                                if (!ms_dfs_link) {
    13841402                                        DEBUG(5,("get_lanman2_dir_entry:Couldn't stat [%s] (%s)\n",
    13851403                                                pathreal,strerror(errno)));
     
    38183836        uint32 access_mask = 0x12019F; /* Default - GENERIC_EXECUTE mapping from Windows */
    38193837        char *lock_data = NULL;
     3838        bool ms_dfs_link = false;
    38203839        TALLOC_CTX *ctx = talloc_tos();
    38213840
     
    39713990                                return;
    39723991                        }
     3992
    39733993                } else if (!VALID_STAT(sbuf) && SMB_VFS_STAT(conn,fname,&sbuf) && (info_level != SMB_INFO_IS_NAME_VALID)) {
    3974                         DEBUG(3,("call_trans2qfilepathinfo: SMB_VFS_STAT of %s failed (%s)\n",fname,strerror(errno)));
    3975                         reply_unixerror(req, ERRDOS, ERRbadpath);
    3976                         return;
     3994                        ms_dfs_link = check_msdfs_link(conn,fname,&sbuf);
     3995
     3996                        if (!ms_dfs_link) {
     3997                                DEBUG(3,("call_trans2qfilepathinfo: SMB_VFS_STAT of %s failed (%s)\n",fname,strerror(errno)));
     3998                                reply_unixerror(req, ERRDOS, ERRbadpath);
     3999                                return;
     4000                        }
    39774001                }
    39784002
     
    39994023                base_name = p+1;
    40004024
    4001         mode = dos_mode(conn,fname,&sbuf);
     4025        if (ms_dfs_link) {
     4026                mode = dos_mode_msdfs(conn,fname,&sbuf);
     4027        } else {
     4028                mode = dos_mode(conn,fname,&sbuf);
     4029        }
    40024030        if (!mode)
    40034031                mode = FILE_ATTRIBUTE_NORMAL;
Note: See TracChangeset for help on using the changeset viewer.