Module Name: src
Committed By: jdf
Date: Sun Sep 23 17:37:51 UTC 2012
Modified Files:
src/distrib/utils/sysinst: net.c
Log Message:
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.132 -r1.133 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.132 src/distrib/utils/sysinst/net.c:1.133
--- src/distrib/utils/sysinst/net.c:1.132 Tue May 1 18:28:47 2012
+++ src/distrib/utils/sysinst/net.c Sun Sep 23 17:37:51 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: net.c,v 1.132 2012/05/01 18:28:47 riz Exp $ */
+/* $NetBSD: net.c,v 1.133 2012/09/23 17:37:51 jdf 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));