From nobody Wed Jul 13 16:50:55 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 750821CF8BDF; Wed, 13 Jul 2022 16:50:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LjkCM2FrKz3d43; Wed, 13 Jul 2022 16:50:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657731055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xCU2sEH4NOgXMOcp+Ko5tNkMuKz+D38uS6QC704Ikv8=; b=fCeMtWauITyH1OBKpOzcKoBAV3qHdzvBHyhdyO5gZJN5a+4RTELJ5MVHiD8sUY3B+574Is 7Hl1J/ox/clxxBnKGTo4a3k6Vsosi2ZgiDCnX9KmeJquGoLuGuif/xbBl6zrVia+WHnRfh sbYTCFxfnIBLCWueV/7VRia7smT1w44+F2Em0ZHOBNXZaCkoHBv9wSw771JTpYi/dHMKK8 emO9FmcpBMNyqUlmWrM4ugChPJAq6nb/Qjv+T+wYeXdACnM+x1INC6mUWg5SU3Ihd/MPtG MhBDEQzyeqF3SrsHOpMNo8iz72eyuK8lBkiQq9wF6XcBAj3dRi5jEwxGLMUcNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LjkCM1HZRzVLn; Wed, 13 Jul 2022 16:50:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26DGoti9061270; Wed, 13 Jul 2022 16:50:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26DGot5H061269; Wed, 13 Jul 2022 16:50:55 GMT (envelope-from git) Date: Wed, 13 Jul 2022 16:50:55 GMT Message-Id: <202207131650.26DGot5H061269@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Craig Leres Subject: git: 818eb4ca23d8 - main - security/zeek: Update input framework patch List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: leres X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 818eb4ca23d81c98170bdf38b9c80e97cf939c14 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657731055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xCU2sEH4NOgXMOcp+Ko5tNkMuKz+D38uS6QC704Ikv8=; b=ocw728X9zUGjweaNEryQfVJegVUVlNohTcGbO73IbNmJ88pr1gL34egyEzPPKmN/nvqxP8 cP7eC016FuGqaVMa1jQkuJzXwWdk/ilsqlkHJBPca11eAwAeyk2TRSL1dQnhNteGqNawqV EcXdP5c9X9+FnG4vVubYjdFXIAfWOlMgrp3p23QDgc3RDDfRqpTaPeJb6fKyjSbVP96ToZ 3zuwXyEQqlWPJ7knPt9f3hPraRO2oCvSQYMvjowF1S3fScy9dbvkckeaotjTQc6n3KEIxd i3TwYbufDRB0IN9ROtFNIC9fvvo3huNoueM8EHeEbNFVnQCNxzXk4YoeqUb5PQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657731055; a=rsa-sha256; cv=none; b=aYmQ+7xyD+ztnUWx9nCWWQTC7hWleY4jajEv3Y9qO8WbzjDch0ffQ5HCbtYzM3Hyq4B5af haIfGhZfJYt7/xnQVelxGsop5i+V4mtBk16waae1qVDhFx9eFlzZQK7U/bFYWmV42kTA6f jwU7//aMZ9B5Hk+p+9iwQqEgZZOnvAo19Y/fHFLR89d8HeSnsFIsf+67IWe9OypWk5dbYO dGLFVvlijtYkDIuazPlMJQYeuLqS0uoK5Npyxb5vftMzCU44abpgyc02Rv8jpObVlhHybj cff86OqjU3pcvcgY7+OAbYJL1wurzwiPm2/eFJiDfHjy8Kga+1wKX1oBwdqaWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by leres: URL: https://cgit.FreeBSD.org/ports/commit/?id=818eb4ca23d81c98170bdf38b9c80e97cf939c14 commit 818eb4ca23d81c98170bdf38b9c80e97cf939c14 Author: Craig Leres AuthorDate: 2022-07-13 16:50:29 +0000 Commit: Craig Leres CommitDate: 2022-07-13 16:50:29 +0000 security/zeek: Update input framework patch https://github.com/zeek/zeek/pull/2266 This version of the patch fixes tail -F semantics when want_record=F. --- security/zeek/Makefile | 2 +- .../zeek/files/patch-src_input_readers_raw_Raw.cc | 67 ++++++++++++++++------ 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/security/zeek/Makefile b/security/zeek/Makefile index 37b42d0770b9..7fc43d77d3c0 100644 --- a/security/zeek/Makefile +++ b/security/zeek/Makefile @@ -2,7 +2,7 @@ PORTNAME= zeek PORTVERSION= 5.0.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= https://download.zeek.org/ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} diff --git a/security/zeek/files/patch-src_input_readers_raw_Raw.cc b/security/zeek/files/patch-src_input_readers_raw_Raw.cc index 805217f4371b..7ed81f816406 100644 --- a/security/zeek/files/patch-src_input_readers_raw_Raw.cc +++ b/security/zeek/files/patch-src_input_readers_raw_Raw.cc @@ -1,5 +1,25 @@ ---- src/input/readers/raw/Raw.cc.orig 2022-07-05 21:26:56 UTC +--- src/input/readers/raw/Raw.cc.orig 2022-07-05 19:35:27 UTC +++ src/input/readers/raw/Raw.cc +@@ -2,15 +2,15 @@ + + #include "zeek/input/readers/raw/Raw.h" + +-#include + #include +-#include +-#include +-#include + #include + #include + #include + #include ++#include ++#include ++#include ++#include + + #include "zeek/input/readers/raw/Plugin.h" + #include "zeek/input/readers/raw/raw.bif.h" @@ -36,6 +36,7 @@ Raw::Raw(ReaderFrontend* frontend) firstrun = true; mtime = 0; @@ -8,18 +28,14 @@ forcekill = false; offset = 0; separator.assign((const char*)BifConst::InputRaw::record_separator->Bytes(), -@@ -280,12 +281,31 @@ bool Raw::OpenInput() - else - { +@@ -282,10 +283,27 @@ bool Raw::OpenInput() file = std::unique_ptr(fopen(fname.c_str(), "r"), fclose); -+ if ( ! file && Info().mode == MODE_STREAM ) -+ { -+ // Watch /dev/null until the file appears -+ file = std::unique_ptr(fopen("/dev/null", "r"), fclose); -+ } -+ if ( ! file ) { ++ if ( Info().mode == MODE_STREAM ) ++ // Wait for file to appear ++ return true; ++ Error(Fmt("Init: cannot open %s", fname.c_str())); return false; } @@ -40,7 +56,7 @@ if ( ! SetFDFlags(fileno(file.get()), F_SETFD, FD_CLOEXEC) ) Warning(Fmt("Init: cannot set close-on-exec for %s", fname.c_str())); } -@@ -346,6 +366,7 @@ bool Raw::DoInit(const ReaderInfo& info, int num_field +@@ -346,6 +364,7 @@ bool Raw::DoInit(const ReaderInfo& info, int num_field fname = info.source; mtime = 0; ino = 0; @@ -48,7 +64,7 @@ execute = false; firstrun = true; int want_fields = 1; -@@ -574,23 +595,57 @@ bool Raw::DoUpdate() +@@ -574,25 +593,61 @@ bool Raw::DoUpdate() mtime = sb.st_mtime; ino = sb.st_ino; @@ -70,8 +86,8 @@ if ( ! OpenInput() ) return false; -+ break; -+ + break; + + case MODE_STREAM: + // Clear possible EOF condition + if ( file ) @@ -88,7 +104,7 @@ + break; + + // Is it the same file? -+ if ( sb.st_ino == ino && sb.st_dev == dev ) ++ if ( file && sb.st_ino == ino && sb.st_dev == dev ) + break; + + // File was replaced @@ -102,14 +118,29 @@ + { + // This is unlikely to fail + Error(Fmt("Could not fstat %s", fname.c_str())); ++ fclose(tfile); + return false; + } -+ file.reset(nullptr); ++ if ( file ) ++ file.reset(nullptr); + file = std::unique_ptr(tfile, fclose); + ino = sb.st_ino; + dev = sb.st_dev; + offset = 0; + bufpos = 0; - break; - ++ break; ++ default: + assert(false); + } +@@ -604,6 +659,10 @@ bool Raw::DoUpdate() + { + if ( stdin_towrite > 0 ) + WriteToStdin(); ++ ++ if ( ! file && Info().mode == MODE_STREAM ) ++ // Wait for file to appear ++ break; + + int64_t length = GetLine(file.get()); + // printf("Read %lld bytes\n", length);