bin/89799: Making natd not require a newline at the end of a
configuration file.
Jason Burgess
dev at fenux.net
Thu Dec 1 16:00:16 GMT 2005
>Number: 89799
>Category: bin
>Synopsis: Making natd not require a newline at the end of a configuration file.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Dec 01 16:00:11 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Jason Burgess
>Release: 5.4-STABLE
>Organization:
HolosTek, Inc.
>Environment:
FreeBSD saturn.fbfguns.com 5.4-STABLE FreeBSD 5.4-STABLE #2: Tue Oct 11 11:48:46 CDT 2005 root at saturn.fbfguns.com:/usr/obj/usr/src/sys/SATURN i386
>Description:
When using the -f option with natd to load a config file, the config file is required to contain a newline at the end of the file. If you forget and are restarting natd remotely, you may lose access to the machine to fix the error.
I know that this has caused great inconvenience for me to have to drive to my office to fix the problem when I've forgotten the newline at the end of the file. I am submitting a patch to correct the issue.
>How-To-Repeat:
Load a config file into natd without a newline at the end of it.
>Fix:
--- natd.c Thu Dec 1 09:45:19 2005
+++ natd.c.orig Thu Dec 1 09:44:48 2005
@@ -1498,17 +1498,8 @@
if (buf[len - 1] == '\n')
buf[len - 1] = '\0';
else
- if (buf[len - 1] != '\0')
- {
- len++;
- buf = strcat(buf, "\0");
- }
-/*
- * This is being changed to correct the problem instead.
- *
- * errx(1, "config file format error: "
- * "last line should end with newline");
- */
+ errx(1, "config file format error: "
+ "last line should end with newline");
/*
* Check for comments, strip off trailing spaces.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list