Ignore:
Timestamp:
May 26, 2009, 9:44:50 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/smbd/trans2.c

    r205 r228  
    10921092        if (mask[0] == '.' && mask[1] == 0)
    10931093                return False;
     1094        if (dptr_has_wild(conn->dirptr)) {
     1095                return False;
     1096        }
    10941097        if (conn->case_sensitive)
    10951098                return strcmp(str,mask)==0;
    1096         if (StrCaseCmp(str,mask) != 0) {
    1097                 return False;
    1098         }
    1099         if (dptr_has_wild(conn->dirptr)) {
    1100                 return False;
    1101         }
    1102         return True;
     1099        else
     1100                return StrCaseCmp(str,mask) == 0;
    11031101}
    11041102
     
    11341132#endif
    11351133
    1136         DEBUG(0,("unix_filetype: unknown filetype %u", (unsigned)mode));
     1134        DEBUG(0,("unix_filetype: unknown filetype %u\n", (unsigned)mode));
    11371135        return UNIX_TYPE_UNKNOWN;
    11381136}
     
    18971895        int info_level;
    18981896        char *directory = NULL;
    1899         const char *mask = NULL;
     1897        char *mask = NULL;
    19001898        char *p;
    19011899        int last_entry_off=0;
     
    19851983        }
    19861984
    1987         ntstatus = unix_convert(ctx, conn, directory, True, &directory, NULL, &sbuf);
     1985        ntstatus = unix_convert(ctx, conn, directory, True, &directory, &mask, &sbuf);
    19881986        if (!NT_STATUS_IS_OK(ntstatus)) {
    19891987                reply_nterror(req, ntstatus);
     
    20011999                /* Windows and OS/2 systems treat search on the root '\' as if it were '\*' */
    20022000                if((directory[0] == '.') && (directory[1] == '\0')) {
    2003                         mask = "*";
     2001                        mask = talloc_strdup(ctx,"*");
     2002                        if (!mask) {
     2003                                reply_nterror(req, NT_STATUS_NO_MEMORY);
     2004                                return;
     2005                        }
    20042006                        mask_contains_wcard = True;
    2005                 } else {
    2006                         mask = directory;
    20072007                }
    20082008                directory = talloc_strdup(talloc_tos(), "./");
     
    20122012                }
    20132013        } else {
    2014                 mask = p+1;
    20152014                *p = 0;
    20162015        }
     
    39903989                }
    39913990
     3991                if ((conn->fs_capabilities & FILE_NAMED_STREAMS)
     3992                    && is_ntfs_stream_name(fname)) {
     3993                        char *base;
     3994                        SMB_STRUCT_STAT bsbuf;
     3995
     3996                        status = split_ntfs_stream_name(talloc_tos(), fname,
     3997                                                        &base, NULL);
     3998                        if (!NT_STATUS_IS_OK(status)) {
     3999                                DEBUG(10, ("create_file_unixpath: "
     4000                                        "split_ntfs_stream_name failed: %s\n",
     4001                                        nt_errstr(status)));
     4002                                reply_nterror(req, status);
     4003                                return;
     4004                        }
     4005
     4006                        SMB_ASSERT(!is_ntfs_stream_name(base)); /* paranoia.. */
     4007
     4008                        if (INFO_LEVEL_IS_UNIX(info_level)) {
     4009                                /* Always do lstat for UNIX calls. */
     4010                                if (SMB_VFS_LSTAT(conn,base,&bsbuf)) {
     4011                                        DEBUG(3,("call_trans2qfilepathinfo: SMB_VFS_LSTAT of %s failed (%s)\n",base,strerror(errno)));
     4012                                        reply_unixerror(req,ERRDOS,ERRbadpath);
     4013                                        return;
     4014                                }
     4015                        } else {
     4016                                if (SMB_VFS_STAT(conn,base,&bsbuf) != 0) {
     4017                                        DEBUG(3,("call_trans2qfilepathinfo: fileinfo of %s failed (%s)\n",base,strerror(errno)));
     4018                                        reply_unixerror(req,ERRDOS,ERRbadpath);
     4019                                        return;
     4020                                }
     4021                        }
     4022
     4023                        fileid = vfs_file_id_from_sbuf(conn, &bsbuf);
     4024                        get_file_infos(fileid, &delete_pending, NULL);
     4025                        if (delete_pending) {
     4026                                reply_nterror(req, NT_STATUS_DELETE_PENDING);
     4027                                return;
     4028                        }
     4029                }
     4030
    39924031                if (INFO_LEVEL_IS_UNIX(info_level)) {
    39934032                        /* Always do lstat for UNIX calls. */
     
    49034942
    49044943                if (fsp != NULL) {
    4905                         set_sticky_write_time_fsp(fsp, ts[1]);
     4944                        if (fsp->base_fsp) {
     4945                                set_sticky_write_time_fsp(fsp->base_fsp, ts[1]);
     4946                        } else {
     4947                                set_sticky_write_time_fsp(fsp, ts[1]);
     4948                        }
    49064949                } else {
    49074950                        set_sticky_write_time_path(conn, fname,
     
    49174960#endif
    49184961        DEBUG(10,("smb_set_file_time: setting utimes to modified values.\n"));
     4962
     4963        if (fsp && fsp->base_fsp) {
     4964                fname = fsp->base_fsp->fsp_name;
     4965        }
    49194966
    49204967        if(file_ntimes(conn, fname, ts)!=0) {
     
    53465393        }
    53475394
    5348         /* Create the base directory. */
    5349         base_name = talloc_strdup(ctx, fname);
    5350         if (!base_name) {
    5351                 return NT_STATUS_NO_MEMORY;
    5352         }
    5353         p = strrchr_m(base_name, '/');
    5354         if (p) {
    5355                 p[1] = '\0';
    5356         } else {
    5357                 base_name = talloc_strdup(ctx, "./");
     5395        if (fsp && fsp->base_fsp) {
     5396                if (newname[0] != ':') {
     5397                        return NT_STATUS_NOT_SUPPORTED;
     5398                }
     5399                base_name = talloc_asprintf(ctx, "%s%s",
     5400                                           fsp->base_fsp->fsp_name,
     5401                                           newname);
    53585402                if (!base_name) {
    53595403                        return NT_STATUS_NO_MEMORY;
    53605404                }
    5361         }
    5362         /* Append the new name. */
    5363         base_name = talloc_asprintf_append(base_name,
    5364                         "%s",
    5365                         newname);
    5366         if (!base_name) {
    5367                 return NT_STATUS_NO_MEMORY;
     5405        } else {
     5406                if (is_ntfs_stream_name(newname)) {
     5407                        return NT_STATUS_NOT_SUPPORTED;
     5408                }
     5409
     5410                /* Create the base directory. */
     5411                base_name = talloc_strdup(ctx, fname);
     5412                if (!base_name) {
     5413                        return NT_STATUS_NO_MEMORY;
     5414                }
     5415                p = strrchr_m(base_name, '/');
     5416                if (p) {
     5417                        p[1] = '\0';
     5418                } else {
     5419                        base_name = talloc_strdup(ctx, "./");
     5420                        if (!base_name) {
     5421                                return NT_STATUS_NO_MEMORY;
     5422                        }
     5423                }
     5424                /* Append the new name. */
     5425                base_name = talloc_asprintf_append(base_name,
     5426                                "%s",
     5427                                newname);
     5428                if (!base_name) {
     5429                        return NT_STATUS_NO_MEMORY;
     5430                }
    53685431        }
    53695432
     
    70677130                        return;
    70687131                }
    7069         } else if (IVAL(pdata,0) != 4) {
    7070                 reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
    7071                 return;
    7072         }
     7132        }
     7133        /* If total_data == 4 Windows doesn't care what values
     7134         * are placed in that field, it just ignores them.
     7135         * The System i QNTC IBM SMB client puts bad values here,
     7136         * so ignore them. */
    70737137
    70747138        status = create_directory(conn, req, directory);
Note: See TracChangeset for help on using the changeset viewer.