[Top][All Lists]

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

Re: Badly formatted 'ls -l'

From: Paul Eggert
Subject: Re: Badly formatted 'ls -l'
Date: 10 Dec 2003 16:51:20 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Jim Meyering <address@hidden> writes:

> Or maybe you're thinking of a system for which ID_LENGTH_MAX wasn't accurate?

Yes, that's it.

> I suppose the Hurd may not define LOGIN_NAME_MAX, or may define it
> to be very large.  I don't have access to a Hurd system so can't check that.

Yes, that's the basic idea.  If there is no practical limit to login
name length, then POSIX says that LOGIN_NAME_MAX is supposed to be
undefined.  But the old coreutils code assumes a maximum value of 9
(or perhaps 17) in that case, which is obviously bogus.

> Does the Hurd -- or any system -- really let struct passwd's pw_name
> point to a string of length INT_MAX?

glibc's sysdeps/mach/hurd/bits/local_lim.h indicates that the Hurd
does not define LOGIN_NAME_MAX.

Another fix would be to replace "INT_MAX < len" with "INT_MAX <= len"
in format_user_width, but that's pretty obscure and anyway I figure
it's just as easy to support the case where strlen (name) == INT_MAX
as to not support it.

I should also mention that, regardless of whether the patch is
installed, the code silently stops working when dired_pos overflows.
There is no buffer overrun, but the output numbers are wrong.  This
should get fixed at some point, but it's not as urgent.

reply via email to

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