Merge remote-tracking branch 'origin/topic/awelzel/license-header-cleanup'

* origin/topic/awelzel/license-header-cleanup:
  Add missing copyright line to headers and cc files
  pre-commit: Add license-header check inspired by Spicy
  Add missing "COPYING" in file comments
This commit is contained in:
Tim Wojtulewicz 2024-12-09 12:22:44 -07:00
commit cb7cda9808
229 changed files with 444 additions and 64 deletions

View file

@ -2,6 +2,17 @@
# See https://pre-commit.com/hooks.html for more hooks
#
repos:
- repo: local
hooks:
- id: license
name: Check for license headers
entry: ./ci/license-header.py
language: python
types_or:
- "c"
- "c++"
exclude: '^(testing/btest/plugins/.*|testing/builtin-plugins/.*)$'
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v19.1.4'
hooks:

11
CHANGES
View file

@ -1,3 +1,14 @@
7.1.0-dev.720 | 2024-12-09 12:22:44 -0700
* Add missing copyright line to headers and cc files (Arne Welzel, Corelight)
* pre-commit: Add license-header check inspired by Spicy (Arne Welzel, Corelight)
* Add missing "COPYING" in file comments (Arne Welzel, Corelight)
This was just done via sed. There's a number of files that don't
have a license entry at all.
7.1.0-dev.716 | 2024-12-09 12:15:46 -0700
* BTest baseline updates for compile-to-C++ (Vern Paxson, Corelight)

View file

@ -1 +1 @@
7.1.0-dev.716
7.1.0-dev.720

36
ci/license-header.py Executable file
View file

@ -0,0 +1,36 @@
#!/usr/bin/env python3
import sys
import re
exit_code = 0
pat1 = re.compile(r"See the file \"COPYING\" in the main distribution directory for copyright.")
# This is the copyright line used within Spicy plugin and popular in
# Spicy analyzers.
pat2 = re.compile(r"Copyright \(c\) 2... by the Zeek Project. See COPYING for details.")
def match_line(line):
for pat in [pat1, pat2]:
m = pat.search(line)
if m is not None:
return True
return False
for f in sys.argv[1:]:
has_license_header = False
with open(f) as fp:
for line in fp:
line = line.strip()
if has_license_header := match_line(line):
break
if not has_license_header:
print(f"{f}:does not seem to contain a license header", file=sys.stderr)
exit_code = 1
sys.exit(exit_code)

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/Anon.h"
#include <sys/time.h>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// The prefix-preserving IP address anonymization code is largely
// based on (and sometimes directly copied from) Eddie Kohler's
// ipsumdump-1.20 code, per:

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/Base64.h"
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/DNS_Mapping.h"
#include <ares_nameser.h>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include <netdb.h>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Implementation of breakpoints.
#include "zeek/DbgBreakpoint.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Structures and methods for implementing breakpoints in the Zeek debugger.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Structures and methods for implementing watches in the Zeek debugger.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Zeek Debugger Help
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Implementation of watches
#include "zeek/DbgWatch.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Structures and methods for implementing watches in the Zeek debugger.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Debugging support for Zeek policy files.
#include "zeek/Debug.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Debugging support for Zeek policy files.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Support routines to help deal with Zeek debugging commands and
// implementation of most commands.

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Support routines to help deal with Zeek debugging commands and
// implementation of most commands.

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#ifdef DEBUG
#include "zeek/DebugLogger.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// A logger for (selective) debugging output. Only compiled in if DEBUG is
// defined.

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/EventHandler.h"
#include "zeek/Desc.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Capsulates local and remote event handlers.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/EventLauncher.h"
#include "event.bif.func_def"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include "zeek/Conn.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/EventRegistry.h"
#include <algorithm>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Each event raised/handled by Zeek is registered in the EventRegistry.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Classes for tracing/dumping Zeek events.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/IntSet.h"
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// A simple but fast data structure for sets of integers.
// Only supported operations are insert, remove and membership test.
//

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/List.h"
#include "zeek/3rdparty/doctest.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
// BaseList.h --

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/PacketFilter.h"
#include "zeek/IP.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Provides some very limited but fast packet filter mechanisms
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/PolicyFile.h"
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
// Functions for displaying the contents of policy files.

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/PrefixTable.h"
#include "zeek/Reporter.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
extern "C" {

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
/*
Apply various randomness tests to a stream of bytes

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/Rule.h"
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include <climits>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/RuleAction.h"
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include <sys/types.h> // for u_char

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/RuleCondition.h"
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include <sys/types.h> // for u_char

View file

@ -1,3 +1,4 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/RuleMatcher.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include <sys/types.h> // for u_char

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/ScannedFile.h"
#include <cerrno>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/ScriptCoverageManager.h"
#include <sys/stat.h>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include <list>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/ScriptValidation.h"
#include "zeek/Func.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/SerializationFormat.h"
#include <cctype>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Implements different data formats for serialization.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/Stats.h"
#include <sys/resource.h>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Classes that collect and report statistics.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/Trigger.h"
#include <algorithm>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include <list>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/WeirdState.h"
#include "zeek/RunState.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/ZeekArgs.h"
#include "zeek/Desc.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// This code contributed by Nadi Sarrar.
#include "zeek/analyzer/protocol/bittorrent/BitTorrent.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// This code contributed by Nadi Sarrar.
#pragma once

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// This code contributed by Nadi Sarrar.
#include "zeek/analyzer/protocol/bittorrent/BitTorrentTracker.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// This code contributed by Nadi Sarrar.
#pragma once

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/analyzer/protocol/dhcp/DHCP.h"
#include "zeek/analyzer/protocol/dhcp/events.bif.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include "analyzer/protocol/dhcp/dhcp_pac.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,5 @@
//
// See the file "COPYING" in the main distribution directory for copyright.
// DNP3 was initially used over serial links; it defined its own application
// layer, transport layer, and data link layer. This hierarchy cannot be
// mapped to the TCP/IP stack directly. As a result, all three DNP3 layers

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include "zeek/analyzer/protocol/tcp/TCP.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/analyzer/protocol/file/File.h"
#include <algorithm>

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Analyzer for connections that transfer binary data.
#pragma once

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// An IRC analyzer contributed by Roland Gruber.
#include "zeek/analyzer/protocol/irc/IRC.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// An IRC analyzer contributed by Roland Gruber.
#pragma once

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/analyzer/protocol/mime/MIME.h"
#include "zeek/zeek-config.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include <cassert>

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/analyzer/protocol/modbus/Modbus.h"
#include "zeek/analyzer/protocol/modbus/events.bif.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include "zeek/analyzer/protocol/tcp/TCP.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/analyzer/protocol/mqtt/MQTT.h"

View file

@ -1,3 +1,5 @@
// See the file "COPYING" in the main distribution directory for copyright.
// Generated by binpac_quickstart
#pragma once

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

View file

@ -1,4 +1,4 @@
// See the file in the main distribution directory for copyright.
// See the file "COPYING" in the main distribution directory for copyright.
#include "zeek/plugin/Plugin.h"

Some files were not shown because too many files have changed in this diff Show more