On Tue, 21 Nov 2006, Robert Bauck Hamar wrote:
*Tom Rindborg:
Hi,
I have problems with ls in the latest coreutils, it segfaults when doing ls -l in a directory containing a file with an "unknown" uid:
It's gid, actually. Unknown uid should work fine, but not as expected. A quick patch (copy-paste from the uid-function):
--- coreutils-6.5/lib/idcache.c 2006-11-07 15:42:11.000000000 +0100 +++ coreutils-6.5/lib/idcache.c.new 2006-11-21 20:11:00.000000000 +0100 @@ -142,7 +142,7 @@ return tail->name; grent = getgrgid (gid); - name = grent ? grent->gr_name : NULL; + name = grent ? grent->gr_name : ""; tail = xmalloc (offsetof (struct userid, name) + strlen (name) + 1); tail->id.g = gid; strcpy (tail->name, name);
Thanks for investigating, and you are right, this certainly does not work as expected... ;-) Investigating a little further this seems to be a known problem: http://lists.gnu.org/archive/html/bug-coreutils/2006-11/msg00152.html I will stay with 6.4 for the time being awaiting a fix. -- Hälsningar/Best regards, Tom ________________________________________________________________________ Tom Rindborg Phone: +46-8-599 984 40 Stockholm, Sweden MailTo:Tom.Rindborg@fatburen.org "If you have to hate, hate gently."