Skip to content

Commit 8a43c14

Browse files
committed
copyright: simplify policy check
Signed-off-by: László Várady <[email protected]>
1 parent bcdfe8a commit 8a43c14

File tree

6 files changed

+11
-116
lines changed

6 files changed

+11
-116
lines changed

tests/copyright/check.sh

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#############################################################################
33
# Copyright (c) 2022 One Identity LLC.
44
# Copyright (c) 2016 Balabit
5+
# Copyright (c) 2025 Axoflow
56
#
67
# This program is free software; you can redistribute it and/or modify it
78
# under the terms of the GNU General Public License version 2 as published
@@ -263,30 +264,17 @@ got_both_holder_and_license() {
263264
}
264265

265266
compare_expected_detected() {
266-
if is_balabit_copyright "$HOLDER"
267-
then
268-
local LICTEXTMATCHB="$LICTEXTMATCH"
269-
else
270-
local LICTEXTMATCHB="$LICTEXTMATCH,non-balabit"
271-
fi
267+
local LICTEXTMATCHB="$LICTEXTMATCH"
272268
if [ "$PATHMATCH" = "$LICTEXTMATCHB" ]; then
273269
if [ "0$COPYRIGHTVERBOSITY" -ge 3 ]; then
274270
echo "debug: match $FILE expected $PATHMATCH = detected $LICTEXTMATCHB" >&2
275271
fi
276272
else
277-
if
278-
is_license_compatible "$PATHMATCH" "$LICTEXTMATCHB"
279-
then
280-
if [ 0$COPYRIGHTVERBOSITY -ge 1 ]; then
281-
printf "%s\n" "warning: compatible $FILE expected:$PATHMATCH detected:$LICTEXTMATCHB" >&2
282-
fi
283-
else
284273
printf "%s" "error: mismatch $FILE" >&2
285274
if [ 0$COPYRIGHTVERBOSITY -ge 1 ]; then
286275
printf " expected:$PATHMATCH detected:$LICTEXTMATCHB" >&2
287276
fi
288277
printf "\n" >&2
289-
fi
290278
fi
291279
}
292280

@@ -373,17 +361,6 @@ t success
373361
"
374362
}
375363

376-
is_balabit_copyright() {
377-
echo "$@" |
378-
grep --quiet --extended-regexp "\
379-
^\
380-
(Copyright \(c\) ([0-9, -]+) [^ <][^<]*<br>)*\
381-
Copyright \(c\) ([0-9, -]+) (Bala[bB]it)|((One Identity)( LLC\.)?)<br>\
382-
(Copyright \(c\) ([0-9, -]+) [^ <][^<]*<br>)*\
383-
$"
384-
return $?
385-
}
386-
387364
parse_expected_licenses() {
388365
generate_known_licenses || return 1
389366

@@ -408,7 +385,7 @@ parse_expected_licenses() {
408385
local LICENSE="`
409386
echo "$LINE" |
410387
sed -rn "
411-
s~^(ignore|((GPLv2\+|LGPLv2\.1\+)(_SSL)?|4-BSD)(,non-balabit)?)$~&~
388+
s~^(ignore|((GPLv3\+(_SSL)?|4-BSD))$~&~
412389
T e
413390
p
414391
:e
@@ -444,23 +421,6 @@ parse_expected_licenses() {
444421
}
445422
}
446423

447-
is_license_compatible() {
448-
local EXPECTED="$1"
449-
local SUBMITTED="$2"
450-
451-
if [ "$EXPECTED" = "$SUBMITTED" ]; then
452-
return 0
453-
fi
454-
455-
case "$EXPECTED" in
456-
GPLv2+_SSL)
457-
[ "$SUBMITTED" = "LGPLv2.1+_SSL" ]
458-
;;
459-
*)
460-
false
461-
esac
462-
}
463-
464424
generate_known_licenses() {
465425
for FILE in "$DATADIR"/license.text.*.txt; do
466426
local NAME="`basename "$FILE"`"

tests/copyright/license.text.GPLv2+.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

tests/copyright/license.text.GPLv2+_SSL.txt renamed to tests/copyright/license.text.GPLv3+_SSL.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
This program is free software; you can redistribute it and/or modify it
2-
under the terms of the GNU General Public License version 2 as published
3-
by the Free Software Foundation, or (at your option) any later version.
1+
This program is free software: you can redistribute it and/or modify it
2+
under the terms of the GNU General Public License as published by
3+
the Free Software Foundation, either version 3 of the License, or
4+
(at your option) any later version.
45

56
This program is distributed in the hope that it will be useful,
67
but WITHOUT ANY WARRANTY; without even the implied warranty of
78
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
89
GNU General Public License for more details.
910

1011
You should have received a copy of the GNU General Public License
11-
along with this program; if not, write to the Free Software
12-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
12+
along with this program. If not, see <https://www.gnu.org/licenses/>.
1313

1414
As an additional exemption you are allowed to compile & link against the
1515
OpenSSL libraries as published by the OpenSSL project. See the file

tests/copyright/license.text.LGPLv2.1+.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/copyright/license.text.LGPLv2.1+_SSL.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/copyright/policy

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,11 @@ docker/.*$
7373
.editorconfig
7474
tests/light/functional_tests/filterx/cache_json_file\.json
7575

76+
7677
###########################################################################
77-
# These files are LGPLd and are external contributions _without_ a Balabit
78-
# related copyright statement.
78+
# These files are GPLd contributions.
7979
###########################################################################
80-
LGPLv2.1+_SSL,non-balabit
81-
80+
GPLv3+_SSL,non-balabit
8281
cmake/Modules/FindLIBBPF\.cmake
8382
lib/timeutils/zonecache.[ch]$
8483
modules/secure-logging
@@ -149,12 +148,6 @@ lib/logproto/logproto-auto-server\.[ch]
149148
lib/transport/transport-factory-haproxy\.[ch]
150149
lib/transport/tests/test_transport\.c
151150
lib/perf/.*\.[chS]
152-
153-
###########################################################################
154-
# These tests are GPLd even though they reside under lib/ and are excluded
155-
# from the LGPL declaration of lib/ below.
156-
###########################################################################
157-
GPLv2+_SSL
158151
lib/tests/test_clone_logmsg\.c
159152
lib/tests/test_dnscache\.c
160153
lib/tests/test_findcrlf\.c
@@ -166,11 +159,6 @@ lib/tests/test_ringbuffer\.c
166159
lib/tests/test_serialize\.c
167160
lib/tests/test_thread_wakeup\.c
168161
lib/tests/test_zone\.c
169-
170-
###########################################################################
171-
# These files are LGPLd, they are intended to be reusable.
172-
###########################################################################
173-
LGPLv2.1+_SSL
174162
autogen\.sh$
175163
autotools/sub-configure\.sh$
176164
configure\.ac$
@@ -191,11 +179,6 @@ modules/python-modules/syslogng/persist\.py
191179
modules/python-modules/syslogng/source\.py
192180
modules/python/python-startup.(c|h)$
193181
modules/python/python-global.(c|h)$
194-
195-
###########################################################################
196-
# These files are GPLd and non-balabit contributions.
197-
###########################################################################
198-
GPLv2+_SSL,non-balabit
199182
modules/diskq/tests/test_diskq_counters\.c
200183
modules/http/http-plugin\.[ch]
201184
modules/http/http-parser.h
@@ -337,12 +320,6 @@ modules/cef/filterx-func-parse-leef.[ch]
337320
modules/cef/tests/test-filterx-function-parse-cef.c
338321
modules/cef/tests/test-filterx-function-parse-leef.c
339322
modules/cef/tests/test_helpers.[ch]
340-
341-
###########################################################################
342-
# These files are GPLd with Balabit origin.
343-
###########################################################################
344-
GPLv2+_SSL
345-
346323
news/create-newsfile.py
347324
news/next-pr-id.py
348325
scripts/plugin-skeleton-creator/create_plugin.sh

0 commit comments

Comments
 (0)