diff options
author | prlw1 <prlw1> | 2015-01-20 11:34:43 +0000 |
---|---|---|
committer | prlw1 <prlw1> | 2015-01-20 11:34:43 +0000 |
commit | 332420c62e38e882c04fba3248191fa2267ea91b (patch) | |
tree | 99f1c959275027f24ffb5bda9e52727245b1cc70 /www | |
parent | d7859f6a92c7e71c50279c5bc4f75af950a56eb7 (diff) | |
download | pkgsrc-332420c62e38e882c04fba3248191fa2267ea91b.tar.gz |
Make per room blocking optional
Diffstat (limited to 'www')
-rw-r--r-- | www/dansguardian/Makefile | 4 | ||||
-rw-r--r-- | www/dansguardian/distinfo | 3 | ||||
-rw-r--r-- | www/dansguardian/patches/patch-src_OptionContainer.cpp | 58 |
3 files changed, 62 insertions, 3 deletions
diff --git a/www/dansguardian/Makefile b/www/dansguardian/Makefile index 5b74f6bad29..c1c71bd3c05 100644 --- a/www/dansguardian/Makefile +++ b/www/dansguardian/Makefile @@ -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 --git a/www/dansguardian/distinfo b/www/dansguardian/distinfo index 05a8bb2928e..83a37f31c6b 100644 --- a/www/dansguardian/distinfo +++ b/www/dansguardian/distinfo @@ -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 --git a/www/dansguardian/patches/patch-src_OptionContainer.cpp b/www/dansguardian/patches/patch-src_OptionContainer.cpp new file mode 100644 index 00000000000..217f270725b --- /dev/null +++ b/www/dansguardian/patches/patch-src_OptionContainer.cpp @@ -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()); |