summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2018-03-31 18:29:58 -0700
committerRuss Allbery <eagle@eyrie.org>2018-04-01 16:14:31 -0700
commit62e412902ea3c8cd5a7d2c1349c4e073903c7f74 (patch)
treea30ce1f0016d0dc3d239f34736335121152a1c27 /util
parentc28f50baa00835cb73804bd81d283e10ddf5d797 (diff)
Update to rra-c-util 7.1 and C TAP Harness 4.3
Validate command argument count, the length of command arguments, and the length of blocks of output from the server fit into the data type used in the wire protocol. Check the port argument to remctl and remctld to ensure that it is a valid port number. Update to rra-c-util 7.1: * Avoid spurious test failures from the network library. * Fix configure output when a Kerberos install prefix was provided. * Fix new warnings in GCC 7 and add new warning flags. * Fix all warnings from the Clang static analyzer. * Fix warnings under Clang with most warnings enabled. Update to C TAP Harness 4.3: * On test failures, report left/right instead of wanted/expected. * Fix string comparisons involving NULL pointers.
Diffstat (limited to 'util')
-rw-r--r--util/buffer.c14
-rw-r--r--util/buffer.h14
-rw-r--r--util/fdflag.c11
-rw-r--r--util/fdflag.h13
-rw-r--r--util/macros.h18
-rw-r--r--util/messages-krb5.c6
-rw-r--r--util/messages-krb5.h6
-rw-r--r--util/messages.c14
-rw-r--r--util/messages.h12
-rw-r--r--util/network.c22
-rw-r--r--util/network.h16
-rw-r--r--util/tokens.c12
-rw-r--r--util/vector.c18
-rw-r--r--util/vector.h18
-rw-r--r--util/xmalloc.c13
-rw-r--r--util/xmalloc.h15
-rw-r--r--util/xwrite.c13
-rw-r--r--util/xwrite.h11
18 files changed, 132 insertions, 114 deletions
diff --git a/util/buffer.c b/util/buffer.c
index a2d14c0..ee53176 100644
--- a/util/buffer.c
+++ b/util/buffer.c
@@ -13,16 +13,14 @@
* used can be set to 0 and left stores the length of the data.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2015, 2016 Russ Allbery <eagle@eyrie.org>
- * Copyright 2011, 2012, 2014
+ * Copyright 2015-2016 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2011-2012, 2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -38,6 +36,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#include <config.h>
diff --git a/util/buffer.h b/util/buffer.h
index 33cdfc6..e5d11e7 100644
--- a/util/buffer.h
+++ b/util/buffer.h
@@ -13,16 +13,14 @@
* used can be set to 0 and left stores the length of the data.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2014, 2015 Russ Allbery <eagle@eyrie.org>
- * Copyright 2011, 2012
+ * Copyright 2014-2015 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2011-2012
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -38,6 +36,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#ifndef UTIL_BUFFER_H
diff --git a/util/fdflag.c b/util/fdflag.c
index 3be61a5..42a7b0b 100644
--- a/util/fdflag.c
+++ b/util/fdflag.c
@@ -5,14 +5,13 @@
* flags like close-on-exec or nonblocking I/O.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
+ * Written by Russ Allbery <eagle@eyrie.org>
* Copyright 2008, 2011, 2013
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -28,6 +27,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#include <config.h>
diff --git a/util/fdflag.h b/util/fdflag.h
index bed45da..bbf3ce2 100644
--- a/util/fdflag.h
+++ b/util/fdflag.h
@@ -2,14 +2,13 @@
* Prototypes for setting or clearing file descriptor flags.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
- * Copyright 2008, 2010, 2011
+ * Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2008, 2010-2011
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -25,6 +24,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#ifndef UTIL_FDFLAG_H
diff --git a/util/macros.h b/util/macros.h
index 4a773a2..612a88c 100644
--- a/util/macros.h
+++ b/util/macros.h
@@ -2,17 +2,19 @@
* Some standard helpful macros.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2014 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2008-2011
+ * The Board of Trustees of the Leland Stanford Junior University
*
- * The authors hereby relinquish any claim to any copyright that they may have
- * in this work, whether granted under contract or by operation of law or
- * international treaty, and hereby commit to the public, at large, that they
- * shall not, at any time in the future, seek to enforce any copyright in this
- * work against any person or entity, or prevent any person or entity from
- * copying, publishing, distributing or creating derivative works of this
- * work.
+ * Copying and distribution of this file, with or without modification, are
+ * 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
*/
#ifndef UTIL_MACROS_H
diff --git a/util/messages-krb5.c b/util/messages-krb5.c
index 961ea1d..a33d77a 100644
--- a/util/messages-krb5.c
+++ b/util/messages-krb5.c
@@ -6,10 +6,10 @@
* formatted message.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2006, 2007, 2008, 2009, 2010, 2013
+ * Copyright 2006-2010, 2013
* The Board of Trustees of the Leland Stanford Junior University
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -29,6 +29,8 @@
* 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
*/
#include <config.h>
diff --git a/util/messages-krb5.h b/util/messages-krb5.h
index 88efbb0..da96e4c 100644
--- a/util/messages-krb5.h
+++ b/util/messages-krb5.h
@@ -2,10 +2,10 @@
* Prototypes for error handling for Kerberos.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2006, 2007, 2008, 2009, 2010, 2013
+ * Copyright 2006-2010, 2013
* The Board of Trustees of the Leland Stanford Junior University
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -25,6 +25,8 @@
* 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
*/
#ifndef UTIL_MESSAGES_KRB5_H
diff --git a/util/messages.c b/util/messages.c
index e63f7c3..941a88f 100644
--- a/util/messages.c
+++ b/util/messages.c
@@ -51,16 +51,14 @@
* va_list, and the applicable errno value (if any).
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2015, 2016 Russ Allbery <eagle@eyrie.org>
- * Copyright 2008, 2009, 2010, 2013, 2014
+ * Copyright 2015-2016 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2008-2010, 2013-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -76,6 +74,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#include <config.h>
diff --git a/util/messages.h b/util/messages.h
index a15a03e..3620273 100644
--- a/util/messages.h
+++ b/util/messages.h
@@ -2,16 +2,14 @@
* Prototypes for message and error reporting (possibly fatal).
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
* Copyright 2015 Russ Allbery <eagle@eyrie.org>
- * Copyright 2008, 2010, 2013, 2014
+ * Copyright 2008, 2010, 2013-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -27,6 +25,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#ifndef UTIL_MESSAGES_H
diff --git a/util/network.c b/util/network.c
index b3dcb30..55011ec 100644
--- a/util/network.c
+++ b/util/network.c
@@ -17,16 +17,14 @@
* of knowing that this code is correct.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2014, 2015, 2016 Russ Allbery <eagle@eyrie.org>
- * Copyright 2009, 2011, 2012, 2013, 2014
+ * Copyright 2014-2017 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2009, 2011-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006, 2007, 2008
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -42,6 +40,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#include <config.h>
@@ -812,7 +812,7 @@ fail:
* it should always be as large as the latter. Returns success or failure.
*/
bool
-network_sockaddr_sprint(char *dst, size_t size, const struct sockaddr *addr)
+network_sockaddr_sprint(char *dst, socklen_t size, const struct sockaddr *addr)
{
const char *result;
@@ -932,7 +932,7 @@ network_addr_match(const char *a, const char *b, const char *mask)
unsigned long cidr;
char *end;
unsigned int i;
- unsigned long bits, addr_mask;
+ uint32_t bits, addr_mask;
#ifdef HAVE_INET6
struct in6_addr a6, b6;
#endif
@@ -959,7 +959,7 @@ network_addr_match(const char *a, const char *b, const char *mask)
if (cidr > 32 || *end != '\0')
return false;
for (bits = 0, i = 0; i < cidr; i++)
- bits |= (1UL << (31 - i));
+ bits |= (1U << (31 - i));
addr_mask = htonl(bits);
} else if (inet_aton(mask, &tmp))
addr_mask = tmp.s_addr;
@@ -988,7 +988,7 @@ network_addr_match(const char *a, const char *b, const char *mask)
return false;
} else {
for (addr_mask = 0, bits = 0; bits < cidr % 8; bits++)
- addr_mask |= (1UL << (7 - bits));
+ addr_mask |= (1U << (7 - bits));
if ((a6.s6_addr[i] & addr_mask) != (b6.s6_addr[i] & addr_mask))
return false;
}
diff --git a/util/network.h b/util/network.h
index b981ea5..e53c030 100644
--- a/util/network.h
+++ b/util/network.h
@@ -2,16 +2,14 @@
* Prototypes for network connection utility functions.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2014, 2016 Russ Allbery <eagle@eyrie.org>
- * Copyright 2009, 2010, 2011, 2012, 2013
+ * Copyright 2014, 2016-2017 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2009-2013
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006, 2007, 2008, 2010
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2010 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -27,6 +25,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#ifndef UTIL_NETWORK_H
@@ -160,7 +160,7 @@ bool network_write(socket_type, const void *, size_t, time_t)
* Put an ASCII representation of the address in a sockaddr into the provided
* buffer, which should hold at least INET6_ADDRSTRLEN characters.
*/
-bool network_sockaddr_sprint(char *, size_t, const struct sockaddr *)
+bool network_sockaddr_sprint(char *, socklen_t, const struct sockaddr *)
__attribute__((__nonnull__));
/*
diff --git a/util/tokens.c b/util/tokens.c
index 5db0464..619931f 100644
--- a/util/tokens.c
+++ b/util/tokens.c
@@ -7,7 +7,8 @@
*
* Originally written by Anton Ushakov
* Extensive modifications by Russ Allbery <eagle@eyrie.org>
- * Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2014
+ * Copyright 2018 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2002-2010, 2012, 2014
* The Board of Trustees of the Leland Stanford Junior University
*
* See LICENSE for licensing terms.
@@ -48,8 +49,8 @@ map_socket_error(int err)
* Send a token to a file descriptor. Takes the file descriptor, the token,
* and the flags (a single byte, even though they're passed in as an integer)
* and writes them to the file descriptor. Returns TOKEN_OK on success and
- * TOKEN_FAIL_SYSTEM, TOKEN_FAIL_SOCKET, or TOKEN_FAIL_TIMEOUT on an error
- * (including partial writes).
+ * TOKEN_FAIL_SYSTEM, TOKEN_FAIL_SOCKET, TOKEN_FAIL_LARGE, or
+ * TOKEN_FAIL_TIMEOUT on an error (including partial writes).
*/
enum token_status
token_send(socket_type fd, int flags, gss_buffer_t tok, time_t timeout)
@@ -58,10 +59,10 @@ token_send(socket_type fd, int flags, gss_buffer_t tok, time_t timeout)
char *buffer;
bool okay;
unsigned char char_flags = (unsigned char) flags;
- OM_uint32 len = htonl(tok->length);
+ OM_uint32 len;
/* Send out the whole message in a single write. */
- if (tok->length > SIZE_MAX - 1 - sizeof(OM_uint32)) {
+ if (tok->length > UINT32_MAX - 1 - sizeof(OM_uint32)) {
errno = ENOMEM;
return TOKEN_FAIL_SYSTEM;
}
@@ -70,6 +71,7 @@ token_send(socket_type fd, int flags, gss_buffer_t tok, time_t timeout)
if (buffer == NULL)
return TOKEN_FAIL_SYSTEM;
memcpy(buffer, &char_flags, 1);
+ len = htonl((OM_uint32) tok->length);
memcpy(buffer + 1, &len, sizeof(OM_uint32));
memcpy(buffer + 1 + sizeof(OM_uint32), tok->value, tok->length);
okay = network_write(fd, buffer, buflen, timeout);
diff --git a/util/vector.c b/util/vector.c
index ab48539..ca45bd7 100644
--- a/util/vector.c
+++ b/util/vector.c
@@ -21,17 +21,19 @@
* sure if it's a violation of the C type aliasing rules.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2001-2006, 2016 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2005-2006, 2008-2011, 2013-2014
+ * The Board of Trustees of the Leland Stanford Junior University
*
- * The authors hereby relinquish any claim to any copyright that they may have
- * in this work, whether granted under contract or by operation of law or
- * international treaty, and hereby commit to the public, at large, that they
- * shall not, at any time in the future, seek to enforce any copyright in this
- * work against any person or entity, or prevent any person or entity from
- * copying, publishing, distributing or creating derivative works of this
- * work.
+ * Copying and distribution of this file, with or without modification, are
+ * 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
*/
#include <config.h>
diff --git a/util/vector.h b/util/vector.h
index 844b07f..dbaa3db 100644
--- a/util/vector.h
+++ b/util/vector.h
@@ -9,17 +9,19 @@
* handle data elements containing nul characters.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2001-2006 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2005-2006, 2008-2011, 2013-2014
+ * The Board of Trustees of the Leland Stanford Junior University
*
- * The authors hereby relinquish any claim to any copyright that they may have
- * in this work, whether granted under contract or by operation of law or
- * international treaty, and hereby commit to the public, at large, that they
- * shall not, at any time in the future, seek to enforce any copyright in this
- * work against any person or entity, or prevent any person or entity from
- * copying, publishing, distributing or creating derivative works of this
- * work.
+ * Copying and distribution of this file, with or without modification, are
+ * 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
*/
#ifndef UTIL_VECTOR_H
diff --git a/util/xmalloc.c b/util/xmalloc.c
index 7fb0405..f5cacc3 100644
--- a/util/xmalloc.c
+++ b/util/xmalloc.c
@@ -60,15 +60,14 @@
* line number to these functions.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
+ * Written by Russ Allbery <eagle@eyrie.org>
* Copyright 2015 Russ Allbery <eagle@eyrie.org>
- * Copyright 2012, 2013, 2014
+ * Copyright 2012-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -84,6 +83,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#include <config.h>
diff --git a/util/xmalloc.h b/util/xmalloc.h
index 6aa9b93..61f5ed1 100644
--- a/util/xmalloc.h
+++ b/util/xmalloc.h
@@ -2,14 +2,13 @@
* Prototypes for malloc routines with failure handling.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
- * Copyright 2010, 2012, 2013, 2014
+ * Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2010, 2012-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -25,6 +24,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#ifndef UTIL_XMALLOC_H
@@ -110,7 +111,7 @@ typedef void (*xmalloc_handler_type)(const char *, size_t, const char *, int);
/* The default error handler. */
void xmalloc_fail(const char *, size_t, const char *, int)
- __attribute__((__nonnull__));
+ __attribute__((__nonnull__, __noreturn__));
/*
* Assign to this variable to choose a handler other than the default, which
diff --git a/util/xwrite.c b/util/xwrite.c
index eb143cd..a7e76d2 100644
--- a/util/xwrite.c
+++ b/util/xwrite.c
@@ -22,14 +22,13 @@
* will return -1 and the number of bytes actually written will be lost.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
- * Copyright 2008, 2013, 2014
+ * Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2008, 2013-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -45,6 +44,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#include <config.h>
diff --git a/util/xwrite.h b/util/xwrite.h
index 8ca4485..8616331 100644
--- a/util/xwrite.h
+++ b/util/xwrite.h
@@ -2,14 +2,13 @@
* Prototypes for write and writev replacements to handle partial writes.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
+ * Written by Russ Allbery <eagle@eyrie.org>
* Copyright 2008, 2010, 2013
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -25,6 +24,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#ifndef UTIL_XWRITE_H