nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] hostname for locking is sometimes too long


From: Benno Schulenberg
Subject: Re: [Nano-devel] hostname for locking is sometimes too long
Date: Thu, 05 Nov 2015 14:05:43 +0100

On Wed, Nov 4, 2015, at 22:29, Mike Frysinger wrote:
> On 04 Nov 2015 21:53, Benno Schulenberg wrote:
> > On Ubuntu 15.10 we have a serious bug report:
> >   https://bugs.launchpad.net/ubuntu/+source/nano/+bug/1509081
> > 
> > Apparently some hostnames are longer than 31 characters,
> > and gethostname() returns -1 and ENAMETOOLONG.
> > 
> > I think that when this latter error is returned, then
> > write_lockfile() should ignore the -1 return value,
> > null-terminate myhostname, and continue.  Right?
> 
> sounds fine.

Proposed patch is attached.

>  could also increase the 32 to 256.

Well, the hostname is obtained in order to put it into the
vim-style lock file, and there is only a slot of 32 bytes
available for the name, so there is little point in getting
more bytes.

Benno

-- 
http://www.fastmail.com - A fast, anti-spam email service.

Attachment: trim-long-hostname.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]