DHCP Client. */
/*
- * Copyright (c) 2004-2008 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
assert (state_is == state_shouldbe). */
#define ASSERT_STATE(state_is, state_shouldbe) {}
-static char copyright[] = "Copyright 2004-2008 Internet Systems Consortium.";
-static char arr [] = "All rights reserved.";
-static char message [] = "Internet Systems Consortium DHCP Client";
-static char url [] = "For info, please visit http://www.isc.org/sw/dhcp/";
+static const char copyright[] = "Copyright 2004-2009 Internet Systems Consortium.";
+static const char arr [] = "All rights reserved.";
+static const char message [] = "Internet Systems Consortium DHCP Client";
+static const char url [] = "For info, please visit http://www.isc.org/sw/dhcp/";
u_int16_t local_port = 0;
u_int16_t remote_port = 0;
write_client_pid_file ();
- chdir("/");
+ IGNORE_RET (chdir("/"));
}
void write_client_pid_file ()
Common parser code for dhcpd and dhclient. */
/*
- * Copyright (c) 2004-2008 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
#endif
if (log_perror) {
- write (STDERR_FILENO, mbuf, strlen (mbuf));
- write (STDERR_FILENO, "\n", 1);
- write (STDERR_FILENO, cfile -> token_line,
- strlen (cfile -> token_line));
- write (STDERR_FILENO, "\n", 1);
+ IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
+ IGNORE_RET (write (STDERR_FILENO, "\n", 1));
+ IGNORE_RET (write (STDERR_FILENO, cfile -> token_line,
+ strlen (cfile -> token_line)));
+ IGNORE_RET (write (STDERR_FILENO, "\n", 1));
if (cfile -> lexchar < 81)
- write (STDERR_FILENO, lexbuf, lix);
- write (STDERR_FILENO, "^\n", 2);
+ IGNORE_RET (write (STDERR_FILENO, lexbuf, lix));
+ IGNORE_RET (write (STDERR_FILENO, "^\n", 2));
}
cfile -> warnings_occurred = 1;
Turn data structures into printable text. */
/*
- * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
lbuf[54]=' ';
lbuf[55]=' ';
lbuf[73]='\0';
- log_info (lbuf);
+ log_info ("%s", lbuf);
}
memset(lbuf, ' ', 79);
lbuf [79] = 0;
lbuf[54]=' ';
lbuf[55]=' ';
lbuf[73]='\0';
- log_info (lbuf);
+ log_info ("%s", lbuf);
}
void hash_dump (table)
test_buffer_allocate(void) {
static const char *test_desc =
"buffer_allocate basic test";
-
+
struct buffer *buf;
- t_assert("buffer_allocate", 1, T_REQUIRED, test_desc);
+ t_assert("buffer_allocate", 1, T_REQUIRED, "%s", test_desc);
/*
* Check a 0-length buffer.
static const char *test_desc =
"buffer_reference basic test";
int result = T_PASS;
-
+
struct buffer *a, *b;
- t_assert("buffer_reference", 1, T_REQUIRED, test_desc);
+ t_assert("buffer_reference", 1, T_REQUIRED, "%s", test_desc);
/*
* Create a buffer.
test_buffer_dereference(void) {
static const char *test_desc =
"buffer_dereference basic test";
-
+
struct buffer *a, *b;
- t_assert("buffer_dereference", 1, T_REQUIRED, test_desc);
+ t_assert("buffer_dereference", 1, T_REQUIRED, "%s", test_desc);
/*
* Confirm buffer_dereference() doesn't work if we pass in NULL.
static const char *test_desc =
"data_string_forget basic test";
int result = T_PASS;
-
+
struct buffer *buf;
struct data_string a;
const char *str = "Lorem ipsum dolor sit amet turpis duis.";
- t_assert("data_string_forget", 1, T_REQUIRED, test_desc);
+ t_assert("data_string_forget", 1, T_REQUIRED, "%s", test_desc);
/*
* Create the string we want to forget.
static const char *test_desc =
"data_string_forget test, data_string without buffer";
int result = T_PASS;
-
+
struct data_string a;
const char *str = "Lorem ipsum dolor sit amet massa nunc.";
- t_assert("data_string_forget, no buffer", 1, T_REQUIRED, test_desc);
+ t_assert("data_string_forget, no buffer", 1, T_REQUIRED, "%s", test_desc);
/*
* Create the string we want to forget.
struct data_string a, b;
const char *str = "Lorem ipsum dolor sit amet orci aliquam.";
- t_assert("data_string_copy", 1, T_REQUIRED, test_desc);
+ t_assert("data_string_copy", 1, T_REQUIRED, "%s", test_desc);
/*
struct data_string a, b;
const char *str = "Lorem ipsum dolor sit amet cras amet.";
- t_assert("data_string_copy, no buffer", 1, T_REQUIRED, test_desc);
+ t_assert("data_string_copy, no buffer", 1, T_REQUIRED, "%s",
+ test_desc);
/*
fi
fi
+# POSIX doesn't include the IPv6 Advanced Socket API and glibc hides
+# parts of the IPv6 Advanced Socket API as a result. This is stupid
+# as it breaks how the two halves (Basic and Advanced) of the IPv6
+# Socket API were designed to be used but we have to live with it.
+# Use this to define _GNU_SOURCE to pull in the IPv6 Advanced Socket API.
+AC_USE_SYSTEM_EXTENSIONS
+
AC_PROG_RANLIB
AC_CONFIG_HEADERS([includes/config.h])
#ifndef LINT
-static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.6 2007/11/30 21:51:43 fdupont Exp $";
+static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.7 2009/01/22 00:43:58 sar Exp $";
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
- * Portions Copyright (c) 2007 by Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (c) 2007,2009 by Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
return (NULL);
}
/* read in the key string */
- fgets(enckey, sizeof(enckey), fp);
+ if ((fgets(enckey, sizeof(enckey), fp) == NULL) &&
+ (ferror(fp) != 0)) {
+ EREPORT(("dst_read_public_kety(): Error reading key\n"));
+ return (NULL);
+ }
/* If we aren't at end-of-file, something is wrong. */
while ((c = getc(fp)) != EOF)
/*
* Copyright (c) 1995 RadioMail Corporation. All rights reserved.
- * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
#define ANSI_DECL(x)
#define INLINE
#endif /* __GNUC__ || __STDC__ */
+
+/* The following macro handles the case of unwanted return values. In
+ * GCC one can specify an attribute for a function to generate a warning
+ * if the return value of the function is ignored and one can't dispose of
+ * the warning by the use of void. In conjunction with the use of -Werror
+ * these warnings prohibit the compilation of the package. This macro
+ * allows us to assign the return value to a variable and then ignore it.
+ */
+#if !defined(__GNUC__) || (__GNUC__ < 4) || \
+ ((__GNUC__ == 4) && (__GNUC_MINOR__ < 3))
+#define IGNORE_RET(x) (void) x
+#else
+#define IGNORE_RET(x) \
+ do { \
+ int ignore_return; \
+ ignore_return = x; \
+ } while (0)
+#endif
+
#endif /* __ISC_DHCP_CDEFS_H__ */
/* Define to include Failover Protocol support. */
#undef FAILOVER_PROTOCOL
+/* Define to 1 if you need the _GNU_SOURCE flag defined */
+#undef _GNU_SOURCE
+
/* Define to 1 if you have the /dev/random file. */
#undef HAVE_DEV_RANDOM
/*
* Copyright (c) 1995 RadioMail Corporation.
- * Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
/* Also log it to stderr? */
if (log_perror) {
- write (STDERR_FILENO, mbuf, strlen (mbuf));
- write (STDERR_FILENO, "\n", 1);
+ IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
+ IGNORE_RET (write (STDERR_FILENO, "\n", 1));
}
#if !defined (NOMINUM)
#endif
if (log_perror) {
- write (STDERR_FILENO, mbuf, strlen (mbuf));
- write (STDERR_FILENO, "\n", 1);
+ IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
+ IGNORE_RET (write (STDERR_FILENO, "\n", 1));
}
return 0;
#endif
if (log_perror) {
- write (STDERR_FILENO, mbuf, strlen (mbuf));
- write (STDERR_FILENO, "\n", 1);
+ IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
+ IGNORE_RET (write (STDERR_FILENO, "\n", 1));
}
return 0;
#endif
if (log_perror) {
- write (STDERR_FILENO, mbuf, strlen (mbuf));
- write (STDERR_FILENO, "\n", 1);
+ IGNORE_RET (write (STDERR_FILENO, mbuf, strlen (mbuf)));
+ IGNORE_RET (write (STDERR_FILENO, "\n", 1));
}
return 0;
DHCP/BOOTP Relay Agent. */
/*
- * Copyright(c) 2004-2008 by Internet Systems Consortium, Inc.("ISC")
+ * Copyright(c) 2004-2009 by Internet Systems Consortium, Inc.("ISC")
* Copyright(c) 1997-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
struct interface_info **,
struct dhcp_packet *, unsigned);
-static char copyright[] = "Copyright 2004-2008 Internet Systems Consortium.";
-static char arr[] = "All rights reserved.";
-static char message[] = "Internet Systems Consortium DHCP Relay Agent";
-static char url[] = "For info, please visit http://www.isc.org/sw/dhcp/";
+static const char copyright[] =
+"Copyright 2004-2009 Internet Systems Consortium.";
+static const char arr[] = "All rights reserved.";
+static const char message[] =
+"Internet Systems Consortium DHCP Relay Agent";
+static const char url[] =
+"For info, please visit http://www.isc.org/sw/dhcp/";
#ifdef DHCPv6
#define DHCRELAY_USAGE \
close(2);
pid = setsid();
- chdir("/");
+ IGNORE_RET (chdir("/"));
}
/* Set up the packet handler... */
DHCP Server Daemon. */
/*
- * Copyright (c) 2004-2008 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
* ``http://www.nominum.com''.
*/
-static char copyright[] =
-"Copyright 2004-2008 Internet Systems Consortium.";
-static char arr [] = "All rights reserved.";
-static char message [] = "Internet Systems Consortium DHCP Server";
-static char url [] = "For info, please visit http://www.isc.org/sw/dhcp/";
+static const char copyright[] =
+"Copyright 2004-2009 Internet Systems Consortium.";
+static const char arr [] = "All rights reserved.";
+static const char message [] = "Internet Systems Consortium DHCP Server";
+static const char url [] =
+"For info, please visit http://www.isc.org/sw/dhcp/";
#include "dhcpd.h"
#include <omapip/omapip_p.h>
/* Write new pid file. */
if ((i = open(path_dhcpd_pid, O_WRONLY|O_CREAT|O_TRUNC, 0644)) >= 0) {
sprintf(pbuf, "%d\n", (int) getpid());
- write(i, pbuf, strlen(pbuf));
+ IGNORE_RET (write(i, pbuf, strlen(pbuf)));
close(i);
} else {
log_error("Can't create PID file %s: %m.", path_dhcpd_pid);
open("/dev/null", O_RDWR);
log_perror = 0; /* No sense logging to /dev/null. */
- chdir("/");
+ IGNORE_RET (chdir("/"));
}
#endif /* !DEBUG */
/*
- * Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: t_api.c,v 1.2 2007/11/16 11:04:12 shane Exp $ */
+/* $Id: t_api.c,v 1.3 2009/01/22 00:43:58 sar Exp $ */
/*! \file */
#endif /* BIND_SUPPORT */
#include "t_api.h"
+#include "cdefs.h"
static const char *Usage =
"\t-a : run all tests\n"
*/
if (T_dir != NULL)
- (void) chdir(T_dir);
+ IGNORE_RET (chdir(T_dir));
/*
* We don't want buffered output.