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/filename.c

    r740 r746  
    384384        if((!conn->case_sensitive || !(conn->fs_capabilities &
    385385                                       FILE_CASE_SENSITIVE_SEARCH)) &&
    386             stat_cache_lookup(conn, &smb_fname->base_name, &dirpath, &start,
     386            stat_cache_lookup(conn, posix_pathnames, &smb_fname->base_name, &dirpath, &start,
    387387                              &smb_fname->st)) {
    388388                goto done;
     
    978978
    979979/****************************************************************************
     980 Ensure a path is not vetod.
     981****************************************************************************/
     982
     983NTSTATUS check_veto_path(connection_struct *conn, const char *name)
     984{
     985        if (IS_VETO_PATH(conn, name))  {
     986                /* Is it not dot or dot dot. */
     987                if (!(ISDOT(name) || ISDOTDOT(name))) {
     988                        DEBUG(5,("check_veto_path: file path name %s vetoed\n",
     989                                                name));
     990                        return map_nt_error_from_unix(ENOENT);
     991                }
     992        }
     993        return NT_STATUS_OK;
     994}
     995
     996/****************************************************************************
    980997 Check a filename - possibly calling check_reduced_name.
    981998 This is called by every routine before it allows an operation on a filename.
     
    9861003NTSTATUS check_name(connection_struct *conn, const char *name)
    9871004{
    988         if (IS_VETO_PATH(conn, name))  {
    989                 /* Is it not dot or dot dot. */
    990                 if (!((name[0] == '.') && (!name[1] ||
    991                                         (name[1] == '.' && !name[2])))) {
    992                         DEBUG(5,("check_name: file path name %s vetoed\n",
    993                                                 name));
    994                         return map_nt_error_from_unix(ENOENT);
    995                 }
     1005        NTSTATUS status = check_veto_path(conn, name);
     1006
     1007        if (!NT_STATUS_IS_OK(status)) {
     1008                return status;
    9961009        }
    9971010
    9981011        if (!lp_widelinks(SNUM(conn)) || !lp_symlinks(SNUM(conn))) {
    999                 NTSTATUS status = check_reduced_name(conn,name);
     1012                status = check_reduced_name(conn,name);
    10001013                if (!NT_STATUS_IS_OK(status)) {
    10011014                        DEBUG(5,("check_name: name %s failed with %s\n",name,
     
    11711184{
    11721185        NTSTATUS status;
    1173         unsigned int i, num_streams;
     1186        unsigned int i, num_streams = 0;
    11741187        struct stream_struct *streams = NULL;
    11751188
     
    11861199
    11871200        /* Fall back to a case-insensitive scan of all streams on the file. */
    1188         status = SMB_VFS_STREAMINFO(conn, NULL, smb_fname->base_name, mem_ctx,
    1189                                     &num_streams, &streams);
     1201        status = vfs_streaminfo(conn, NULL, smb_fname->base_name, mem_ctx,
     1202                                &num_streams, &streams);
    11901203
    11911204        if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
     
    13151328        }
    13161329
     1330        if ((ucf_flags & UCF_UNIX_NAME_LOOKUP) &&
     1331                        VALID_STAT((*pp_smb_fname)->st) &&
     1332                        S_ISLNK((*pp_smb_fname)->st.st_ex_mode)) {
     1333                return check_veto_path(conn, (*pp_smb_fname)->base_name);
     1334        }
     1335
    13171336        status = check_name(conn, (*pp_smb_fname)->base_name);
    13181337        if (!NT_STATUS_IS_OK(status)) {
Note: See TracChangeset for help on using the changeset viewer.