]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Unmerged #38692
authorFrancis Dupont <fdupont@isc.org>
Tue, 17 Nov 2015 15:36:19 +0000 (16:36 +0100)
committerFrancis Dupont <fdupont@isc.org>
Tue, 17 Nov 2015 15:36:19 +0000 (16:36 +0100)
client/dhclient.c
dhcpctl/omshell.c
includes/omapip/omapip_p.h
includes/site.h
relay/dhcrelay.c
server/dhcpd.c

index 3a0c0611367ef60bb2da37bdf0b3ea8a5f5aea18..be2af6ad657bd517ec0466545b0f0a34503f3cfb 100644 (file)
@@ -37,7 +37,6 @@
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <limits.h>
-#include <isc/file.h>
 #include <dns/result.h>
 
 TIME default_lease_time = 43200; /* 12 hours... */
@@ -90,8 +89,6 @@ int wanted_ia_ta = 0;
 int wanted_ia_pd = 0;
 char *mockup_relay = NULL;
 
-char *progname = NULL;
-
 void run_stateless(int exit_mode);
 
 static void usage(void);
@@ -132,12 +129,6 @@ main(int argc, char **argv) {
 #endif /* DHCPv6 */
        char *s;
 
-#ifdef OLD_LOG_NAME
-       progname = "dhclient";
-#else
-       progname = argv[0];
-#endif
-
        /* Initialize client globals. */
        memset(&default_duid, 0, sizeof(default_duid));
 
@@ -154,7 +145,7 @@ main(int argc, char **argv) {
        else if (fd != -1)
                close(fd);
 
-       openlog(isc_file_basename(progname), DHCP_LOG_OPTIONS, LOG_DAEMON);
+       openlog("dhclient", DHCP_LOG_OPTIONS, LOG_DAEMON);
 
 #if !(defined(DEBUG) || defined(__CYGWIN32__))
        setlogmask(LOG_UPTO(LOG_INFO));
@@ -759,7 +750,7 @@ static void usage()
        log_info(url);
 
 
-       log_fatal("Usage: %s "
+       log_fatal("Usage: dhclient "
 #ifdef DHCPv6
                  "[-4|-6] [-SNTPI1dvrxi] [-nw] [-p <port>] [-D LL|LLT] \n"
 #else /* DHCPv6 */
@@ -768,8 +759,7 @@ static void usage()
                  "                [-s server-addr] [-cf config-file]\n"
                  "                [-df duid-file] [-lf lease-file]\n"
                  "                [-pf pid-file] [--no-pid] [-e VAR=val]\n"
-                 "                [-sf script-file] [interface]",
-                 isc_file_basename(progname));
+                 "                [-sf script-file] [interface]");
 }
 
 void run_stateless(int exit_mode)
index adf4b9aee583b9661573e3f8720b700a6d3455e9..44fd2726d6c07cb93fe72c907d8c00c29756ab4d 100644 (file)
@@ -3,7 +3,7 @@
    Examine and modify omapi objects. */
 
 /*
- * Copyright (c) 2009-2011,2013-2015 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009-2011,2013,2014 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 2004-2007 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 2001-2003 by Internet Software Consortium
  *
@@ -39,7 +39,6 @@
 #include <syslog.h>
 #include "dhcpctl.h"
 #include "dhcpd.h"
-#include <isc/file.h>
 
 /* Fixups */
 isc_result_t find_class (struct class **c, const char *n, const char *f, int l)
@@ -64,7 +63,7 @@ int check_collection (struct packet *p, struct lease *l, struct collection *c)
 }
 void classify (struct packet *packet, struct class *class) { }
 
-static void usage (const char *s) {
+static void usage (char *s) {
        fprintf (stderr, "Usage: %s\n", s);
        exit (1);
 }
@@ -95,21 +94,13 @@ main(int argc, char **argv) {
        char s1[1024];
        int connected = 0;
        char hex_buf[1025];
-       char *progname;
-
-#ifdef OLD_LOG_NAME
-       progname = "omshell";
-#else
-       progname = argv[0];
-#endif
 
        for (i = 1; i < argc; i++) {
-               usage(isc_file_basename(progname));
+               usage(argv[0]);
        }
 
        /* Initially, log errors to stderr as well as to syslogd. */
-       openlog (isc_file_basename(progname),
-                DHCP_LOG_OPTIONS, DHCPD_LOG_FACILITY);
+       openlog ("omshell", DHCP_LOG_OPTIONS, DHCPD_LOG_FACILITY);
        status = dhcpctl_initialize ();
        if (status != ISC_R_SUCCESS) {
                fprintf (stderr, "dhcpctl_initialize: %s\n",
index 3370a93e75640d1f08e970d3bf8c6c860adfb7f8..788c91e68ce59416c20da4f197d8504604c467f0 100644 (file)
@@ -3,8 +3,7 @@
    Private master include file for the OMAPI library. */
 
 /*
- * Copyright (c) 2014-2015 by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 2009-2010 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2009-2010,2014 by Internet Systems Consortium, Inc. ("ISC") 
  * Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1996-2003 by Internet Software Consortium
  *
index ce7876baeeed52f6f8203d590da6fefbe08dd6fb..f11fefbf7066c9eeac4054d969b83d1eda96d796 100644 (file)
 
 /* #define USE_RAW_SOCKETS */
 
-/* Define this to keep the old program name (e.g., "dhcpd" for
-   the DHCP server) in place of the (base) name the program was
-   invoked with. */
-
-/* #define OLD_LOG_NAME */
-
 /* Define this to change the logging facility used by dhcpd. */
 
 /* #define DHCPD_LOG_FACILITY LOG_DAEMON */
index 67933de1155e9225a27c91dcc7d0524a8e494f61..15b49976db9ebf45c1461ec6d6ae3f1962c1dec5 100644 (file)
@@ -30,7 +30,6 @@
 #include <syslog.h>
 #include <signal.h>
 #include <sys/time.h>
-#include <isc/file.h>
 
 TIME default_lease_time = 43200; /* 12 hours... */
 TIME max_lease_time = 86400; /* 24 hours... */
@@ -141,17 +140,15 @@ static const char message[] =
 static const char url[] =
 "For info, please visit https://www.isc.org/software/dhcp/";
 
-char *progname;
-
 #ifdef DHCPv6
 #define DHCRELAY_USAGE \
-"Usage: %s [-4] [-d] [-q] [-a] [-D]\n"\
+"Usage: dhcrelay [-4] [-d] [-q] [-a] [-D]\n"\
 "                     [-A <length>] [-c <hops>] [-p <port>]\n" \
 "                     [-pf <pid-file>] [--no-pid]\n"\
 "                     [-m append|replace|forward|discard]\n" \
 "                     [-i interface0 [ ... -i interfaceN]\n" \
 "                     server0 [ ... serverN]\n\n" \
-"       %s -6   [-d] [-q] [-I] [-c <hops>] [-p <port>]\n" \
+"       dhcrelay -6   [-d] [-q] [-I] [-c <hops>] [-p <port>]\n" \
 "                     [-pf <pid-file>] [--no-pid]\n" \
 "                     [-s <subscriber-id>]\n" \
 "                     -l lower0 [ ... -l lowerN]\n" \
@@ -160,7 +157,7 @@ char *progname;
 "       upper (server link): [address%%]interface"
 #else
 #define DHCRELAY_USAGE \
-"Usage: %s [-d] [-q] [-a] [-D] [-A <length>] [-c <hops>] [-p <port>]\n" \
+"Usage: dhcrelay [-d] [-q] [-a] [-D] [-A <length>] [-c <hops>] [-p <port>]\n" \
 "                [-pf <pid-file>] [--no-pid]\n" \
 "                [-m append|replace|forward|discard]\n" \
 "                [-i interface0 [ ... -i interfaceN]\n" \
@@ -168,11 +165,7 @@ char *progname;
 #endif
 
 static void usage() {
-       log_fatal(DHCRELAY_USAGE,
-#ifdef DHCPv6
-                 isc_file_basename(progname),
-#endif
-                 isc_file_basename(progname));
+       log_fatal(DHCRELAY_USAGE);
 }
 
 int 
@@ -191,12 +184,6 @@ main(int argc, char **argv) {
        int local_family_set = 0;
 #endif
 
-#ifdef OLD_LOG_NAME
-       progname = "dhcrelay";
-#else
-       progname = argv[0];
-#endif
-
        /* Make sure that file descriptors 0(stdin), 1,(stdout), and
           2(stderr) are open. To do this, we assume that when we
           open a file the lowest available file descriptor is used. */
@@ -210,7 +197,7 @@ main(int argc, char **argv) {
        else if (fd != -1)
                close(fd);
 
-       openlog(isc_file_basename(progname), DHCP_LOG_OPTIONS, LOG_DAEMON);
+       openlog("dhcrelay", DHCP_LOG_OPTIONS, LOG_DAEMON);
 
 #if !defined(DEBUG)
        setlogmask(LOG_UPTO(LOG_INFO));
@@ -401,11 +388,7 @@ main(int argc, char **argv) {
                        exit(0);
                } else if (!strcmp(argv[i], "--help") ||
                           !strcmp(argv[i], "-h")) {
-                       log_info(DHCRELAY_USAGE,
-#ifdef DHCPv6
-                                isc_file_basename(progname),
-#endif
-                                isc_file_basename(progname));
+                       log_info(DHCRELAY_USAGE);
                        exit(0);
                } else if (argv[i][0] == '-') {
                        usage();
index 792684d1531225ad6d27dc98de1a06935961184f..972338449dec2b6bb1a0f0f7993c046eb5bc6b7f 100644 (file)
@@ -41,7 +41,6 @@ static const char url [] =
 #include <limits.h>
 #include <sys/types.h>
 #include <sys/time.h>
-#include <isc/file.h>
 
 #if defined (PARANOIA)
 #  include <sys/types.h>
@@ -97,8 +96,6 @@ int omapi_port;
 trace_type_t *trace_srandom;
 #endif
 
-char *progname;
-
 static isc_result_t verify_addr (omapi_object_t *l, omapi_addr_t *addr) {
        return ISC_R_SUCCESS;
 }
@@ -196,12 +193,6 @@ main(int argc, char **argv) {
        char *set_chroot = 0;
 #endif /* PARANOIA */
 
-#ifdef OLD_LOG_NAME
-       progname = "dhcpd";
-#else
-       progname = argv[0];
-#endif
-
         /* Make sure that file descriptors 0 (stdin), 1, (stdout), and
            2 (stderr) are open. To do this, we assume that when we
            open a file the lowest available file descriptor is used. */
@@ -238,8 +229,7 @@ main(int argc, char **argv) {
        dhcp_common_objects_setup ();
 
        /* Initially, log errors to stderr as well as to syslogd. */
-       openlog (isc_file_basename(progname),
-                DHCP_LOG_OPTIONS, DHCPD_LOG_FACILITY);
+       openlog ("dhcpd", DHCP_LOG_OPTIONS, DHCPD_LOG_FACILITY);
 
        for (i = 1; i < argc; i++) {
                if (!strcmp (argv [i], "-p")) {
@@ -1061,8 +1051,7 @@ void postconf_initialization (int quiet)
                                          &global_scope, oc, MDL)) {
                        if (db.len == 1) {
                                closelog ();
-                               openlog(isc_file_basename(progname),
-                                       DHCP_LOG_OPTIONS, db.data[0]);
+                               openlog("dhcpd", DHCP_LOG_OPTIONS, db.data[0]);
                                /* Log the startup banner into the new
                                   log file. */
                                /* Don't log to stderr twice. */
@@ -1174,7 +1163,7 @@ usage(void) {
        log_info(copyright);
        log_info(arr);
 
-       log_fatal("Usage: %s [-p <UDP port #>] [-f] [-d] [-q] [-t|-T]\n"
+       log_fatal("Usage: dhcpd [-p <UDP port #>] [-f] [-d] [-q] [-t|-T]\n"
 #ifdef DHCPv6
                  "             [-4|-6] [-cf config-file] [-lf lease-file]\n"
 #else /* !DHCPv6 */
@@ -1189,8 +1178,7 @@ usage(void) {
                  "             [-play trace-input-file]\n"
 #endif /* TRACING */
                  "             [-pf pid-file] [--no-pid] [-s server]\n"
-                 "             [if0 [...ifN]]",
-                 isc_file_basename(progname));
+                 "             [if0 [...ifN]]");
 }
 #endif