Debian bug report logs -
#1094, boring messages
Message sent to debian-devel@pixar.com:
Subject: Bug#1094: Problem in reading the host name from file
Reply-To: sr1@irz301.inf.tu-dresden.de (Sven Rudolph), debian-bugs@pixar.com
Resent-To: debian-devel@pixar.com
Resent-From: sr1@irz301.inf.tu-dresden.de (Sven Rudolph)
Resent-Sender: iwj10@cus.cam.ac.uk
Resent-Date: Wed, 12 Jul 1995 16:18:03 GMT
Resent-Message-ID: <debian-bugs-handler.1094.0712160918230@pixar.com>
X-Debian-PR-Package: hostname
X-Debian-PR-Keywords:
Received: via spool for debian-bugs; Wed, 12 Jul 1995 16:18:03 GMT
Received: with rfc822 via encapsulated-mail id 0712160918230;
Wed, 12 Jul 1995 16:09:18 GMT
Received: from pixar.com by mongo.pixar.com with smtp
(Smail3.1.28.1 #15) id m0sW4KS-00063ZC; Wed, 12 Jul 95 09:08 PDT
Received: from irz301.inf.tu-dresden.de by pixar.com with SMTP id AA01979
(5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Wed, 12 Jul 1995 09:06:27 -0700
Received: by irz301.inf.tu-dresden.de
(5.67b+/DEC-Ultrix/4.3) id AA09668; Wed, 12 Jul 1995 18:07:45 +0200
Date: Wed, 12 Jul 1995 18:07:45 +0200
From: sr1@irz301.inf.tu-dresden.de (Sven Rudolph)
Message-Id: <199507121607.AA09668@irz301.inf.tu-dresden.de>
To: debian-bugs@pixar.com
Package: hostname
Version: 1.6-2
(I didn't find a non-debian maintainer for this program, therefore I
report the bug here. Please forward this if necessary.)
When I invoke 'hostname --file /etc/hostname' and the host name in
/etc/hostname is not trerminated with '\n' , the hostname will not be
set.
System information :
- Debian 0.93R5
- Linux 1.2.8, i386
How to repeat the bug:
# hostname ''
# hostname
# od -ax /etc/hostname
0000000 i r s 2 1 2
7269 3273 3231
0000006
# hostname --file /etc/hostname
# hostname
# editing /etc/hostname ...
# od -ax /etc/hostname
0000000 i r s 2 1 2 nl nul
7269 3273 3231 000a
0000007
# hostname --file /etc/hostname
# hostname
irs212
#
How to fix the bug:
*** hostname.c.original Sun Feb 5 17:14:18 1995
--- hostname.c Sun Feb 5 17:16:09 1995
***************
*** 146,158 ****
char fline[MAXHOSTNAMELEN];
if ((fd = fopen(optarg, "r")) != NULL) {
! while (fgets(fline, sizeof(fline), fd) != NULL)
if ((p = index(fline, '\n')) != NULL) {
*p = '\0';
- if (fline[0] == '#')
- continue;
- sethname(fline);
}
(void) fclose(fd);
} else {
fprintf(stderr,"%s: can't open `%s'\n",
--- 146,159 ----
char fline[MAXHOSTNAMELEN];
if ((fd = fopen(optarg, "r")) != NULL) {
! while (fgets(fline, sizeof(fline), fd) != NULL) {
if ((p = index(fline, '\n')) != NULL) {
*p = '\0';
}
+ if (fline[0] == '#')
+ continue;
+ sethname(fline);
+ }
(void) fclose(fd);
} else {
fprintf(stderr,"%s: can't open `%s'\n",
Sven
--
Sven Rudolph (sr1@inf.tu-dresden.de); WWW : http://www.sax.de/~sr1/
Message sent:
From: iwj10@thor.cam.ac.uk (Ian Jackson)
To: sr1@irz301.inf.tu-dresden.de (Sven Rudolph)
Subject: Bug#1094: Acknowledgement (was: Problem in reading the host name from file)
In-Reply-To: <199507121607.AA09668@irz301.inf.tu-dresden.de>
References: <199507121607.AA09668@irz301.inf.tu-dresden.de>
Thank you for the problem report you have sent regarding Debian GNU/Linux.
This is an automatically generated reply, to let you know your message has
been received. It is being forwarded to the developers' mailing list for
their attention; they will reply in due course.
If you wish to submit further information on your problem, please send
it to debian-bugs@pixar.com, but please ensure that the Subject
line of your message starts with "Bug#1094" or "Re: Bug#1094" so that
we can identify it as relating to the same problem.
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the bug-tracking system.
Ian Jackson
(maintainer, debian-bugs)
Ian Jackson /
iwj10@thor.cam.ac.uk,
with the debian-bugs tracking mechanism