Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 264861 Details for
Bug 354725
net-misc/freerdp-0.8.2: filesystem redirection via --rdpdr --data seems to be broken
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
rdpdr patch
rdpdr.patch (text/plain), 5.66 KB, created by
Aljoscha Vollmerhaus
on 2011-03-05 20:58:59 UTC
(
hide
)
Description:
rdpdr patch
Filename:
MIME Type:
Creator:
Aljoscha Vollmerhaus
Created:
2011-03-05 20:58:59 UTC
Size:
5.66 KB
patch
obsolete
>--- a/channels/rdpdr/disk/disk_main.c >+++ b/channels/rdpdr/disk/disk_main.c >@@ -1,22 +1,20 @@ >-/* -*- c-basic-offset: 8 -*- >+/* > FreeRDP: A Remote Desktop Protocol client. > Redirected Disk Device Service > >- Copyright (C) Marc-Andre Moreau <marcandre.moreau@gmail.com> 2010 >+ Copyright 2010 Marc-Andre Moreau <marcandre.moreau@gmail.com> > >- This program is free software; you can redistribute it and/or modify >- it under the terms of the GNU General Public License as published by >- the Free Software Foundation; either version 2 of the License, or >- (at your option) any later version. >- >- This program is distributed in the hope that it will be useful, >- but WITHOUT ANY WARRANTY; without even the implied warranty of >- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >- GNU General Public License for more details. >- >- You should have received a copy of the GNU General Public License >- along with this program; if not, write to the Free Software >- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. >+ Licensed under the Apache License, Version 2.0 (the "License"); >+ you may not use this file except in compliance with the License. >+ You may obtain a copy of the License at >+ >+ http://www.apache.org/licenses/LICENSE-2.0 >+ >+ Unless required by applicable law or agreed to in writing, software >+ distributed under the License is distributed on an "AS IS" BASIS, >+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ See the License for the specific language governing permissions and >+ limitations under the License. > */ > > #include <stdio.h> >@@ -301,6 +299,8 @@ > default: > return RD_STATUS_INVALID_PARAMETER; > } >+ if ((flags & O_CREAT) && (irp->createOptions & FILE_DELETE_ON_CLOSE)) >+ finfo->delete_pending = 1; > > if ((irp->desiredAccess & GENERIC_ALL) > || (irp->desiredAccess & GENERIC_WRITE) >@@ -347,6 +347,68 @@ > return NULL; > } > >+static uint32 >+disk_remove_dir(const char * path) >+{ >+ DIR * dir; >+ struct dirent * pdirent; >+ struct stat file_stat; >+ char * p; >+ uint32 ret = RD_STATUS_SUCCESS; >+ >+ dir = opendir(path); >+ if (dir == NULL) >+ return get_error_status(); >+ >+ pdirent = readdir(dir); >+ while (pdirent) >+ { >+ if (strcmp(pdirent->d_name, ".") == 0 || strcmp(pdirent->d_name, "..") == 0) >+ { >+ pdirent = readdir(dir); >+ continue; >+ } >+ >+ p = malloc(strlen(path) + strlen(pdirent->d_name) + 2); >+ sprintf(p, "%s/%s", path, pdirent->d_name); >+ if (stat(p, &file_stat) != 0) >+ { >+ LLOGLN(0, ("disk_remove_dir: stat %s failed (%i)\n", p, errno)); >+ ret = get_error_status(); >+ } >+ else if (S_ISDIR(file_stat.st_mode)) >+ { >+ ret = disk_remove_dir(p); >+ } >+ else >+ { >+ if (unlink(p) < 0) >+ { >+ LLOGLN(0, ("disk_remove_dir: unlink %s failed (%i)\n", p, errno)); >+ ret = get_error_status(); >+ } >+ } >+ free(p); >+ >+ if (ret != RD_STATUS_SUCCESS) >+ break; >+ >+ pdirent = readdir(dir); >+ } >+ >+ closedir(dir); >+ if (ret == RD_STATUS_SUCCESS) >+ { >+ if (rmdir(path) < 0) >+ { >+ LLOGLN(0, ("disk_remove_dir: rmdir %s failed (%i)\n", path, errno)); >+ ret = get_error_status(); >+ } >+ } >+ >+ return ret; >+} >+ > static void > disk_remove_file(DEVICE * dev, uint32 file_id) > { >@@ -369,8 +431,7 @@ > { > if (curr->is_dir) > { >- /* TODO: this should delete files recursively */ >- rmdir(curr->fullpath); >+ disk_remove_dir(curr->fullpath); > } > else > { >@@ -646,7 +707,7 @@ > SET_UINT64(buf, 0, finfo->file_stat.st_size); /* AllocationSize */ > SET_UINT64(buf, 8, finfo->file_stat.st_size); /* EndOfFile */ > SET_UINT32(buf, 16, finfo->file_stat.st_nlink); /* NumberOfLinks */ >- SET_UINT8(buf, 20, 0); /* DeletePending */ >+ SET_UINT8(buf, 20, finfo->delete_pending); /* DeletePending */ > SET_UINT8(buf, 21, finfo->is_dir); /* Directory */ > size = 22; > break; >@@ -874,8 +935,40 @@ > size = 68 + len; > break; > >+ case FileNamesInformation: >+ size = 12 + strlen(pdirent->d_name) * 2; >+ buf = malloc(size); >+ memset(buf, 0, size); >+ >+ SET_UINT32(buf, 0, 0); /* NextEntryOffset */ >+ SET_UINT32(buf, 4, 0); /* FileIndex */ >+ len = freerdp_set_wstr(buf + 12, size - 12, pdirent->d_name, strlen(pdirent->d_name)); >+ SET_UINT32(buf, 8, len); /* FileNameLength */ >+ size = 12 + len; >+ break; >+ >+ case FileDirectoryInformation: >+ size = 64 + strlen(pdirent->d_name) * 2; >+ buf = malloc(size); >+ memset(buf, 0, size); >+ >+ SET_UINT32(buf, 0, 0); /* NextEntryOffset */ >+ SET_UINT32(buf, 4, 0); /* FileIndex */ >+ SET_UINT64(buf, 8, get_rdp_filetime(file_stat.st_ctime < file_stat.st_mtime ? >+ file_stat.st_ctime : file_stat.st_mtime)); /* CreationTime */ >+ SET_UINT64(buf, 16, get_rdp_filetime(file_stat.st_atime)); /* LastAccessTime */ >+ SET_UINT64(buf, 24, get_rdp_filetime(file_stat.st_mtime)); /* LastWriteTime */ >+ SET_UINT64(buf, 32, get_rdp_filetime(file_stat.st_ctime)); /* ChangeTime */ >+ SET_UINT64(buf, 40, file_stat.st_size); /* EndOfFile */ >+ SET_UINT64(buf, 48, file_stat.st_size); /* AllocationSize */ >+ SET_UINT32(buf, 56, attr); /* FileAttributes */ >+ len = freerdp_set_wstr(buf + 64, size - 64, pdirent->d_name, strlen(pdirent->d_name)); >+ SET_UINT32(buf, 60, len); /* FileNameLength */ >+ size = 64 + len; >+ break; >+ > default: >- LLOGLN(0, ("disk_query_directory: invalid info class")); >+ LLOGLN(0, ("disk_query_directory: invalid info class %d", irp->infoClass)); > status = RD_STATUS_NOT_SUPPORTED; > break; > } >@@ -889,6 +982,10 @@ > static uint32 > disk_notify_change_directory(IRP * irp) > { >+ LLOGLN(10, ("disk_notify_change_directory: id=%d", irp->fileID)); >+ /* TODO: directory change notify is not yet implemented. >+ We simply bypass the request here. */ >+ irp->rwBlocking = 0; > return RD_STATUS_PENDING; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 354725
:
263453
| 264861 |
264863