Ignore:
Timestamp:
Nov 12, 2012, 4:35:55 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: update branche to 3.5.12

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/source3/smbd/filename.c

    r599 r732  
    296296        if((!conn->case_sensitive || !(conn->fs_capabilities &
    297297                                       FILE_CASE_SENSITIVE_SEARCH)) &&
    298             stat_cache_lookup(conn, &smb_fname->base_name, &dirpath, &start,
     298            stat_cache_lookup(conn, posix_pathnames, &smb_fname->base_name, &dirpath, &start,
    299299                              &smb_fname->st)) {
    300300                goto done;
     
    840840
    841841/****************************************************************************
     842 Ensure a path is not vetod.
     843****************************************************************************/
     844
     845NTSTATUS check_veto_path(connection_struct *conn, const char *name)
     846{
     847        if (IS_VETO_PATH(conn, name))  {
     848                /* Is it not dot or dot dot. */
     849                if (!(ISDOT(name) || ISDOTDOT(name))) {
     850                        DEBUG(5,("check_veto_path: file path name %s vetoed\n",
     851                                                name));
     852                        return map_nt_error_from_unix(ENOENT);
     853                }
     854        }
     855        return NT_STATUS_OK;
     856}
     857
     858/****************************************************************************
    842859 Check a filename - possibly calling check_reduced_name.
    843860 This is called by every routine before it allows an operation on a filename.
     
    848865NTSTATUS check_name(connection_struct *conn, const char *name)
    849866{
    850         if (IS_VETO_PATH(conn, name))  {
    851                 /* Is it not dot or dot dot. */
    852                 if (!((name[0] == '.') && (!name[1] ||
    853                                         (name[1] == '.' && !name[2])))) {
    854                         DEBUG(5,("check_name: file path name %s vetoed\n",
    855                                                 name));
    856                         return map_nt_error_from_unix(ENOENT);
    857                 }
     867        NTSTATUS status = check_veto_path(conn, name);
     868
     869        if (!NT_STATUS_IS_OK(status)) {
     870                return status;
    858871        }
    859872
    860873        if (!lp_widelinks(SNUM(conn)) || !lp_symlinks(SNUM(conn))) {
    861                 NTSTATUS status = check_reduced_name(conn,name);
     874                status = check_reduced_name(conn,name);
    862875                if (!NT_STATUS_IS_OK(status)) {
    863876                        DEBUG(5,("check_name: name %s failed with %s\n",name,
     
    11771190        }
    11781191
     1192        if ((ucf_flags & UCF_UNIX_NAME_LOOKUP) &&
     1193                        VALID_STAT((*pp_smb_fname)->st) &&
     1194                        S_ISLNK((*pp_smb_fname)->st.st_ex_mode)) {
     1195                return check_veto_path(conn, (*pp_smb_fname)->base_name);
     1196        }
     1197
    11791198        status = check_name(conn, (*pp_smb_fname)->base_name);
    11801199        if (!NT_STATUS_IS_OK(status)) {
Note: See TracChangeset for help on using the changeset viewer.