Slightly modified long filenames-patch from Alex Miller <asm at asm.kiev.ua>

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@977 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Michael Gernoth 2005-08-15 11:44:35 +00:00
parent 75ea7d9148
commit 7ffe422a52
3 changed files with 15 additions and 11 deletions

16
disk.c
View File

@ -144,10 +144,10 @@ BOOL g_notify_stamp = False;
typedef struct typedef struct
{ {
char name[256]; char name[PATH_MAX];
char label[256]; char label[PATH_MAX];
unsigned long serial; unsigned long serial;
char type[256]; char type[PATH_MAX];
} FsInfoType; } FsInfoType;
static NTSTATUS NotifyInfo(NTHANDLE handle, uint32 info_class, NOTIFY * p); static NTSTATUS NotifyInfo(NTHANDLE handle, uint32 info_class, NOTIFY * p);
@ -344,7 +344,7 @@ disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create
NTHANDLE handle; NTHANDLE handle;
DIR *dirp; DIR *dirp;
int flags, mode; int flags, mode;
char path[256]; char path[PATH_MAX];
struct stat filestat; struct stat filestat;
handle = 0; handle = 0;
@ -491,7 +491,7 @@ disk_create(uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create
g_fileinfo[handle].device_id = device_id; g_fileinfo[handle].device_id = device_id;
g_fileinfo[handle].flags_and_attributes = flags_and_attributes; g_fileinfo[handle].flags_and_attributes = flags_and_attributes;
g_fileinfo[handle].accessmask = accessmask; g_fileinfo[handle].accessmask = accessmask;
strncpy(g_fileinfo[handle].path, path, 255); strncpy(g_fileinfo[handle].path, path, PATH_MAX-1);
g_fileinfo[handle].delete_on_close = False; g_fileinfo[handle].delete_on_close = False;
g_notify_stamp = True; g_notify_stamp = True;
@ -698,7 +698,7 @@ NTSTATUS
disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out) disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out)
{ {
uint32 length, file_attributes, ft_high, ft_low, delete_on_close; uint32 length, file_attributes, ft_high, ft_low, delete_on_close;
char newname[256], fullpath[256]; char newname[PATH_MAX], fullpath[PATH_MAX];
struct fileinfo *pfinfo; struct fileinfo *pfinfo;
int mode; int mode;
struct stat filestat; struct stat filestat;
@ -1112,7 +1112,7 @@ NTSTATUS
disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM out) disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM out)
{ {
uint32 file_attributes, ft_low, ft_high; uint32 file_attributes, ft_low, ft_high;
char *dirname, fullpath[256]; char *dirname, fullpath[PATH_MAX];
DIR *pdir; DIR *pdir;
struct dirent *pdirent; struct dirent *pdirent;
struct stat fstat; struct stat fstat;
@ -1130,7 +1130,7 @@ disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM o
/* If a search pattern is received, remember this pattern, and restart search */ /* If a search pattern is received, remember this pattern, and restart search */
if (pattern[0] != 0) if (pattern[0] != 0)
{ {
strncpy(pfinfo->pattern, 1 + strrchr(pattern, '/'), 64); strncpy(pfinfo->pattern, 1 + strrchr(pattern, '/'), PATH_MAX-1);
rewinddir(pdir); rewinddir(pdir);
} }

View File

@ -352,7 +352,7 @@ rdpdr_process_irp(STREAM s)
error_mode, error_mode,
share_mode, disposition, total_timeout, interval_timeout, flags_and_attributes = 0; share_mode, disposition, total_timeout, interval_timeout, flags_and_attributes = 0;
char filename[256]; char filename[PATH_MAX];
uint8 *buffer, *pst_buf; uint8 *buffer, *pst_buf;
struct stream out; struct stream out;
DEVICE_FNS *fns; DEVICE_FNS *fns;

View File

@ -248,13 +248,17 @@ typedef struct notify_data
} }
NOTIFY; NOTIFY;
#ifndef PATH_MAX
#define PATH_MAX 256
#endif
typedef struct fileinfo typedef struct fileinfo
{ {
uint32 device_id, flags_and_attributes, accessmask; uint32 device_id, flags_and_attributes, accessmask;
char path[256]; char path[PATH_MAX];
DIR *pdir; DIR *pdir;
struct dirent *pdirent; struct dirent *pdirent;
char pattern[64]; char pattern[PATH_MAX];
BOOL delete_on_close; BOOL delete_on_close;
NOTIFY notify; NOTIFY notify;
uint32 info_class; uint32 info_class;