]> eyrie.org Git - kerberos/kstart.git/commitdiff
Add SPDX-License-Identifier to all files
authorRuss Allbery <eagle@eyrie.org>
Tue, 30 Mar 2021 18:22:53 +0000 (11:22 -0700)
committerRuss Allbery <eagle@eyrie.org>
Tue, 30 Mar 2021 18:22:53 +0000 (11:22 -0700)
Add explicit identifiers and a test to ensure that all files have
a valid SPDX license identifier.

31 files changed:
Makefile.am
bootstrap
commands/framework.c
commands/internal.h
commands/k5start.c
commands/krenew.c
configure.ac
docs/k5start.pod
docs/krenew.pod
kstart.spec
tests/TESTS
tests/data/command
tests/docs/spdx-license-t [new file with mode: 0755]
tests/k5start/afs-t
tests/k5start/basic-t
tests/k5start/daemon-t
tests/k5start/errors-t
tests/k5start/flags-t
tests/k5start/keyring-t
tests/k5start/non-renewable-t
tests/k5start/perms-t
tests/k5start/sigchld-t
tests/krenew/afs-t
tests/krenew/basic-t
tests/krenew/daemon-t
tests/krenew/errors-t
tests/krenew/keyring-t
tests/krenew/non-renewable-t
tests/libtest.pl
util/command.c
util/command.h

index 76322566ed5835252e7d2be51d0a49c939112a62..0d28d2b1673a5b39be485ef547bcec38c8d9d19c 100644 (file)
@@ -5,7 +5,7 @@
 # Copyright 2000-2011
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 ACLOCAL_AMFLAGS = -I m4
 EXTRA_DIST = .gitignore .github LICENSE bootstrap ci/README.md             \
index f9ff9266d0d59030c119b48240b9671beb25c82f..28feba87adad23dd912628d6993ab09096632b4a 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -4,10 +4,10 @@
 #
 # Written by Russ Allbery <eagle@eyrie.org>
 # Copyright 2015 Russ Allbery <eagle@eyrie.org>
-# Copyright 2005, 20072008, 2011
+# Copyright 2005, 2007-2008, 2011
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 set -e
 
index df5988ed24f6cb15eb70523480965ee925d4b04e..25b2aa90970fbba5dbac562f96daf194972bb22e 100644 (file)
@@ -24,7 +24,7 @@
  * Copyright 2006-2012, 2014
  *     The Board of Trustees of the Leland Stanford Junior University
  *
- * See LICENSE for licensing terms.
+ * SPDX-License-Identifier: MIT
  */
 
 #include <config.h>
index 221bcbe87066b358e8cd2de676c7e170330fb47a..eb08c1698175749ec755a8f6d01dc7e3a29f5a5a 100644 (file)
@@ -11,7 +11,7 @@
  * Copyright 2011-2012, 2014
  *     The Board of Trustees of the Leland Stanford Junior University
  *
- * See LICENSE for licensing terms.
+ * SPDX-License-Identifier: MIT
  */
 
 #ifndef INTERNAL_H
index 8c8d921784632546dfc7a484df8cad7060c90b90..d779076a4e2bebd774443d10912247fc5b93f414 100644 (file)
@@ -15,7 +15,7 @@
  * Copyright 1995-1997, 1999-2002, 2004-2012, 2014
  *     The Board of Trustees of the Leland Stanford Junior University
  *
- * See LICENSE for licensing terms.
+ * SPDX-License-Identifier: MIT
  */
 
 #include <config.h>
index e5f7c36c24b997fc302fe39e81b34dbad0b76266..309873d428d45529c2b30f4d446684baf7122e75 100644 (file)
@@ -12,7 +12,7 @@
  * Copyright 2006-2012, 2014
  *     The Board of Trustees of the Leland Stanford Junior University
  *
- * See LICENSE for licensing terms.
+ * SPDX-License-Identifier: MIT
  */
 
 #include <config.h>
index 49d74c974154771ea3a3a0a6ba4ac5d104d9d680..1ba88c1e491278f46466a0dd26815bf1d14f2eb9 100644 (file)
@@ -8,6 +8,8 @@ dnl
 dnl This file is free software; the authors give unlimited permission to copy
 dnl and/or distribute it, with or without modifications, as long as this
 dnl notice is preserved.
+dnl
+dnl SPDX-License-Identifier: FSFULLR
 
 AC_PREREQ([2.64])
 AC_INIT([kstart], [4.2], [eagle@eyrie.org])
index 5107d7d8321aba4dd714a426b4992622b41029bd..d286425d33fe9fa9681decc82b1a4dccf64e0d8a 100644 (file)
@@ -1,7 +1,8 @@
 =for stopwords
 -abFhLnPqstvx keytab username kinit LDAP aklog HUP ALRM KRB5CCNAME AFS PAG
 init AKLOG kstart krenew afslog Bense Allbery Navid Golpayegani
-forwardable proxiable designator Ctrl-C backoff
+forwardable proxiable designator Ctrl-C backoff FSFAP
+SPDX-License-Identifier
 
 =head1 NAME
 
@@ -466,6 +467,8 @@ permitted in any medium without royalty provided the copyright notice and
 this notice are preserved.  This file is offered as-is, without any
 warranty.
 
+SPDX-License-Identifier: FSFAP
+
 =head1 SEE ALSO
 
 kinit(1), krenew(1)
index 74ad6389dcc4771c48b2890ce720940bbbab05c7..7bb11bf24af288e324218caf5c71780734086d21 100644 (file)
@@ -1,6 +1,7 @@
 =for stopwords
 -abhiLstvx aklog AFS OpenSSH PAG HUP ALRM KRB5CCNAME AKLOG kstart afslog
-Allbery Bense designator krenew Ctrl-C SIGHUP backoff
+Allbery Bense designator krenew Ctrl-C SIGHUP backoff FSFAP
+SPDX-License-Identifier
 
 =head1 NAME
 
@@ -334,6 +335,8 @@ permitted in any medium without royalty provided the copyright notice and
 this notice are preserved.  This file is offered as-is, without any
 warranty.
 
+SPDX-License-Identifier: FSFAP
+
 =head1 SEE ALSO
 
 k5start(1), kinit(1)
index fc7e02bf97c3838b9c7ff0e7f22954bbb69abf48..f2ef3fc61253425e4aa8042d0666d9fa923240e9 100644 (file)
@@ -5,7 +5,7 @@
 # Copyright 2005-2012
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 Name: kstart
 Summary: Kerberos kinit variants supporting ticket refreshing
index 4e3aac837648490c95466e8519525b1e2d13bbdb..3ceae94de58229c0cc80e4c0207f495ce28e8da8 100644 (file)
@@ -1,5 +1,6 @@
 docs/pod
 docs/pod-spelling
+docs/spdx-license
 k5start/afs
 k5start/basic
 k5start/daemon
index d2aeca56cc0af859f7be818d381c9c4b70201c7b..425891875e0e478f14a56f2c64708c132270fc41 100755 (executable)
@@ -7,11 +7,11 @@
 # gets a TERM signal, it writes into that file and exits.
 #
 # Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2015 Russ Allbery <eagle@eyrie.org>
-# Copyright 2008, 2009, 2011, 2012
+# Copyright 2015, 2021 Russ Allbery <eagle@eyrie.org>
+# Copyright 2008-2009, 2011-2012
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Cwd;
 
diff --git a/tests/docs/spdx-license-t b/tests/docs/spdx-license-t
new file mode 100755 (executable)
index 0000000..db811a9
--- /dev/null
@@ -0,0 +1,148 @@
+#!/usr/bin/perl
+#
+# Check source files for SPDX-License-Identifier fields.
+#
+# Examine all source files in a distribution to check that they contain an
+# SPDX-License-Identifier field.  This does not check the syntax or whether
+# the identifiers are valid.
+#
+# The canonical version of this file is maintained in the rra-c-util package,
+# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
+#
+# Copyright 2018-2020 Russ Allbery <eagle@eyrie.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+# SPDX-License-Identifier: MIT
+
+use 5.010;
+use strict;
+use warnings;
+
+use lib "$ENV{C_TAP_SOURCE}/tap/perl";
+
+use Test::RRA qw(skip_unless_automated);
+use Test::RRA::Automake qw(all_files automake_setup);
+
+use File::Basename qw(basename);
+use Test::More;
+
+# File name (the file without any directory component) and path patterns to
+# skip for this check.
+## no critic (RegularExpressions::ProhibitFixedStringMatches)
+my @IGNORE = (
+    qr{ \A LICENSE \z }xms,             # Generated file with no license itself
+    qr{ \A (NEWS|THANKS|TODO) \z }xms,  # Package license should be fine
+    qr{ \A README ( [.] .* )? \z }xms,  # Package license should be fine
+    qr{ \A (Makefile|libtool) \z }xms,  # Generated file
+    qr{ [.] l?a \z }xms,                # Created by libtool
+    qr{ [.] o \z }xms,                  # Compiler objects
+    qr{ [.] output \z }xms,             # Test data
+);
+my @IGNORE_PATHS = (
+    qr{ \A debian/ }xms,                       # Found in debian/* branches
+    qr{ \A docs/metadata/ }xms,                # Package license should be fine
+    qr{ \A docs/protocol[.](html|txt) \z }xms, # Generated by xml2rfc
+    qr{ \A m4/ (libtool|lt.*) [.] m4 \z }xms,  # Files from Libtool
+    qr{ \A perl/Build \z }xms,                 # Perl build files
+    qr{ \A perl/MANIFEST \z }xms,              # Perl build files
+    qr{ \A perl/MYMETA [.] }xms,               # Perl build files
+    qr{ \A perl/blib/ }xms,                    # Perl build files
+    qr{ \A perl/cover_db/ }xms,                # Perl test files
+    qr{ \A perl/_build }xms,                   # Perl build files
+    qr{ \A php/Makefile [.] global \z }xms,    # Created by phpize
+    qr{ \A php/autom4te [.] cache/ }xms,       # Created by phpize
+    qr{ \A php/acinclude [.] m4 \z }xms,       # Created by phpize
+    qr{ \A php/build/ }xms,                    # Created by phpize
+    qr{ \A php/config [.] (guess|sub) \z }xms, # Created by phpize
+    qr{ \A php/configure [.] (ac|in) \z }xms,  # Created by phpize
+    qr{ \A php/ltmain [.] sh \z }xms,          # Created by phpize
+    qr{ \A php/run-tests [.] php \z }xms,      # Created by phpize
+    qr{ \A python/ .* [.] egg-info/ }xms,      # Python build files
+    qr{ \A tests/config/ (?!README) }xms,      # Test configuration
+    qr{ \A tests/tmp/ }xms,                    # Temporary test files
+);
+## use critic
+
+# Only run this test during automated testing, since failure doesn't indicate
+# any user-noticable flaw in the package itself.
+skip_unless_automated('SPDX identifier tests');
+
+# Set up Automake testing.
+automake_setup();
+
+# Check a single file for an occurrence of the string.
+#
+# $path - Path to the file
+#
+# Returns: undef
+sub check_file {
+    my ($path) = @_;
+    my $filename = basename($path);
+
+    # Ignore files in the whitelist and binary files.
+    for my $pattern (@IGNORE) {
+        return if $filename =~ $pattern;
+    }
+    for my $pattern (@IGNORE_PATHS) {
+        return if $path =~ $pattern;
+    }
+    return if !-T $path;
+
+    # Scan the file.
+    my ($saw_legacy_notice, $saw_spdx, $skip_spdx);
+    open(my $file, '<', $path) or BAIL_OUT("Cannot open $path: $!");
+    while (defined(my $line = <$file>)) {
+        if ($line =~ m{ Generated [ ] by [ ] libtool [ ] }xms) {
+            close($file) or BAIL_OUT("Cannot close $path: $!");
+            return;
+        }
+        if ($line =~ m{ \b See \s+ LICENSE \s+ for \s+ licensing }xms) {
+            $saw_legacy_notice = 1;
+        }
+        if ($line =~ m{ \b SPDX-License-Identifier: \s+ \S+ }xms) {
+            $saw_spdx = 1;
+            last;
+        }
+        if ($line =~ m{ no \s SPDX-License-Identifier \s registered }xms) {
+            $skip_spdx = 1;
+            last;
+        }
+    }
+    close($file) or BAIL_OUT("Cannot close $path: $!");
+
+    # If there is a legacy license notice, report a failure regardless of file
+    # size.  Otherwise, skip files under 1KB.  They can be rolled up into the
+    # overall project license and the license notice may be a substantial
+    # portion of the file size.
+    if ($saw_legacy_notice) {
+        ok(!$saw_legacy_notice, "$path has legacy license notice");
+    } else {
+        ok($saw_spdx || $skip_spdx || -s $path < 1024, $path);
+    }
+    return;
+}
+
+# Scan every file.  We don't declare a plan since we skip a lot of files and
+# don't want to precalculate the file list.
+my @paths = all_files();
+for my $path (@paths) {
+    check_file($path);
+}
+done_testing();
index 7131b42f9217bcd367be8f141199e650dacc3131..0e14e3430e0304eec95dd0c5469a5265c5ad3308 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2008-2009
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index 1aa876e4e7a9c8483c6775f009d8515064c2081b..be2100c519611a5d5873e0f02456c66786104213 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2008-2009
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index dfc38b779debe08b3b8492da6e07f315e4aaeb70..0108abfa1bc31dcbc48dfbc4f84548b5d5e64c1b 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2008-2009, 2011-2012, 2014
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Cwd;
 use File::Copy qw(copy);
index ac37a60bdfe9575967138c926b5d308013d18717..aba2e707949736769f8cac98e79d560621c8d8bb 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2011
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index bfac50ca21afc55d09c64f1b72c0333fe8e80e23..9cd298d8be9896f5c95fad81820e5bb5fcff6b15 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2008-2010
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index 3f8733956aed5c86ffc98538cb1ca4df3f68dd6f..2daf766eb7eb5c9f8154217d2a9b637829717388 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2011, 2014
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index a23092c8de27aaa6dfd554598147f03185a6e081..d5a3d774cbc14e01a4115411325a7bd24f6b06a1 100755 (executable)
@@ -10,7 +10,7 @@
 # Copyright 2012
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index dd94497355d7cc96c9b4ab20b7cabc87bcb7f0e4..c43a7662ead4a4dc1b5c60133c9e1ed333b5c996 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2011
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index 625f007e6ee2f5fd4f02b90bcd8bc932555da5d9..2ce3129148c9af76f708806086907e230a85c3f1 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2010, 2014
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use POSIX qw(SIGCHLD SIGCONT SIGSTOP SIGTERM);
 use Test::More;
index bdb8f07c3bc686fb920dc2492cd6b17a0b36bbaf..38a415460422d7b0921b49e729efa2129ae37f33 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2008-2009
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index 8543bf32799cfb5258d3f6b795032ba8dcbfe8f5..49320fe61d8f213d67e944d03eb50eabc7a6292f 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2008-2009, 2011
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use IPC::Open3 qw(open3);
 use Test::More;
index 059498a1e46a47b4ba562c36033a6a1589ab8500..dd65cb2b894848ab20041f97b736f86f1c5dd7b0 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2008-2009, 2011-2012, 2014
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Cwd;
 
index 9d100a36842aa55fe06ebd0bd805f5a1223e31c0..7adbae508e4665efcdd70ee4e45fe47fc02c5f08 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2011-2012
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index c3fb2fe6305fc98764962040e8a7c11005f6b2aa..893297f0ed10cf2b9f96070bee3c1f41b4307c0f 100755 (executable)
@@ -7,7 +7,7 @@
 # Copyright 2011, 2014
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index 7b2fb5d527771cf33c0dde74a005ed33f931e137..7ee4b8741425a80375ac3a8e7d352fa28eb39312 100755 (executable)
@@ -11,7 +11,7 @@
 # Copyright 2012
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 use Test::More;
 
index 30c2ad07321a167cc1014b187a20b2dc6b0a596b..6fb25bf2f26c203696d49335cef232001c609166 100644 (file)
@@ -9,7 +9,7 @@
 # Copyright 2007-2009
 #     The Board of Trustees of the Leland Stanford Junior University
 #
-# See LICENSE for licensing terms.
+# SPDX-License-Identifier: MIT
 
 require 5.006;
 use strict;
index ea3af3b8f1ea38563052fd2420bc5f47f126fe29..ab2753060483c96cec75ea9ee5eabd21ed36dd60 100644 (file)
@@ -4,11 +4,11 @@
  * Run a command, possibly a long-running one for which we need to wait.
  *
  * Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2004, 2005, 2007,
- *     2008, 2009
+ * Copyright 2021 Russ Allbery <eagle@eyrie.org>
+ * Copyright 1995-1997, 1999-2002, 2004-2005, 2007-2009
  *     The Board of Trustees of the Leland Stanford Junior University
  *
- * See LICENSE for licensing terms.
+ * SPDX-License-Identifier: MIT
  */
 
 #include <config.h>
index 580db6e9c8f9d868f32698b98539204c82c0c4ad..008351ea3881d52f4b25c3c91b9a4f8230c72f56 100644 (file)
@@ -2,11 +2,11 @@
  * Prototypes for shared command handling.
  *
  * Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2004, 2005, 2007,
- *     2008, 2009, 2010
+ * Copyright 2021 Russ Allbery <eagle@eyrie.org>
+ * Copyright 1995-1997, 1999-2002, 2004-2005, 2007-2010
  *     The Board of Trustees of the Leland Stanford Junior University
  *
- * See LICENSE for licensing terms.
+ * SPDX-License-Identifier: MIT
  */
 
 #ifndef UTIL_COMMAND_H