Disk redirection actually uses share names; not drive letters.

Make sure we truncate share names longer than 8 chars.
Documentation updated.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@746 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2004-08-09 13:50:41 +00:00
parent 4acb0f3f31
commit 60704a5c00
5 changed files with 14 additions and 13 deletions

10
disk.c
View File

@ -149,16 +149,14 @@ disk_enum_devices(uint32 * id, char *optarg)
while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)
{
pos2 = next_arg(optarg, '=');
strcpy(g_rdpdr_device[*id].name, optarg);
toupper_str(g_rdpdr_device[*id].name);
/* add trailing colon to name. */
strcat(g_rdpdr_device[*id].name, ":");
strncpy(g_rdpdr_device[*id].name, optarg, sizeof(g_rdpdr_device[*id].name));
if (strlen(optarg) > 8)
fprintf(stderr, "share name %s truncated to %s\n", optarg,
g_rdpdr_device[*id].name);
g_rdpdr_device[*id].local_path = xmalloc(strlen(pos2) + 1);
strcpy(g_rdpdr_device[*id].local_path, pos2);
printf("DISK %s to %s\n", g_rdpdr_device[*id].name, g_rdpdr_device[*id].local_path);
g_rdpdr_device[*id].device_type = DEVICE_TYPE_DISK;
count++;
(*id)++;

View File

@ -138,9 +138,10 @@ OSes you would use stty. Bidirectional/Read support requires Windows XP or newer
In Windows 2000 it will create a port, but it's not seamless, most
shell programs will not work with it.
.TP
.BR "-r disk:<driveletter>=<path>,..."
Redirects a path to the drive letter of your choice on the server.
(requires Windows XP or newer).
.BR "-r disk:<sharename>=<path>,..."
Redirects a path to the share \\\\tsclient\\<sharename> on the server
(requires Windows XP or newer). The share name is limited to 8
characters.
.TP
.BR "-r lptport:<lptport>=<device>,..."
Redirects parallel devices on your client to the server.

View File

@ -22,8 +22,8 @@ disk mapping
-------------
Multiple mappings possible: yes
Default: no disk redirected
Syntax: -r disk:<driveletter>=<path>
Example: -r disk:H=/home/johndoe
Syntax: -r disk:<sharename>=<path>
Example: -r disk:home=/home/johndoe
printer mapping

View File

@ -129,8 +129,8 @@ usage(char *program)
" '-r comport:COM1=/dev/ttyS0': enable serial redirection of /dev/ttyS0 to COM1\n");
fprintf(stderr, " or COM1=/dev/ttyS0,COM2=/dev/ttyS1\n");
fprintf(stderr,
" '-r disk:A=/mnt/floppy': enable redirection of /mnt/floppy to A:\n");
fprintf(stderr, " or A=/mnt/floppy,D=/mnt/cdrom'\n");
" '-r disk:floppy=/mnt/floppy': enable redirection of /mnt/floppy to 'floppy' share\n");
fprintf(stderr, " or 'floppy=/mnt/floppy,cdrom=/mnt/cdrom'\n");
fprintf(stderr, " '-r clientname=<client name>': Set the client name displayed\n");
fprintf(stderr, " for redirected disks\n");
fprintf(stderr,

View File

@ -266,6 +266,8 @@ rdpdr_send_available(void)
{
out_uint32_le(s, g_rdpdr_device[i].device_type);
out_uint32_le(s, i); /* RDP Device ID */
/* Is it possible to use share names longer than 8 chars?
/astrand */
out_uint8p(s, g_rdpdr_device[i].name, 8);
switch (g_rdpdr_device[i].device_type)