rpms/dhcp/devel dhcp-3.0.4-dhclient-usage-to-stdout.patch, NONE, 1.1 dhcp.spec, 1.116, 1.117
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Fri Oct 13 18:34:54 UTC 2006
Author: dcantrel
Update of /cvs/dist/rpms/dhcp/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv2082
Modified Files:
dhcp.spec
Added Files:
dhcp-3.0.4-dhclient-usage-to-stdout.patch
Log Message:
- Send usage() screen in dhclient to stdout rather than the syslog (#210524)
dhcp-3.0.4-dhclient-usage-to-stdout.patch:
dhclient.c | 96 ++++++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 64 insertions(+), 32 deletions(-)
--- NEW FILE dhcp-3.0.4-dhclient-usage-to-stdout.patch ---
--- dhcp-3.0.4/client/dhclient.c.usage-to-stdout 2006-10-13 13:14:31.000000000 -0400
+++ dhcp-3.0.4/client/dhclient.c 2006-10-13 13:56:47.000000000 -0400
@@ -160,32 +160,42 @@
release_mode = 1;
no_daemon = 1;
} else if (!strcmp (argv [i], "-p")) {
- if (++i == argc)
+ if (++i == argc) {
usage ();
+ return EXIT_FAILURE;
+ }
local_port = htons (atoi (argv [i]));
log_debug ("binding to user-specified port %d",
ntohs (local_port));
} else if (!strcmp (argv [i], "-d")) {
no_daemon = 1;
} else if (!strcmp (argv [i], "-pf")) {
- if (++i == argc)
+ if (++i == argc) {
usage ();
+ return EXIT_FAILURE;
+ }
path_dhclient_pid = argv [i];
no_dhclient_pid = 1;
} else if (!strcmp (argv [i], "-cf")) {
- if (++i == argc)
+ if (++i == argc) {
usage ();
+ return EXIT_FAILURE;
+ }
path_dhclient_conf = argv [i];
no_dhclient_conf = 1;
} else if (!strcmp (argv [i], "-lf")) {
- if (++i == argc)
+ if (++i == argc) {
usage ();
+ return EXIT_FAILURE;
+ }
path_dhclient_db = argv [i];
no_dhclient_db = 1;
} else if (!strcmp (argv [i], "-sf")) {
- if (++i == argc)
+ if (++i == argc) {
usage ();
- path_dhclient_script = argv [i];
+ return EXIT_FAILURE;
+ }
+ path_dhclient_script = argv [i];
no_dhclient_script = 1;
} else if (!strcmp (argv [i], "-1")) {
onetry = 1;
@@ -194,12 +204,16 @@
quiet_interface_discovery = 1;
log_isc_blurb = 0;
} else if (!strcmp (argv [i], "-s")) {
- if (++i == argc)
+ if (++i == argc) {
usage ();
+ return EXIT_FAILURE;
+ }
server = argv [i];
} else if (!strcmp (argv [i], "-g")) {
- if (++i == argc)
+ if (++i == argc) {
usage ();
+ return EXIT_FAILURE;
+ }
relay = argv [i];
} else if (!strcmp (argv [i], "-nw")) {
nowait = 1;
@@ -211,8 +225,10 @@
persist = 1;
} else if (!strcmp (argv [i], "-e")) {
struct string_list *tmp;
- if (++i == argc)
+ if (++i == argc) {
usage ();
+ return EXIT_FAILURE;
+ }
tmp = dmalloc (strlen (argv [i]) + sizeof *tmp, MDL);
if (!tmp)
log_fatal ("No memory for %s", argv [i]);
@@ -229,8 +245,10 @@
new_option_info_tree = GENERATE_NEW_OPTION_INFO;
#endif
} else if (!strcmp (argv [i], "-I")) {
- if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0'))
+ if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0')) {
usage ();
+ return EXIT_FAILURE;
+ }
if (strlen(argv[i]) >= DHCP_OPTION_LEN)
{
log_error("-I option dhcp-client-identifier string \"%s\" is too long -"
@@ -242,8 +260,10 @@
} else if (!strcmp (argv [i], "-B")) {
bootp_broadcast_always = 1;
} else if (!strcmp (argv [i], "-H")) {
- if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0'))
- usage ();
+ if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0')) {
+ usage ();
+ return EXIT_FAILURE;
+ }
if (strlen(argv[i]) >= DHCP_OPTION_LEN)
{
log_error("-H option host-name string \"%s\" is too long -"
@@ -262,8 +282,10 @@
}
dhcp_host_name_arg = argv[i];
} else if (!strcmp (argv [i], "-F")) {
- if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0'))
+ if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0')) {
usage ();
+ return EXIT_FAILURE;
+ }
if (strlen(argv[i]) >= DHCP_OPTION_LEN)
{
log_error("-F option fqdn.fqdn string \"%s\" is too long -"
@@ -283,16 +305,20 @@
dhcp_fqdn_arg = argv[i];
} else if (!strcmp (argv [i], "-T")) {
- if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0'))
- usage ();
+ if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0')) {
+ usage ();
+ return EXIT_FAILURE;
+ }
if ((timeout_arg = atoi(argv[i])) <= 0 )
{
log_error("-T timeout option must be > 0 - bad value: %s",argv[i]);
exit(1);
}
} else if (!strcmp (argv [i], "-V")) {
- if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0'))
+ if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0')) {
usage ();
+ return EXIT_FAILURE;
+ }
if (strlen(argv[i]) >= DHCP_OPTION_LEN)
{
log_error("-V option vendor-class-identifier string \"%s\" is too long -"
@@ -301,11 +327,14 @@
}
dhcp_vendor_class_identifier_arg = argv[i];
} else if (!strcmp (argv [i], "-R")) {
- if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0'))
+ if ((++i == argc) || (argv[i] == 0L) || (*(argv[i])=='\0')) {
usage ();
+ return EXIT_FAILURE;
+ }
dhclient_request_options=argv[i];
} else if (argv [i][0] == '-') {
- usage ();
+ usage ();
+ return EXIT_FAILURE;
} else {
struct interface_info *tmp = (struct interface_info *)0;
status = interface_allocate (&tmp, MDL);
@@ -882,24 +911,27 @@
static void usage ()
{
- log_info ("%s %s", message, DHCP_VERSION);
- log_info (copyright);
- log_info (arr);
- log_info (url);
+ printf ("%s %s\n", message, DHCP_VERSION);
+ printf (copyright);
+ printf ("\n");
+ printf (arr);
+ printf ("\n");
+ printf (url);
+ printf ("\n");
#ifdef EXTENDED_NEW_OPTION_INFO
- log_error ("Usage: dhclient [-1dqr] [-nwx] [-p <port>] %s",
+ printf ("Usage: dhclient [-1dqr] [-nwx] [-p <port>] %s",
#else
- log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
+ printf ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
#endif
- "[-s server]");
- log_error (" [-cf config-file] [-lf lease-file]%s",
- "[-pf pid-file] [-e VAR=val]");
- log_error (" [ -I <dhcp-client-identifier> ] [-B]");
- log_error (" [ -H <host-name> | -F <fqdn.fqdn> ] [ -T <timeout> ] ");
- log_error (" [ -V <vendor-class-identifier> ]");
- log_error (" [ -R <request option list> ]");
- log_fatal (" [ -sf script-file] [interface]");
+ "[-s server]\n");
+ printf (" [-cf config-file] [-lf lease-file]%s\n",
+ "[-pf pid-file] [-e VAR=val]\n");
+ printf (" [ -I <dhcp-client-identifier> ] [-B]\n");
+ printf (" [ -H <host-name> | -F <fqdn.fqdn> ] [ -T <timeout> ]\n");
+ printf (" [ -V <vendor-class-identifier> ]\n");
+ printf (" [ -R <request option list> ]\n");
+ printf (" [ -sf script-file] [interface]\n");
}
Index: dhcp.spec
===================================================================
RCS file: /cvs/dist/rpms/dhcp/devel/dhcp.spec,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -r1.116 -r1.117
--- dhcp.spec 11 Sep 2006 15:19:54 -0000 1.116
+++ dhcp.spec 13 Oct 2006 18:34:52 -0000 1.117
@@ -4,7 +4,7 @@
Summary: A DHCP (Dynamic Host Configuration Protocol) server and relay agent.
Name: dhcp
Version: 3.0.4
-Release: 21%{?dist}
+Release: 22%{?dist}
Epoch: 12
License: distributable
Group: System Environment/Daemons
@@ -75,6 +75,7 @@
Patch177: dhcp-3.0.4-dhclient-script-METRIC.patch
Patch178: dhcp-3.0.4-dhclient-script-ntp-fudge-bz191461.patch
Patch179: dhcp-3.0.4-bz202911.patch
+Patch180: dhcp-3.0.4-dhclient-usage-to-stdout.patch
# patch to make the library subtree
Patch499: dhcp-3.0.4-lib-makefile.patch
@@ -209,6 +210,7 @@
%patch177 -p1 -b .dhclient-script-METRIC
%patch178 -p1 -b .dhclient-script-ntp-fudge-bz191461
%patch179 -p1 -b .bz202911
+%patch180 -p1 -b .usage-to-stdout
%patch499 -p1 -b .lib-makefile
@@ -460,6 +462,9 @@
%endif
%changelog
+* Fri Oct 13 2006 David Cantrell <dcantrell at redhat.com> - 12:3.0.4-22
+- Send usage() screen in dhclient to stdout rather than the syslog (#210524)
+
* Mon Sep 11 2006 David Cantrell <dcantrell at redhat.com> - 12:3.0.4-21
- Rebuild (#205505)
More information about the fedora-cvs-commits
mailing list