diff options
author | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2012-07-17 22:20:59 +0200 |
---|---|---|
committer | Håkon Nessjøen <haakon.nessjoen@gmail.com> | 2012-07-17 22:20:59 +0200 |
commit | 8bb7351cc1598da5ef6b799c019c75509a9a642f (patch) | |
tree | dfab6c4c87e52cf3ad4557fe132627cb0f072e6a | |
parent | 092e396b00ee4805c2a924f1b1c00cbc6e07a33c (diff) | |
download | MAC-Telnet-8bb7351cc1598da5ef6b799c019c75509a9a642f.tar.gz MAC-Telnet-8bb7351cc1598da5ef6b799c019c75509a9a642f.zip |
Updated internationalization, sped up code by using fputs instead of fprintf. Updated readme. Bumped version.
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.markdown | 27 | ||||
-rw-r--r-- | config.h | 2 | ||||
-rw-r--r-- | mactelnet.c | 2 | ||||
-rw-r--r-- | po/mactelnet.pot | 86 |
5 files changed, 77 insertions, 42 deletions
@@ -9,7 +9,7 @@ clean: distclean distclean: rm -f mactelnet macping mactelnetd mndp - rm po/*.pot + rm -f po/*.pot rm -f *.o dist: distclean po diff --git a/README.markdown b/README.markdown index e1bd784..45d4cd8 100644 --- a/README.markdown +++ b/README.markdown @@ -1,8 +1,7 @@ MAC-Telnet for Linux ==================== -A linux console tool for connecting to MikroTik RouterOS devices via their -ethernet address. +Console tools for connecting to, and serving, devices using MikroTik RouterOS MAC-Telnet protocol. Installation ------------ @@ -22,17 +21,23 @@ Usage ----- # mactelnet -h - Usage: mactelnet <MAC|identity> [-h] [-n] [-t <timeout>] [-u <username>] [-p <password>] + Usage: mactelnet <MAC|identity> [-h] [-n] [-t <timeout>] [-u <user>] [-p <password>] [-U <user>] | -l Parameters: - MAC MAC-Address of the RouterOS device. Use mndp to discover them. - identity The identity/name of your RouterOS device. Uses MNDP protocol to find it.. - -n Do not use broadcast packets. Less insecure but requires root privileges. - -t Amount of seconds to wait for a response on each interface. - -u Specify username on command line. - -p Specify password on command line. - -h This help. - + MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to + discover it. + identity The identity/name of your destination device. Uses + MNDP protocol to find it. + -l List/Search for routers nearby. (using MNDP) + -n Do not use broadcast packets. Less insecure but requires + root privileges. + -t <timeout> Amount of seconds to wait for a response on each interface. + -u <user> Specify username on command line. + -p <password> Specify password on command line. + -U <user> Drop privileges to this user. Used in conjunction with -n + for security. + -q Quiet mode. + -h This help. Example: @@ -21,7 +21,7 @@ #define DEBUG 0 -#define PROGRAM_VERSION "0.3.3" +#define PROGRAM_VERSION "0.3.4" #if defined(__APPLE__) && defined(__MACH__) #define PLATFORM_NAME "Mac OS X" diff --git a/mactelnet.c b/mactelnet.c index 0620b8d..19624ea 100644 --- a/mactelnet.c +++ b/mactelnet.c @@ -289,7 +289,7 @@ static int handle_packet(unsigned char *data, int data_len) { the data is raw terminal data to be outputted to the terminal. */ else if (cpkt.cptype == MT_CPTYPE_PLAINDATA) { cpkt.data[cpkt.length] = 0; - printf("%s", cpkt.data); + fputs((const char *)cpkt.data, stdout); } /* END_AUTH means that the user/password negotiation is done, and after this point diff --git a/po/mactelnet.pot b/po/mactelnet.pot index 841d607..22a579c 100644 --- a/po/mactelnet.pot +++ b/po/mactelnet.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mactelnet\n" "Report-Msgid-Bugs-To: haakon.nessjoen@gmail.com\n" -"POT-Creation-Date: 2012-05-20 17:16+0200\n" +"POT-Creation-Date: 2012-07-17 21:29+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -92,85 +92,115 @@ msgstr "" msgid "%s Reply of %d bytes of unequal data\n" msgstr "" -#: mactelnet.c:155 +#: mactelnet.c:100 +#, c-format +msgid "" +"Failed dropping privileges. The user %s is not a valid username on local " +"system.\n" +msgstr "" + +#: mactelnet.c:106 +#, c-format +msgid "setgid: Error dropping group privileges\n" +msgstr "" + +#: mactelnet.c:110 +#, c-format +msgid "setuid: Error dropping user privileges\n" +msgstr "" + +#: mactelnet.c:115 +#, c-format +msgid "Failed to drop privileges\n" +msgstr "" + +#: mactelnet.c:181 #, c-format msgid "" "\n" "Connection timed out\n" msgstr "" -#: mactelnet.c:304 +#: mactelnet.c:330 #, c-format msgid "Connection closed.\n" msgstr "" -#: mactelnet.c:310 +#: mactelnet.c:336 #, c-format msgid "Unhandeled packet type: %d received from server %s\n" msgstr "" -#: mactelnet.c:332 +#: mactelnet.c:358 #, c-format msgid "Error: No suitable devices found\n" msgstr "" -#: mactelnet.c:464 +#: mactelnet.c:498 #, c-format msgid "" -"Usage: %s <MAC|identity> [-h] [-n] [-t <timeout>] [-u <username>] [-p " -"<password>] | -l\n" +"Usage: %s <MAC|identity> [-h] [-n] [-t <timeout>] [-u <user>] [-p " +"<password>] [-U <user>] | -l\n" msgstr "" -#: mactelnet.c:467 +#: mactelnet.c:501 #, c-format msgid "" "\n" "Parameters:\n" -" MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to " -"discover it.\n" -" identity The identity/name of your destination device. Uses MNDP protocol " -"to find it.\n" -" -l List/Search for routers nearby. (using MNDP)\n" -" -n Do not use broadcast packets. Less insecure but requires root " -"privileges.\n" -" -t Amount of seconds to wait for a response on each interface.\n" -" -u Specify username on command line.\n" -" -p Specify password on command line.\n" -" -q Quiet mode.\n" -" -h This help.\n" +" MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to\n" +" discover it.\n" +" identity The identity/name of your destination device. Uses\n" +" MNDP protocol to find it.\n" +" -l List/Search for routers nearby. (using MNDP)\n" +" -n Do not use broadcast packets. Less insecure but requires\n" +" root privileges.\n" +" -t <timeout> Amount of seconds to wait for a response on each " +"interface.\n" +" -u <user> Specify username on command line.\n" +" -p <password> Specify password on command line.\n" +" -U <user> Drop privileges to this user. Used in conjunction with -n\n" +" for security.\n" +" -q Quiet mode.\n" +" -h This help.\n" "\n" msgstr "" -#: mactelnet.c:492 +#: mactelnet.c:531 #, c-format msgid "You need to have root privileges to use the -n parameter.\n" msgstr "" -#: mactelnet.c:524 +#: mactelnet.c:541 +#, c-format +msgid "The -U option must be used in conjunction with the -n parameter.\n" +msgstr "" + +#: mactelnet.c:570 #, c-format msgid "Login: " msgstr "" -#: mactelnet.c:531 +#: mactelnet.c:577 msgid "Password: " msgstr "" -#: mactelnet.c:556 +#: mactelnet.c:602 #, c-format msgid "Connecting to %s..." msgstr "" -#: mactelnet.c:566 mactelnetd.c:244 mactelnetd.c:981 +#: mactelnet.c:612 mactelnetd.c:244 mactelnetd.c:981 #, c-format msgid "Error binding to %s:%d, %s\n" msgstr "" -#: mactelnet.c:571 +#: mactelnet.c:617 #, c-format msgid "Connection failed.\n" msgstr "" -#: mactelnet.c:575 +#: mactelnet.c:621 #, c-format msgid "done\n" msgstr "" |