Several small fixes for ZNC: * Update to current 0.096, include new module * Fix build to not link modules against libstdc++ * Move root check to after module load, to remove the 30 second pause on start. * Add the possibility to directly use hashed passwords. * Make the sample config more verbose for easier adaption.
Signed-off-by: Jonas Gorski <jonas.gorski+open...@gmail.com> --- net/znc/Makefile | 13 ++++-- net/znc/files/znc.conf | 10 ++++- net/znc/files/znc.init | 11 +++++- .../patches/001-move_rootcheck_after_config.patch | 43 ++++++++++++++++++++ 4 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 net/znc/patches/001-move_rootcheck_after_config.patch diff --git a/net/znc/Makefile b/net/znc/Makefile index caa635c..d139947 100644 --- a/net/znc/Makefile +++ b/net/znc/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=znc -PKG_VERSION:=0.094 -PKG_RELEASE:=2 +PKG_VERSION:=0.096 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=...@sf/znc -PKG_MD5SUM:=db101f7a7756285d824b59e3b33e3ad5 +PKG_MD5SUM:=38eec4f1911a68b4d2fc704170e7cbf6 PKG_BUILD_PARALLEL:=1 @@ -45,11 +45,11 @@ endef CONFIGURE_VARS += \ - CXX="$(STAGING_DIR)/host/bin/g++-uc" + CXX="$(STAGING_DIR)/host/bin/g++-uc" \ CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \ CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \ - LIBS="-luClibc++ -lm -lssl $(LIBGCC_S) -lc" + LIBS="-luClibc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc" CONFIGURE_ARGS += \ --disable-c-ares \ @@ -192,6 +192,9 @@ $(eval $(call module,autovoice,Autovoices everyone who joins some channel., \ $(eval $(call module,block-motd,This module blocks the server's Message of the \ Day.,extra/)) +$(eval $(call module,clearbufferonmsg,This module keeps the buffer until the \ + next message from the client.,extra/)) + $(eval $(call module,ctcpflood,This module tries to block ctcp floods.,extra/)) $(eval $(call module,fakeonline,This module fakes the online status of \ diff --git a/net/znc/files/znc.conf b/net/znc/files/znc.conf index ea7f460..f7eceb1 100644 --- a/net/znc/files/znc.conf +++ b/net/znc/files/znc.conf @@ -1,15 +1,23 @@ config znc # where to listen for connections list listener '192.168.1.1 1234' + # load global modules (You need to install them first): + # list module 'fail2ban' config user 'sampleUser' + # Use either a plain text password or use the full sha256#... line. + # You can generate one with 'znc -s'. option password 'changeme' option nick 'sampleUser' option altnick 'userSample' option ident 'openwrt' option realname 'John Doe' + # This adds support for channels in znc configuration: # list channel '#chan optional_password' - # list of allowed servers + # list of allowed servers: list server 'chat.freenode.net 6667' + + # load user modules ('<module> [params...]'): + # list module 'simple_away -timer 10 disconnected' diff --git a/net/znc/files/znc.init b/net/znc/files/znc.init index 35aba1c..856b646 100644 --- a/net/znc/files/znc.init +++ b/net/znc/files/znc.init @@ -67,7 +67,16 @@ add_user() { config_get vhost "$user" vhost echo "<User $user>" >> $ZNC_CONFIG - echo " Pass = plain#$password" >> $ZNC_CONFIG + + case "$password" in + "md5#"* | "sha256#"* | "plain#"*) + echo " Pass = $password" >> $ZNC_CONFIG + ;; + *) + echo " Pass = plain#$password" >> $ZNC_CONFIG + ;; + esac + echo " Nick = $nick" >> $ZNC_CONFIG echo " AltNick = ${altnick:-$nick"_"}" >> $ZNC_CONFIG echo " Ident = ${ident:-$nick}" >> $ZNC_CONFIG diff --git a/net/znc/patches/001-move_rootcheck_after_config.patch b/net/znc/patches/001-move_rootcheck_after_config.patch new file mode 100644 index 0000000..6e401ac --- /dev/null +++ b/net/znc/patches/001-move_rootcheck_after_config.patch @@ -0,0 +1,43 @@ +--- znc-0.094/main.cpp.orig 2010-10-25 02:30:18.000000000 +0200 ++++ znc-0.094/main.cpp 2010-10-25 02:52:03.000000000 +0200 +@@ -194,19 +194,6 @@ + } + #endif + +- if (isRoot()) { +- CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid"); +- CUtils::PrintError("reasons for this and it can, in theory, cause great damage!"); +- if (!bAllowRoot) { +- delete pZNC; +- return 1; +- } +- CUtils::PrintError("You have been warned."); +- CUtils::PrintError("Hit CTRL+C now if you don't want to run ZNC as root."); +- CUtils::PrintError("ZNC will start in 30 seconds."); +- sleep(30); +- } +- + if (bMakeConf) { + if (!pZNC->WriteNewConfig(sConfig)) { + delete pZNC; +@@ -227,6 +214,20 @@ + return 1; + } + ++ if (isRoot()) { ++ CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid"); ++ CUtils::PrintError("reasons for this and it can, in theory, cause great damage!"); ++ if (!bAllowRoot) { ++ delete pZNC; ++ return 1; ++ } ++ CUtils::PrintError("You have been warned."); ++ CUtils::PrintError("Hit CTRL+C now if you don't want to run ZNC as root."); ++ CUtils::PrintError("ZNC will start in 30 seconds."); ++ sleep(30); ++ } ++ ++ + if (bForeground) { + int iPid = getpid(); + CUtils::PrintMessage("Staying open for debugging [pid: " + CString(iPid) + "]"); -- 1.5.6.5 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel