55 |
printf(" -s: shell\n"); |
printf(" -s: shell\n"); |
56 |
printf(" -c: working directory\n"); |
printf(" -c: working directory\n"); |
57 |
printf(" -p: password (autologon)\n"); |
printf(" -p: password (autologon)\n"); |
58 |
|
printf(" -P: askpass-program (autologon)\n"); |
59 |
printf(" -n: client hostname\n"); |
printf(" -n: client hostname\n"); |
60 |
printf(" -k: keyboard layout on terminal server (us,sv,gr etc.)\n"); |
printf(" -k: keyboard layout on terminal server (us,sv,gr etc.)\n"); |
61 |
printf(" -g: desktop geometry (WxH)\n"); |
printf(" -g: desktop geometry (WxH)\n"); |
75 |
char fullhostname[64]; |
char fullhostname[64]; |
76 |
char domain[16]; |
char domain[16]; |
77 |
char password[16]; |
char password[16]; |
78 |
|
char *askpass_result; |
79 |
char shell[32]; |
char shell[32]; |
80 |
char directory[32]; |
char directory[32]; |
81 |
char title[32]; |
char title[32]; |
92 |
domain[0] = password[0] = shell[0] = directory[0] = 0; |
domain[0] = password[0] = shell[0] = directory[0] = 0; |
93 |
strcpy(keymapname, "us"); |
strcpy(keymapname, "us"); |
94 |
|
|
95 |
while ((c = getopt(argc, argv, "u:d:s:c:p:n:k:g:t:fbemlKh?")) != -1) |
while ((c = getopt(argc, argv, "u:d:s:c:p:P:n:k:g:t:fbemlKh?")) != -1) |
96 |
{ |
{ |
97 |
switch (c) |
switch (c) |
98 |
{ |
{ |
117 |
flags |= RDP_LOGON_AUTO; |
flags |= RDP_LOGON_AUTO; |
118 |
break; |
break; |
119 |
|
|
120 |
|
case 'P': |
121 |
|
askpass_result = askpass(optarg, "Enter password"); |
122 |
|
if (askpass_result == NULL) |
123 |
|
exit(1); |
124 |
|
|
125 |
|
STRNCPY(password, askpass_result, sizeof(password)); |
126 |
|
free(askpass_result); |
127 |
|
flags |= RDP_LOGON_AUTO; |
128 |
|
break; |
129 |
|
|
130 |
case 'n': |
case 'n': |
131 |
STRNCPY(hostname, optarg, sizeof(hostname)); |
STRNCPY(hostname, optarg, sizeof(hostname)); |
132 |
break; |
break; |