32 |
char username[16]; |
char username[16]; |
33 |
char hostname[16]; |
char hostname[16]; |
34 |
char keymapname[16]; |
char keymapname[16]; |
35 |
int keylayout; |
int keylayout = 0x409; /* Defaults to US keyboard layout */ |
36 |
int width; |
int width; |
37 |
int height; |
int height; |
38 |
int tcp_port_rdp = TCP_PORT_RDP; |
int tcp_port_rdp = TCP_PORT_RDP; |
55 |
printf(" -c: working directory\n"); |
printf(" -c: working directory\n"); |
56 |
printf(" -p: password (autologon)\n"); |
printf(" -p: password (autologon)\n"); |
57 |
printf(" -n: client hostname\n"); |
printf(" -n: client hostname\n"); |
58 |
printf(" -k: keyboard layout\n"); |
printf(" -k: keyboard layout on terminal server (us,sv,gr etc.)\n"); |
59 |
printf(" -g: desktop geometry (WxH)\n"); |
printf(" -g: desktop geometry (WxH)\n"); |
60 |
printf(" -f: full-screen mode\n"); |
printf(" -f: full-screen mode\n"); |
61 |
printf(" -b: force bitmap updates\n"); |
printf(" -b: force bitmap updates\n"); |
81 |
int c; |
int c; |
82 |
|
|
83 |
printf("rdesktop: A Remote Desktop Protocol client.\n"); |
printf("rdesktop: A Remote Desktop Protocol client.\n"); |
84 |
printf("Version " VERSION ". Copyright (C) 1999-2001 Matt Chapman.\n"); |
printf("Version " VERSION |
85 |
|
". Copyright (C) 1999-2001 Matt Chapman.\n"); |
86 |
printf("See http://www.rdesktop.org/ for more information.\n\n"); |
printf("See http://www.rdesktop.org/ for more information.\n\n"); |
87 |
|
|
88 |
flags = RDP_LOGON_NORMAL; |
flags = RDP_LOGON_NORMAL; |
119 |
break; |
break; |
120 |
|
|
121 |
case 'k': |
case 'k': |
122 |
STRNCPY(keymapname, optarg, sizeof(keymapname)); |
STRNCPY(keymapname, optarg, |
123 |
|
sizeof(keymapname)); |
124 |
break; |
break; |
125 |
|
|
126 |
case 'g': |
case 'g': |
127 |
width = strtol(optarg, &p, 10); |
width = strtol(optarg, &p, 10); |
128 |
if (*p == 'x') |
if (*p == 'x') |
129 |
height = strtol(p+1, NULL, 10); |
height = strtol(p + 1, NULL, 10); |
130 |
|
|
131 |
if ((width == 0) || (height == 0)) |
if ((width == 0) || (height == 0)) |
132 |
{ |
{ |
222 |
strcpy(title, "rdesktop - "); |
strcpy(title, "rdesktop - "); |
223 |
strncat(title, server, sizeof(title) - sizeof("rdesktop - ")); |
strncat(title, server, sizeof(title) - sizeof("rdesktop - ")); |
224 |
|
|
225 |
|
xkeymap_init1(); |
226 |
|
|
227 |
if (!rdp_connect(server, flags, domain, password, shell, directory)) |
if (!rdp_connect(server, flags, domain, password, shell, directory)) |
228 |
return 1; |
return 1; |
229 |
|
|
242 |
|
|
243 |
/* Generate a 32-byte random for the secure transport code. */ |
/* Generate a 32-byte random for the secure transport code. */ |
244 |
void |
void |
245 |
generate_random(uint8 *random) |
generate_random(uint8 * random) |
246 |
{ |
{ |
247 |
struct stat st; |
struct stat st; |
248 |
struct tms tmsbuf; |
struct tms tmsbuf; |
347 |
printf("%02x ", line[i]); |
printf("%02x ", line[i]); |
348 |
|
|
349 |
for (; i < 16; i++) |
for (; i < 16; i++) |
350 |
printf(" "); |
printf(" "); |
351 |
|
|
352 |
for (i = 0; i < thisline; i++) |
for (i = 0; i < thisline; i++) |
353 |
printf("%c", |
printf("%c", |
373 |
return -1; |
return -1; |
374 |
|
|
375 |
STRNCPY(path, home, sizeof(path)); |
STRNCPY(path, home, sizeof(path)); |
376 |
strncat(path, "/.rdesktop/licence", sizeof(path)-strlen(path)-1); |
strncat(path, "/.rdesktop/licence", sizeof(path) - strlen(path) - 1); |
377 |
|
|
378 |
fd = open(path, O_RDONLY); |
fd = open(path, O_RDONLY); |
379 |
if (fd == -1) |
if (fd == -1) |
398 |
return; |
return; |
399 |
|
|
400 |
STRNCPY(path, home, sizeof(path)); |
STRNCPY(path, home, sizeof(path)); |
401 |
strncat(path, "/.rdesktop", sizeof(path)-strlen(path)-1); |
strncat(path, "/.rdesktop", sizeof(path) - strlen(path) - 1); |
402 |
mkdir(path, 0700); |
mkdir(path, 0700); |
403 |
|
|
404 |
strncat(path, "/licence", sizeof(path)-strlen(path)-1); |
strncat(path, "/licence", sizeof(path) - strlen(path) - 1); |
405 |
|
|
406 |
fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0600); |
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600); |
407 |
if (fd == -1) |
if (fd == -1) |
408 |
{ |
{ |
409 |
perror("open"); |
perror("open"); |
413 |
write(fd, data, length); |
write(fd, data, length); |
414 |
close(fd); |
close(fd); |
415 |
} |
} |
|
|
|