pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/dansguardian Make per room blocking optional



details:   https://anonhg.NetBSD.org/pkgsrc/rev/506b4a3adb08
branches:  trunk
changeset: 644981:506b4a3adb08
user:      prlw1 <prlw1%pkgsrc.org@localhost>
date:      Tue Jan 20 11:34:43 2015 +0000

description:
Make per room blocking optional

diffstat:

 www/dansguardian/Makefile                              |   4 +-
 www/dansguardian/distinfo                              |   3 +-
 www/dansguardian/patches/patch-src_OptionContainer.cpp |  58 ++++++++++++++++++
 3 files changed, 62 insertions(+), 3 deletions(-)

diffs (90 lines):

diff -r e2d6412c8dbe -r 506b4a3adb08 www/dansguardian/Makefile
--- a/www/dansguardian/Makefile Tue Jan 20 11:34:34 2015 +0000
+++ b/www/dansguardian/Makefile Tue Jan 20 11:34:43 2015 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.20 2014/10/14 14:41:17 prlw1 Exp $
+# $NetBSD: Makefile,v 1.21 2015/01/20 11:34:43 prlw1 Exp $
 
 DISTNAME=      dansguardian-2.12.0.3
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    www
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=dansguardian/}
 EXTRACT_SUFX=  .tar.bz2
diff -r e2d6412c8dbe -r 506b4a3adb08 www/dansguardian/distinfo
--- a/www/dansguardian/distinfo Tue Jan 20 11:34:34 2015 +0000
+++ b/www/dansguardian/distinfo Tue Jan 20 11:34:43 2015 +0000
@@ -1,9 +1,10 @@
-$NetBSD: distinfo,v 1.8 2014/03/28 14:13:25 prlw1 Exp $
+$NetBSD: distinfo,v 1.9 2015/01/20 11:34:43 prlw1 Exp $
 
 SHA1 (dansguardian-2.12.0.3.tar.bz2) = c5d8175910310f9a03efc2e6cb440ea418adb896
 RMD160 (dansguardian-2.12.0.3.tar.bz2) = 312db0ce2db9d1b2ed537807f9b2eca5d76a4123
 Size (dansguardian-2.12.0.3.tar.bz2) = 577701 bytes
 SHA1 (patch-configure) = be2ccff5ecd42994cf8727843372e5997004e5e4
 SHA1 (patch-src_ImageContainer.cpp) = b1296ac496a699d2089255b61841f607eba9d084
+SHA1 (patch-src_OptionContainer.cpp) = d94a851522751b53c61a2b96e335170db0e1f86e
 SHA1 (patch-src_SocketArray.cpp) = 393bb901cf090b543a16da27f16c1bc99db8f155
 SHA1 (patch-src_UDSocket.cpp) = d022e2b44023dbac0d0f46bae4adf003efa000a1
diff -r e2d6412c8dbe -r 506b4a3adb08 www/dansguardian/patches/patch-src_OptionContainer.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/dansguardian/patches/patch-src_OptionContainer.cpp    Tue Jan 20 11:34:43 2015 +0000
@@ -0,0 +1,58 @@
+$NetBSD: patch-src_OptionContainer.cpp,v 1.1 2015/01/20 11:34:43 prlw1 Exp $
+
+Make per room blocking optional
+
+--- src/OptionContainer.cpp.orig       2012-09-29 20:06:45.000000000 +0000
++++ src/OptionContainer.cpp
+@@ -789,10 +789,19 @@ bool OptionContainer::inRoom(const std::
+ 
+ void OptionContainer::loadRooms()
+ {
++      if (per_room_blocking_directory_location == "")
++              return;
++ 
+       DIR* d = opendir(per_room_blocking_directory_location.c_str());
+       if (d == NULL)
+       {
+-              syslog(LOG_ERR, "Could not open room definitions directory: %s", strerror(errno));
++              if (!is_daemonised) {
++                      std::cerr << "Could not open room definitions directory \""
++                                << per_room_blocking_directory_location << '"'
++                                << std::endl;
++              }
++              syslog(LOG_ERR, "Could not open room definitions directory \"%s\": %s",
++                     per_room_blocking_directory_location.c_str(), strerror(errno));
+               exit(1);
+       }
+ 
+@@ -804,11 +813,29 @@ void OptionContainer::loadRooms()
+               std::string filename(per_room_blocking_directory_location);
+               filename.append(f->d_name);
+               std::ifstream infile(filename.c_str());
++              if (!infile.good()) {
++                      if (!is_daemonised) {
++                              std::cerr << "Could not open room definitions file \""
++                                        << filename << '"' << std::endl;
++                      }
++                      syslog(LOG_ERR, "Could not open room definitions file \"%s\"",
++                             filename.c_str());
++                      exit(1);
++              }
+ 
+               std::string roomname;
+               std::getline(infile, roomname);
+               infile.close();
+-              roomname = roomname.substr(1);
++              if (roomname.size() <= 2) {
++                      if (!is_daemonised) {
++                              std::cerr << "Could not read room from definitions file \""
++                                        << filename << '"' << std::endl;
++                      }
++                      syslog(LOG_ERR, "Could not read room from definitions file \"%s\"",
++                             filename.c_str());
++                      exit(1);
++              }
++              roomname = roomname.substr(1); // remove leading '#'
+ 
+               IPList* contents = new IPList();
+               contents->readIPMelangeList(filename.c_str());



Home | Main Index | Thread Index | Old Index