48 |
#include "ssl.h" |
#include "ssl.h" |
49 |
|
|
50 |
char g_title[64] = ""; |
char g_title[64] = ""; |
51 |
char g_username[64]; |
char *g_username; |
52 |
char g_hostname[16]; |
char g_hostname[16]; |
53 |
char g_keymapname[PATH_MAX] = ""; |
char g_keymapname[PATH_MAX] = ""; |
54 |
unsigned int g_keylayout = 0x409; /* Defaults to US keyboard layout */ |
unsigned int g_keylayout = 0x409; /* Defaults to US keyboard layout */ |
99 |
char g_redirect_server[64]; |
char g_redirect_server[64]; |
100 |
char g_redirect_domain[16]; |
char g_redirect_domain[16]; |
101 |
char g_redirect_password[64]; |
char g_redirect_password[64]; |
102 |
char g_redirect_username[64]; |
char *g_redirect_username; |
103 |
char g_redirect_cookie[128]; |
char g_redirect_cookie[128]; |
104 |
uint32 g_redirect_flags = 0; |
uint32 g_redirect_flags = 0; |
105 |
|
|
473 |
break; |
break; |
474 |
|
|
475 |
case 'u': |
case 'u': |
476 |
STRNCPY(g_username, optarg, sizeof(g_username)); |
g_username = (char *) xmalloc(strlen(optarg) + 1); |
477 |
|
STRNCPY(g_username, optarg, strlen(optarg) + 1); |
478 |
username_option = 1; |
username_option = 1; |
479 |
break; |
break; |
480 |
|
|
847 |
error("could not determine username, use -u\n"); |
error("could not determine username, use -u\n"); |
848 |
return 1; |
return 1; |
849 |
} |
} |
850 |
|
/* +1 for trailing \0 */ |
851 |
STRNCPY(g_username, pw->pw_name, sizeof(g_username)); |
int pwlen = strlen(pw->pw_name) + 1; |
852 |
|
g_username = (char *) xmalloc(pwlen); |
853 |
|
STRNCPY(g_username, pw->pw_name, pwlen); |
854 |
} |
} |
855 |
|
|
856 |
#ifdef HAVE_ICONV |
#ifdef HAVE_ICONV |
965 |
rdesktop_reset_state(); |
rdesktop_reset_state(); |
966 |
|
|
967 |
STRNCPY(domain, g_redirect_domain, sizeof(domain)); |
STRNCPY(domain, g_redirect_domain, sizeof(domain)); |
968 |
|
xfree(g_username); |
969 |
|
g_username = (char *) xmalloc(strlen(g_redirect_username) + 1); |
970 |
STRNCPY(g_username, g_redirect_username, sizeof(g_username)); |
STRNCPY(g_username, g_redirect_username, sizeof(g_username)); |
971 |
STRNCPY(password, g_redirect_password, sizeof(password)); |
STRNCPY(password, g_redirect_password, sizeof(password)); |
972 |
STRNCPY(server, g_redirect_server, sizeof(server)); |
STRNCPY(server, g_redirect_server, sizeof(server)); |
1011 |
} |
} |
1012 |
|
|
1013 |
#endif |
#endif |
1014 |
|
if (g_redirect_username) |
1015 |
|
xfree(g_redirect_username); |
1016 |
|
|
1017 |
|
xfree(g_username); |
1018 |
} |
} |
1019 |
|
|
1020 |
#ifdef EGD_SOCKET |
#ifdef EGD_SOCKET |