Index: head/net-mgmt/ettercap/files/patch-include-ec_log.h =================================================================== --- head/net-mgmt/ettercap/files/patch-include-ec_log.h (revision 381870) +++ head/net-mgmt/ettercap/files/patch-include-ec_log.h (nonexistent) @@ -1,21 +0,0 @@ -Obtained from: https://github.com/Ettercap/ettercap/commit/42600aada0ba56b9c63dabcc2b0cb1417fa27863 - ---- include/ec_log.h.orig 2014-10-17 01:29:44.000000000 +0800 -+++ include/ec_log.h 2015-02-21 19:58:20.730805519 +0800 -@@ -8,6 +8,7 @@ - - #include - #include -+#include - - - struct log_fd { -@@ -126,6 +127,8 @@ - #define LOG_TRUE 1 - #define LOG_FALSE 0 - -+EC_API_EXTERN void reset_logfile_owners(uid_t old_uid, gid_t old_gid, uid_t new_uid, gid_t new_gid); -+ - EC_API_EXTERN int log_open(struct log_fd *fd, char *filename); - EC_API_EXTERN void log_close(struct log_fd *fd); - EC_API_EXTERN void log_stop(void); Property changes on: head/net-mgmt/ettercap/files/patch-include-ec_log.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net-mgmt/ettercap/files/patch-src-ec_log.c =================================================================== --- head/net-mgmt/ettercap/files/patch-src-ec_log.c (revision 381870) +++ head/net-mgmt/ettercap/files/patch-src-ec_log.c (nonexistent) @@ -1,143 +0,0 @@ -Obtained from: https://github.com/Ettercap/ettercap/commit/42600aada0ba56b9c63dabcc2b0cb1417fa27863 - ---- src/ec_log.c.orig 2014-10-17 01:29:44.000000000 +0800 -+++ src/ec_log.c 2015-02-21 19:58:20.733803628 +0800 -@@ -37,8 +37,11 @@ - - /* globals */ - --static struct log_fd fdp; --static struct log_fd fdi; -+/* zero is formally a valid value for an opened file descriptor -+ * so we need a custom initializer -+ */ -+static struct log_fd fdp = {0, NULL, -1}; -+static struct log_fd fdi = {0, NULL, -1}; - - /* protos */ - -@@ -79,7 +82,7 @@ - /* all the host type will be unknown, warn the user */ - if (GBL_OPTIONS->read) { - USER_MSG("*********************************************************\n"); -- USER_MSG("WARNING: while reading form file we cannot determine \n"); -+ USER_MSG("WARNING: while reading form file we cannot determine \n"); - USER_MSG("if an host is local or not because the ip address of \n"); - USER_MSG("the NIC may have been changed from the time of the dump. \n"); - USER_MSG("*********************************************************\n\n"); -@@ -168,23 +171,30 @@ - - /* - * open a file in the appropriate log_fd struct -+ * -+ * whether or not the log is compressed -+ * fd->fd becomes to always be a file descriptor of the opened file -+ * and fd->cfd is a non-NULL gzip stream descriptor when the log is to be compressed -+ * -+ * TODO: it is likely that we dont need 'type' field in 'log_fd' struct -+ * to mark a compressed log; non-NULL 'cfd' field becomes such a flag - */ - int log_open(struct log_fd *fd, char *filename) - { -- int zerr; - -- if (fd->type == LOG_COMPRESSED) { -- fd->cfd = gzopen(filename, "wb9"); -- if (fd->cfd == NULL) -- SEMIFATAL_ERROR("%s", gzerror(fd->cfd, &zerr)); -- } else { -- fd->fd = open(filename, O_CREAT | O_TRUNC | O_RDWR | O_BINARY, S_IRUSR | S_IWUSR); -- if (fd->fd == -1) -- SEMIFATAL_ERROR("Can't create %s: %s", filename, strerror(errno)); -- } -- -- /* set the permissions */ -- chmod(filename, 0600); -+ fd->fd = open(filename, O_CREAT|O_TRUNC|O_RDWR|O_BINARY, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); -+ if (fd->fd == -1) -+ SEMIFATAL_ERROR("Can't create %s: %s", filename, strerror(errno)); -+ else -+ { -+ if (GBL_OPTIONS->compress) -+ { -+ int zerr; -+ fd->cfd = gzdopen(fd->fd, "wb9"); -+ if (fd->cfd == NULL) -+ SEMIFATAL_ERROR("%s", gzerror(fd->cfd, &zerr)); -+ }; -+ }; - - return E_SUCCESS; - } -@@ -195,14 +205,66 @@ - void log_close(struct log_fd *fd) - { - DEBUG_MSG("log_close: type: %d [%p][%d]", fd->type, fd->cfd, fd->fd); -- -- if (fd->type == LOG_COMPRESSED && fd->cfd) { -+ -+ if (fd->cfd) -+ { -+ /* gzclose() on the gzip stream descriptor (fd->cfd) -+ * will also close the file descriptor (fd->fd) -+ */ - gzclose(fd->cfd); - fd->cfd = NULL; -- } else if (fd->type == LOG_UNCOMPRESSED && fd->fd) { -+ fd->fd = -1; /* to prevent double closing the file descriptor */ -+ }; -+ -+ if (fd->fd >= 0) -+ { - close(fd->fd); -- fd->fd = 0; -- } -+ fd->fd = -1; -+ }; -+} -+ -+/* -+ * set the owner:group of the packet and info logfiles to new_uid:new_gid -+ * if the current owners are old_uid:old_gid respectively -+ * -+ * prefer this way to unconditionally setting the new ownership as far as -+ * the file may be intentionally located in the set-group-ID directory -+ */ -+void reset_logfile_owners(uid_t old_uid, gid_t old_gid, uid_t new_uid, gid_t new_gid) -+{ -+ struct stat f; -+ uid_t uid; -+ gid_t gid; -+ -+ /* packet logfile */ -+ if (fdp.fd >= 0) -+ { -+ DEBUG_MSG("reset_logfile_owners: packet log file"); -+ if (fstat(fdp.fd, &f) == 0) -+ { -+ uid = (f.st_uid == old_uid) ? new_uid : (uid_t)-1; -+ gid = (f.st_gid == old_gid) ? new_gid : (gid_t)-1; -+ if ( fchown(fdp.fd, uid, gid) != 0 ) -+ ERROR_MSG("fchown()"); -+ } -+ else -+ ERROR_MSG("fstat()"); -+ }; -+ -+ /* info logfile */ -+ if (fdi.fd >= 0) -+ { -+ DEBUG_MSG("reset_logfile_owners: info log file"); -+ if (fstat(fdi.fd, &f) == 0) -+ { -+ uid = (f.st_uid == old_uid) ? new_uid : (uid_t)-1; -+ gid = (f.st_gid == old_gid) ? new_gid : (gid_t)-1; -+ if ( fchown(fdi.fd, uid, gid) != 0 ) -+ ERROR_MSG("fchown()"); -+ } -+ else -+ ERROR_MSG("fstat()"); -+ }; - } - - /* Property changes on: head/net-mgmt/ettercap/files/patch-src-ec_log.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net-mgmt/ettercap/files/patch-src-dissectors-ec_ssh.c =================================================================== --- head/net-mgmt/ettercap/files/patch-src-dissectors-ec_ssh.c (revision 381870) +++ head/net-mgmt/ettercap/files/patch-src-dissectors-ec_ssh.c (nonexistent) @@ -1,46 +0,0 @@ -Obtained from: https://github.com/Ettercap/ettercap/commit/f71cd222712d6ecec6f086f3b8acca981e25f819 - ---- src/dissectors/ec_ssh.c.orig 2014-10-17 01:29:44.000000000 +0800 -+++ src/dissectors/ec_ssh.c 2015-03-03 03:43:40.843089707 +0800 -@@ -87,8 +87,8 @@ - - struct des3_state - { -- des_key_schedule k1, k2, k3; -- des_cblock iv1, iv2, iv3; -+ DES_key_schedule k1, k2, k3; -+ DES_cblock iv1, iv2, iv3; - }; - - struct blowfish_state -@@ -608,13 +608,13 @@ - if (state == NULL) /* oops, couldn't allocate memory */ - return NULL; - -- des_set_key((void *)sesskey, (state->k1)); -- des_set_key((void *)(sesskey + 8), (state->k2)); -+ DES_set_key((void *)sesskey, &(state->k1)); -+ DES_set_key((void *)(sesskey + 8), &(state->k2)); - - if (len <= 16) -- des_set_key((void *)sesskey, (state->k3)); -+ DES_set_key((void *)sesskey, &(state->k3)); - else -- des_set_key((void *)(sesskey + 16), (state->k3)); -+ DES_set_key((void *)(sesskey + 16), &(state->k3)); - - memset(state->iv1, 0, 8); - memset(state->iv2, 0, 8); -@@ -630,9 +630,9 @@ - dstate = (struct des3_state *)state; - memcpy(dstate->iv1, dstate->iv2, 8); - -- des_ncbc_encrypt(src, dst, len, (dstate->k3), &dstate->iv3, DES_DECRYPT); -- des_ncbc_encrypt(dst, dst, len, (dstate->k2), &dstate->iv2, DES_ENCRYPT); -- des_ncbc_encrypt(dst, dst, len, (dstate->k1), &dstate->iv1, DES_DECRYPT); -+ DES_ncbc_encrypt(src, dst, len, &(dstate->k3), &dstate->iv3, DES_DECRYPT); -+ DES_ncbc_encrypt(dst, dst, len, &(dstate->k2), &dstate->iv2, DES_ENCRYPT); -+ DES_ncbc_encrypt(dst, dst, len, &(dstate->k1), &dstate->iv1, DES_DECRYPT); - } - - static void swap_bytes(const u_char *src, u_char *dst, int n) Property changes on: head/net-mgmt/ettercap/files/patch-src-dissectors-ec_ssh.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net-mgmt/ettercap/files/patch-src-os-ec_bsd.c =================================================================== --- head/net-mgmt/ettercap/files/patch-src-os-ec_bsd.c (revision 381870) +++ head/net-mgmt/ettercap/files/patch-src-os-ec_bsd.c (nonexistent) @@ -1,13 +0,0 @@ -Obtained from: https://github.com/Ettercap/ettercap/commit/00f864d7dd2d82b640064db81aad065794b9b11b - ---- src/os/ec_bsd.c.orig 2014-10-17 01:29:44.000000000 +0800 -+++ src/os/ec_bsd.c 2015-02-21 19:58:20.738805431 +0800 -@@ -136,7 +136,7 @@ - - /* open the socket to work on */ - sock = socket(PF_INET, SOCK_DGRAM, 0); -- if (sock = -1) -+ if (sock == -1) - FATAL_ERROR("Unable to open socket on interface for MTU query\n"); - memset(&ifr, 0, sizeof(ifr)); - strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name)); Property changes on: head/net-mgmt/ettercap/files/patch-src-os-ec_bsd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net-mgmt/ettercap/files/patch-src-ec_utils.c =================================================================== --- head/net-mgmt/ettercap/files/patch-src-ec_utils.c (revision 381870) +++ head/net-mgmt/ettercap/files/patch-src-ec_utils.c (nonexistent) @@ -1,28 +0,0 @@ -Obtained from: https://github.com/Ettercap/ettercap/commit/42600aada0ba56b9c63dabcc2b0cb1417fa27863 - ---- src/ec_utils.c.orig 2014-10-17 01:29:44.000000000 +0800 -+++ src/ec_utils.c 2015-02-21 19:58:20.735805931 +0800 -@@ -225,17 +225,19 @@ - else - gid = GBL_CONF->ec_gid; - -- DEBUG_MSG("drop_privs: setuid(%d) setgid(%d)", uid, gid); -+ reset_logfile_owners(geteuid(), getegid(), uid, gid); -+ -+ DEBUG_MSG("drop_privs: seteuid(%d) setegid(%d)", uid, gid); - - /* drop to a good uid/gid ;) */ -- if ( setgid(gid) < 0 ) -- ERROR_MSG("setgid()"); -+ if ( setegid(gid) < 0 ) -+ ERROR_MSG("setegid()"); - - if ( seteuid(uid) < 0 ) - ERROR_MSG("seteuid()"); - - DEBUG_MSG("privs: UID: %d %d GID: %d %d", (int)getuid(), (int)geteuid(), (int)getgid(), (int)getegid() ); -- USER_MSG("Privileges dropped to UID %d GID %d...\n\n", (int)getuid(), (int)getgid() ); -+ USER_MSG("Privileges dropped to EUID %d EGID %d...\n\n", (int)geteuid(), (int)getegid() ); - } - - /* base64 stuff */ Property changes on: head/net-mgmt/ettercap/files/patch-src-ec_utils.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/net-mgmt/ettercap/Makefile =================================================================== --- head/net-mgmt/ettercap/Makefile (revision 381870) +++ head/net-mgmt/ettercap/Makefile (revision 381871) @@ -1,83 +1,82 @@ # Created by: George Reid # $FreeBSD$ PORTNAME= ettercap -PORTVERSION= 0.8.1 -PORTREVISION= 1 +PORTVERSION= 0.8.2 PORTEPOCH= 1 CATEGORIES= net-mgmt security MAINTAINER= sunpoet@FreeBSD.org COMMENT= Network sniffer/interceptor/injector/logger for switched LANs LICENSE= GPLv2 LIB_DEPENDS= libnet.so:${PORTSDIR}/net/libnet OPTIONS_DEFINE= DESKTOP DOCS GTK2 IPV6 NCURSES PCRE PLUGINS SSL UTF8 OPTIONS_DEFAULT=GTK2 NCURSES PCRE PLUGINS SSL UTF8 OPTIONS_SUB= yes DESKTOP_DESC= Install ettercap.desktop NCURSES_DESC= Ncurses interface PCRE_DESC= Use PCRE in filters SSL_DESC= SSH1 and SSL decryption support CMAKE_ARGS= -DBUNDLED_LIBS=OFF \ -DHAVE_DLOPEN=ON \ -DHAVE_PCAP=${LIBDIR} \ -DHAVE_RESOLV=${LIBDIR} \ -DHAVE_LIBNET=${LOCALBASE}/lib/libnet11 \ -DINSTALL_SYSCONFDIR=${PREFIX}/etc \ -DMAN_INSTALLDIR=${PREFIX}/man CMAKE_VERBOSE= yes LDFLAGS+= -L${LIBDIR} -L${LOCALBASE}/lib -L${LOCALBASE}/lib/libnet11 ${ICONV_LIB} -lnet -lpcap MAKE_JOBS_UNSAFE= yes USE_LDCONFIG= yes USES= bison cmake:outsource cpe iconv pkgconfig WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} DOCS= AUTHORS CHANGELOG README README.BINARIES README.BUGS \ README.GIT README.PLATFORMS THANKS TODO TODO.TESTING \ doc/capture doc/decoders doc/dissectors doc/plugins doc/threads PORTDATA= * PORTDOCS= * CPE_VENDOR= ${PORTNAME}_project GH_ACCOUNT= Ettercap GH_PROJECT= ${PORTNAME} GH_TAGNAME= v${PORTVERSION} USE_GITHUB= yes DESKTOP_CMAKE_OFF= -DINSTALL_DESKTOP=OFF DESKTOP_CMAKE_ON= -DINSTALL_DESKTOP=ON DESKTOP_USES= desktop-file-utils NCURSES_CMAKE_OFF= -DENABLE_CURSES=OFF NCURSES_CMAKE_ON= -DENABLE_CURSES=ON NCURSES_USE= NCURSES=yes GTK2_CMAKE_OFF= -DENABLE_GTK=OFF GTK2_CMAKE_ON= -DENABLE_GTK=ON GTK2_USE= GNOME=gtk20 IPV6_CMAKE_OFF= -DENABLE_IPV6=OFF IPV6_CMAKE_ON= -DENABLE_IPV6=ON PCRE_CMAKE_OFF= -DHAVE_PCRE=OFF PCRE_CMAKE_ON= -DHAVE_PCRE=ON PCRE_LIB_DEPENDS= libpcre.so:${PORTSDIR}/devel/pcre PLUGINS_BUILD_DEPENDS= curl>=7.26.0:${PORTSDIR}/ftp/curl PLUGINS_CMAKE_OFF= -DENABLE_PLUGINS=OFF PLUGINS_CMAKE_ON= -DENABLE_PLUGINS=ON PLUGINS_LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl SSL_CMAKE_OFF= -DENABLE_SSL=OFF SSL_CMAKE_ON= -DENABLE_SSL=ON SSL_USE= OPENSSL=yes UTF8_CMAKE_OFF= -DHAVE_UTF8=OFF UTF8_CMAKE_ON= -DHAVE_UTF8=ON \ -DHAVE_ICONV=${ICONV_PREFIX} UTF8_USES= iconv post-install: ${INSTALL_DATA} ${STAGEDIR}${ETCDIR}/etter.conf ${STAGEDIR}${PREFIX}/etc/etter.conf.sample ${MKDIR} ${STAGEDIR}${DOCSDIR}/ cd ${WRKSRC}/ && ${INSTALL_DATA} ${DOCS} ${STAGEDIR}${DOCSDIR}/ .include Index: head/net-mgmt/ettercap/distinfo =================================================================== --- head/net-mgmt/ettercap/distinfo (revision 381870) +++ head/net-mgmt/ettercap/distinfo (revision 381871) @@ -1,2 +1,2 @@ -SHA256 (Ettercap-ettercap-0.8.1-v0.8.1_GH0.tar.gz) = d9e39e8f76eebc7fcfd8580dc909632328cd34f336a4486f463d08a967712db2 -SIZE (Ettercap-ettercap-0.8.1-v0.8.1_GH0.tar.gz) = 7903301 +SHA256 (Ettercap-ettercap-0.8.2-v0.8.2_GH0.tar.gz) = f38514f35bea58bfe6ef1902bfd4761de0379942a9aa3e175fc9348f4eef2c81 +SIZE (Ettercap-ettercap-0.8.2-v0.8.2_GH0.tar.gz) = 8082561