Commit Graph

103 Commits

Author SHA1 Message Date
867c553378 Third Batch: Update files using ChatGPT 4o 2024-05-31 16:19:45 +02:00
Pierre Ossman
f19c21d7d1 Fix memory leak in disk redirection
We kept allocating a data buffer for this stream in each call,
but never freeing it.
2019-05-06 14:33:38 +02:00
Karl Mikaelsson
5351182410 Fix problems with transferring large files
The entire device redirection framework is documented to use 64-bit
offsets rather than 32-bit offsets. This should fix any problems
transfering large files with rdesktop.

Co-Authored-By: gpatel-fr <44170243+gpatel-fr@users.noreply.github.com>
2019-01-31 10:51:19 +01:00
Henrik Andersson
c16b74a974 Run indent-all.sh script on source 2018-10-29 15:53:57 +01:00
Alexander Zakharov
c58d91c077 Fix file sizes for redirected disks 2017-12-15 20:29:37 +03:00
Alexander Zakharov
948831a3fd Fix error format 2017-11-27 18:03:07 +03:00
René Genz
9e99dd52d6 Fix minor spelling mistakes 2017-11-02 01:01:44 +01:00
Karl Mikaelsson
ba568443e1 Merge pull request #179 from hean01-cendio/build_warnings
Remove a bunch of compiler warnings
2017-10-27 12:34:14 +02:00
Henrik Andersson
0d707ae103 Fix sign-compare compiler warnings 2017-10-20 13:30:42 +02:00
Henrik Andersson
896a923f55 Markup unused parameters 2017-10-20 11:05:52 +02:00
Karl Mikaelsson
172c76da17 Remove left-by-accident development log statements
Introduced by e35a76bce.
2017-10-18 18:59:46 +02:00
Karl Mikaelsson
1a026814a5 Move logging code to after variable declarations 2017-10-03 11:07:32 +02:00
Henrik Andersson
e35a76bce2 Refactor writing of utf16 strings into packets
The old code was filled by assumtions that all symbols in utf16
is represented by 2 bytes which is not true and resulted in
truncated strings.

Fixes issue #60
2017-09-29 14:25:41 +02:00
Henrik Andersson
01beda5b45 Ran indent script 2017-09-26 09:03:20 +02:00
Karl Mikaelsson
e3993a6c0d Add more Disk debug logging
A log entry for (almost) every disk operation.
2017-09-22 14:54:36 +02:00
Karl Mikaelsson
a545281d72 Switch disk log subject from Core/Protocol to Disk 2017-09-22 14:54:36 +02:00
Henrik Andersson
1e68d67298 Run indent-all script 2017-03-03 09:31:26 +01:00
Henrik Andersson
7b9a09e173 Merge branch 'master' into logging 2017-01-27 10:56:16 +01:00
Henrik Andersson
87d8d123b8 Rework the logging system
This commit will add a logging system to solve the problem that
one actually need to recompile rdesktop from source to enable
different debug logging.

- Same logging api  for all kind of logging and messages to
   end user.

- Adding -v for verbose output when running rdesktop.

- All messages are logged into a subject and with a type, eg:

     logger(Keyboard, Notice, "Autos-electing %s based on locale.", locale);

- Debug logging is enabled trough a environment variable RDEKSTOP_DEBUG,
  which specifies subjects of interest, comma separated. There is a special
  subject named All which includes all subject for debug loggin. There is also
  a simple logic opeartor '!' = NOT which can be used in combination like:

    RDESKTOP_DEBUG=All,!Graphics,!Sound

  Which would give debug log output for All subject except Graphics and Sound.
2017-01-26 14:19:40 +01:00
Karl Mikaelsson
90ea473750 Send longer drive names for redirected drives
Store the full drive name in a new disk-specific pdevice_data
struct. Bump Drive Redirection version to 02, and send the full name
as part of the Device Announcement message.
2017-01-25 13:27:01 +01:00
HenryJacques
dcfcf59f60 Fix segfault when using a relative folder name with disk redirection
Until this commit using "-r disk:floppy=my_floppy" causes a segfault.
You had to use "-r disk:floppy=./my_floppy" to use a folder in the current path.
2016-05-03 16:13:27 +02:00
Henrik Andersson
7ece007132 Fix indentation...
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1778 423420c4-83ab-492f-b58f-81f9feb106b5
2013-12-12 14:01:58 +00:00
Henrik Andersson
013ac6d541 Make sure to check agains null pointer in disk_create()
Simplified FileRenameInformation in disk_set_information()
and handle error if newname is null.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1775 423420c4-83ab-492f-b58f-81f9feb106b5
2013-12-06 13:52:29 +00:00
Henrik Andersson
fe10877ed5 Make sure we free memory allocated by rdp_in_unistr()
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1774 423420c4-83ab-492f-b58f-81f9feb106b5
2013-12-06 13:36:00 +00:00
Henrik Andersson
f0b6604347 Changed rdp_in_unistr() to make dynamic allocation of converted string
instead of using hardcoded buffer sizes and assumtion that conversion
just fits the size.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1773 423420c4-83ab-492f-b58f-81f9feb106b5
2013-12-06 12:43:08 +00:00
Henrik Andersson
d74922f597 Adding missing statfs member in dummy struct, prevents
compiler errors if its used. Patch from Samuel.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1667 423420c4-83ab-492f-b58f-81f9feb106b5
2012-07-03 11:50:56 +00:00
Henrik Andersson
4dc2ce1a6a Fixes a typo introduced in r1605.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1657 423420c4-83ab-492f-b58f-81f9feb106b5
2012-01-12 22:43:13 +00:00
Peter Åstrand
3819f8b56d Protect against malicious servers sending requests with "..". Fixes RH
bug 676252. Credits to Noam Rathaus <noamr@beyondsecurity.com> for
finding this bug.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1626 423420c4-83ab-492f-b58f-81f9feb106b5
2011-04-18 11:25:26 +00:00
Peter Åstrand
c7c0be0b98 Avoid compile warning about /* in comment.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1620 423420c4-83ab-492f-b58f-81f9feb106b5
2011-04-14 14:05:32 +00:00
Peter Åstrand
b638882347 Include emails in copyright statements.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1615 423420c4-83ab-492f-b58f-81f9feb106b5
2011-04-13 11:13:04 +00:00
Peter Åstrand
27068f53f8 Updated the copyright notices for the things we have been working on.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1612 423420c4-83ab-492f-b58f-81f9feb106b5
2011-04-13 08:55:42 +00:00
Henrik Andersson
5a8b964cc0 Applied parts of patch #2894210 to complete the
disk_query_directory() implementation to support
vailable info classes.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1609 423420c4-83ab-492f-b58f-81f9feb106b5
2011-01-03 16:17:17 +00:00
Henrik Andersson
66c9092910 Fixed indentation.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1608 423420c4-83ab-492f-b58f-81f9feb106b5
2011-01-03 13:14:50 +00:00
Henrik Andersson
6920eadf7f Applied patch to support RD_STATUS_DIRECTORY_NOT_EMPTY when
recursive deletion of directory. This fixes bug 2906541 and
patch originates from 2909831.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1606 423420c4-83ab-492f-b58f-81f9feb106b5
2010-12-27 12:11:35 +00:00
Henrik Andersson
1be5dbdf81 Applied patch from tracker patched ID: 2812158 which implements
the FileFsFullSizeInformation which solves the read-only issues
with disk redirections on Windows 7 and Windows 2008R2.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1605 423420c4-83ab-492f-b58f-81f9feb106b5
2010-12-27 07:40:26 +00:00
Peter Åstrand
281d7c9f06 Changed license to GPLv3
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1534 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-12 08:31:06 +00:00
Peter Åstrand
058ee33be3 Clean up and document the return values. Trying to solve a number of issues:
* The current return values have been selected pretty much without any
thought. Basically, the value 1 is used for all different kinds of
errors, except for a corner case where the server doesn't send a
RDP_PDU_DEACTIVATE in combination with a few special "reasons", where
the value 2 is used instead.

* rdesktop will currently also return with 2 if the user is closing
the rdesktop window, the same error as many other fatal errors, which
is somewhat strange.

* The main principle of my patch is to utilize more of the available
256 return codes. We are currently only using 3 values out of
256. This is bad; rdesktop should expose more information to the
caller about error conditions if it can.

Besides using the standardized exit codes for generic errors such as
EX_USAGE for command line usage errors, I've also exposed the
"extended disconnect reasons" from RDP. This allows for, for example,
to be able to distinguish between a logoff and a disconnect.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1510 423420c4-83ab-492f-b58f-81f9feb106b5
2009-09-02 13:03:43 +00:00
Peter Åstrand
5c67800d15 Indent fixes; ran indent-all with modern indent (F11)
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1509 423420c4-83ab-492f-b58f-81f9feb106b5
2009-08-27 08:35:48 +00:00
Jay Sorg
88855ddcbf update the copyright year
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1474 423420c4-83ab-492f-b58f-81f9feb106b5
2008-07-11 03:51:23 +00:00
Matt Chapman
3808350adb Fix from Paul Whitaker: It is not safe to assume that free space
available at the top of the tree is indicative of free space anywhere in
the tree, because you may wish to redirect a mount point hierarchy.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1434 423420c4-83ab-492f-b58f-81f9feb106b5
2008-02-16 00:15:43 +00:00
Matt Chapman
2e16fa661d Add some more warnings and sanity checks.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1425 423420c4-83ab-492f-b58f-81f9feb106b5
2008-01-05 05:43:02 +00:00
Peter Åstrand
75bd1939f8 Improve performance of (large) directory listings: Avoid
stat:ing each file many times.

The patch modifies rdesktop so that the g_notify_stamp is only set
when writing. Also, the stamp is not set before disk_create_notify(),
since this would mean that NotifyInfo would be called twice directly.

With this patch, the number of stat:s has dropped from 24 to 4, using
my tests.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1401 423420c4-83ab-492f-b58f-81f9feb106b5
2007-04-10 11:22:10 +00:00
Peter Åstrand
995f232b2b Cleanup: Using same variable name for all "struct stat" buffers, to
avoid confusion. (The variable name fstat also collides with the
function with the same name.)


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1400 423420c4-83ab-492f-b58f-81f9feb106b5
2007-04-04 12:28:57 +00:00
Jay Sorg
6091381a81 prefix BOOL with RD_
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1371 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-08 04:47:06 +00:00
Jay Sorg
797df4fa02 copyright year update
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1364 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-04 05:39:39 +00:00
Jay Sorg
b670bdacfa RD_ prefix and win32 compatibility for core files
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1363 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-04 04:55:56 +00:00
Peter Åstrand
c2d3430c02 Indent fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1241 423420c4-83ab-492f-b58f-81f9feb106b5
2006-07-05 12:07:48 +00:00
Michael Gernoth
1ea625c969 fix some warnings
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1239 423420c4-83ab-492f-b58f-81f9feb106b5
2006-07-02 13:03:22 +00:00
Jay Sorg
cadfb489ba changed to compile with g++
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1015 423420c4-83ab-492f-b58f-81f9feb106b5
2005-09-22 00:16:31 +00:00
Peter Åstrand
e82a259ad2 Using new utility function str_startswith, to get rid of many sizeof:s and hardcoded constants.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1009 423420c4-83ab-492f-b58f-81f9feb106b5
2005-08-31 13:00:57 +00:00