--- rdesktop.c.org Sat Sep 15 21:34:32 2001 +++ rdesktop.c Sat Oct 5 02:10:09 2002 @@ -19,6 +19,7 @@ */ #include /* malloc realloc free */ +#include /* compared string */ #include /* va_list va_start va_end */ #include /* read close getuid getgid getpid getppid gethostname */ #include /* open */ @@ -30,6 +31,7 @@ char username[16]; char hostname[16]; +int userlang = 0; int width; int height; int keylayout = 0x409; @@ -45,20 +47,40 @@ static void usage(char *program) { - printf("Usage: %s [options] server\n", program); - printf(" -u: user name\n"); - printf(" -d: domain\n"); - printf(" -s: shell\n"); - printf(" -c: working directory\n"); - printf(" -p: password (autologon)\n"); - printf(" -n: client hostname\n"); - printf(" -k: keyboard layout (hex)\n"); - printf(" -g: desktop geometry (WxH)\n"); - printf(" -f: full-screen mode\n"); - printf(" -b: force bitmap updates\n"); - printf(" -e: disable encryption (French TS)\n"); - printf(" -m: do not send motion events\n"); - printf(" -l: do not request licence\n\n"); + if (userlang == 1) + { + printf("»ç¿ë¹ý: %s [¿É¼Ç] ¼­¹ö\n", program); + printf(" -u: À¯Àú À̸§\n"); + printf(" -d: µµ¸ÞÀÎ\n"); + printf(" -s: ½©\n"); + printf(" -c: ÀÛ¾÷ µð·ºÅ丮\n"); + printf(" -p: ÆÐ½º¿öµå (ÀÚµ¿ ·Î±×ÀÎ)\n"); + printf(" -n: Ŭ¶óÀÌ¾ðÆ® È£½ºÆ®³×ÀÓ\n"); + printf(" -k: Űº¸µå ·¹À̾ƿô (hex)\n"); + printf(" -g: µ¥½ºÅ©Å¾ ÇØ»óµµ (³ÐÀÌx³ôÀÌ)\n"); + printf(" -f: Àüüȭ¸é ¸ðµå\n"); + printf(" -b: ºñÆ®¸Ê ¾÷µ¥ÀÌÆ®¸¦ °­Çà\n"); + printf(" -e: ¾Ïȣȭ ¾ÈÇÔ (French TS)\n"); + printf(" -m: ¸ð¼Ç À̺¥Æ®¸¦ º¸³»Áö ¾ÊÀ½\n"); + printf(" -l: ¶óÀ̼¾½º¸¦ ¿ä±¸ÇÏÁö ¾ÊÀ½\n\n"); + } + else + { + printf("Usage: %s [options] server\n", program); + printf(" -u: user name\n"); + printf(" -d: domain\n"); + printf(" -s: shell\n"); + printf(" -c: working directory\n"); + printf(" -p: password (autologon)\n"); + printf(" -n: client hostname\n"); + printf(" -k: keyboard layout (hex)\n"); + printf(" -g: desktop geometry (WxH)\n"); + printf(" -f: full-screen mode\n"); + printf(" -b: force bitmap updates\n"); + printf(" -e: disable encryption (French TS)\n"); + printf(" -m: do not send motion events\n"); + printf(" -l: do not request licence\n\n"); + } } /* Client program */ @@ -71,14 +93,31 @@ char shell[32]; char directory[32]; char title[32]; + char *checkname; struct passwd *pw; char *server, *p; uint32 flags; int c; - printf("rdesktop: A Remote Desktop Protocol client.\n"); - printf("Version " VERSION ". Copyright (C) 1999-2001 Matt Chapman.\n"); - printf("See http://www.rdesktop.org/ for more information.\n\n"); + if (!strncmp((char *) getenv ("LANG"), "ko", 2)) + { + userlang = 1; + } + + if (userlang == 1) + { + printf("rdesktop: ¿ø°Ý µ¥½ºÅ©Å¾ ÇÁ·ÎÅäÄÝ Å¬¶óÀ̾ðÆ®.\n"); + printf("¹öÀü : " VERSION ". Copyright (C) 1999-2001 Matt Chapman.\n"); + printf("ÂüÁ¶ : http://www.rdesktop.org/ for more information.\n\n"); + printf("ÆÐŰÁö : ±èÁ¤±Õ OOPS Development Organization.\n\n"); + } + else + { + printf("rdesktop: A Remote Desktop Protocol client.\n"); + printf("Version " VERSION ". Copyright (C) 1999-2001 Matt Chapman.\n"); + printf("See http://www.rdesktop.org/ for more information.\n\n"); + printf("Packaged by JoungKyun Kim in OOPS Development Organization.\n\n"); + } flags = RDP_LOGON_NORMAL; domain[0] = password[0] = shell[0] = directory[0] = 0; @@ -116,7 +155,14 @@ keylayout = strtol(optarg, NULL, 16); if (keylayout == 0) { - error("invalid keyboard layout\n"); + if (userlang == 1) + { + error("À¯È¿ÇÏÁö ¾ÊÀº Űº¸µå ·¹À̾ƿô\n"); + } + else + { + error("invalid keyboard layout\n"); + } return 1; } break; @@ -128,7 +174,14 @@ if ((width == 0) || (height == 0)) { - error("invalid geometry\n"); + if (userlang == 1) + { + error("À¯È¿ÇÏÁö ¾ÊÀº ÇØ»óµµ\n"); + } + else + { + error("invalid geometry\n"); + } return 1; } break; @@ -171,21 +224,56 @@ if (username[0] == 0) { - pw = getpwuid(getuid()); - if ((pw == NULL) || (pw->pw_name == NULL)) + if ( (checkname = (char *) getenv ("RDESKTOPUSER")) != NULL ) { - error("could not determine username, use -u\n"); - return 1; + if ( strlen(checkname) > 15 ) + { + if (userlang == 1) + { + error("ȯ°æ º¯¼öÀÇ À¯ÀúÀ̸§ÀÌ 15ÀÚ°¡ ³Ñ½À´Ï´Ù.\n"); + } + else + { + error("Environment variable RDESKTOPUSER is limited 15 charactors.\n"); + } + return 1; + } + + STRNCPY(username, checkname, sizeof(username)); } + else + { - STRNCPY(username, pw->pw_name, sizeof(username)); + pw = getpwuid(getuid()); + if ((pw == NULL) || (pw->pw_name == NULL)) + { + if (userlang == 1) + { + error("À¯ÀúÀ̸§À» °áÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù. -u ¿É¼ÇÀ» »ç¿ëÇϽʽÿÀ.\n"); + } + else + { + error("could not determine username, use -u\n"); + } + return 1; + } + + STRNCPY(username, pw->pw_name, sizeof(username)); + } } if (hostname[0] == 0) { if (gethostname(fullhostname, sizeof(fullhostname)) == -1) { - error("could not determine local hostname, use -n\n"); + if (userlang == 1) + { + error("·ÎÄà ȣ½ºÆ®³×ÀÓÀ» °áÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù. -n ¿É¼ÇÀ» »ç¿ëÇϽʽÿÀ\n"); + } + else + { + error("could not determine local hostname, use -n\n"); + } return 1; } @@ -201,7 +289,14 @@ p = getpass("Password: "); if (p == NULL) { - error("failed to read password\n"); + if (userlang == 1) + { + error("ÆÐ½º¿öµå¸¦ Àдµ¥ ½ÇÆÐÇß½À´Ï´Ù.\n"); + } + else + { + error("failed to read password\n"); + } return 0; } STRNCPY(password, p, sizeof(password)); @@ -222,9 +317,11 @@ directory)) return 1; - printf("Connection successful.\n"); + if (userlang == 1) { printf("Á¢¼Ó ¼º°ø.\n"); } + else { printf("Connection successful.\n"); } rdp_main_loop(); - printf("Disconnecting...\n"); + if (userlang == 1) { printf("Á¢¼Ó ÇØÁ¦...\n"); } + else { printf("Disconnecting...\n"); } ui_destroy_window(); }