Module Name:    src
Committed By:   riz
Date:           Mon Oct  1 17:43:01 UTC 2012

Modified Files:
        src/distrib/utils/sysinst [netbsd-6]: net.c

Log Message:
Pull up following revision(s) (requested by jdf in ticket #570):
        distrib/utils/sysinst/net.c: revision 1.133
Prevent sysinst from setting an fqdn in rc.conf when the user entered no
domain (i.e., sets only the hostname).  Fix for PR install/46946.


To generate a diff of this commit:
cvs rdiff -u -r1.130.2.1 -r1.130.2.2 src/distrib/utils/sysinst/net.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/sysinst/net.c
diff -u src/distrib/utils/sysinst/net.c:1.130.2.1 src/distrib/utils/sysinst/net.c:1.130.2.2
--- src/distrib/utils/sysinst/net.c:1.130.2.1	Thu May 17 18:57:11 2012
+++ src/distrib/utils/sysinst/net.c	Mon Oct  1 17:43:00 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.130.2.1 2012/05/17 18:57:11 sborrill Exp $	*/
+/*	$NetBSD: net.c,v 1.130.2.2 2012/10/01 17:43:00 riz Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -435,9 +435,9 @@ recombine_host_domain(void)
 
 	strlcpy(recombined, net_host, sizeof(recombined));
 
-	if (l <= 0 ||
+	if (strlen(net_domain) != 0 && (l <= 0 ||
 	    net_host[l - 1] != '.' ||
-	    strcasecmp(net_domain, net_host + l) != 0) {
+	    strcasecmp(net_domain, net_host + l) != 0)) {
 		/* net_host isn't an FQDN. */
 		strlcat(recombined, ".", sizeof(recombined));
 		strlcat(recombined, net_domain, sizeof(recombined));

Reply via email to