Skip to content

Commit

Permalink
Add support for --without-mactelnetd to configure script
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonnessjoen committed Apr 13, 2024
1 parent 1f6f430 commit 6b5ecd7
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
9 changes: 7 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The MAC-Telnet client and server now supports the new EC-SRP authentication that

## Installation

### Without mactelnetd

If you only want the `mactelnet` client, and not the `mactelnetd` server, you can add the `--without-mactelnetd` flag to the `./configure` command before compiling.

### Docker

[`haakonn/mactelnet`](https://hub.docker.com/r/haakonn/mactelnet/) contains all four programs:
Expand Down Expand Up @@ -118,7 +122,7 @@ Install dependencies, download source tarball, extract, compile and install:
-U <user> Drop privileges to this user. Used in conjunction with -n
for security.
-q Quiet mode.
-o Force old authentication algorithm.
-o Force old MD5 authentication method.
-h This help.

Example using identity:
Expand Down Expand Up @@ -185,4 +189,5 @@ Or for use in bash-scripting:

## Huge thanks

Thanks to [@comed-ian](https://github.com/comed-ian) for creating a working proof of concept python script that successfully authenticated using the new authentication method in RouterOS 4.43+, and [@kmeaw](https://github.com/kmeaw) for porting the code to C, and implementing it in mactelnet and mactelnetd.
- Thanks to [@comed-ian](https://github.com/comed-ian) for creating a working proof of concept python script that successfully authenticated using the new authentication method in RouterOS 4.43+, and [@kmeaw](https://github.com/kmeaw) for porting the code to C, and implementing it in mactelnet and mactelnetd.
- Thanks to Omni Flux for doing [the initial reverse engineering](https://omniflux.com/devel/mikrotik/Mikrotik_MAC_Telnet_Procotol.txt) of the MAC Telnet protocol, that inspired me to write these programs, as well as the mactelnet Wireshark plugin.
8 changes: 6 additions & 2 deletions config/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
if INSTALL_CONFIG
dist_sysconf_DATA = mactelnetd.users

install-exec-hook:
chmod 600 $(DESTDIR)$(sysconfdir)/mactelnetd.users
chown root $(DESTDIR)$(sysconfdir)/mactelnetd.users
chmod 600 $(DESTDIR)$(sysconfdir)/mactelnetd.users
chown root $(DESTDIR)$(sysconfdir)/mactelnetd.users
else
dist_sysconf_DATA =
endif
11 changes: 11 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ m4_ifdef([PKG_PROG_PKG_CONFIG], [
AC_SEARCH_LIBS([EVP_MD_CTX_new], [crypto], [], [AC_MSG_FAILURE([can't find openssl >= 1.1.0 crypto lib])])
])

AC_ARG_WITH([config],
[AS_HELP_STRING([--without-config], [don't install default config file])],
[enable_config=$withval], [enable_config=yes])

AC_ARG_WITH([mactelnetd],
[AS_HELP_STRING([--without-mactelnetd], [don't install mactelnetd binary])],
[enable_mactelnetd=$withval], [enable_mactelnetd=yes])

AM_CONDITIONAL([INSTALL_CONFIG], [test x"$enable_config" != "xno" && test x"$enable_mactelnetd" != "xno"])
AM_CONDITIONAL([BUILD_MACTELNETD], [test x"$enable_mactelnetd" != "xno"])

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h libintl.h locale.h netinet/in.h paths.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utmp.h utmpx.h])

Expand Down
6 changes: 5 additions & 1 deletion doc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
dist_man_MANS = mactelnet.1 mactelnetd.1 mndp.1 macping.1
dist_man_MANS = mactelnet.1 mndp.1 macping.1

if BUILD_MACTELNETD
dist_man_MANS += mactelnetd.1
endif
3 changes: 3 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
bin_PROGRAMS = mactelnet macping mndp

if BUILD_MACTELNETD
sbin_PROGRAMS = mactelnetd
endif

mactelnet_SOURCES = config.h mactelnet.c mactelnet.h protocol.c protocol.h console.c console.h interfaces.c interfaces.h mndp.c mndp.h autologin.c autologin.h extra.h utlist.h mtwei.c mtwei.h
mactelnet_CFLAGS = -DFROM_MACTELNET
Expand Down

0 comments on commit 6b5ecd7

Please sign in to comment.