🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1089

Problem with ls (fileutils 3.4)

#1089
From: Marty Leisner
Date: Thu, 12 Nov 1992 01:56
55 lines
2229 bytes
I'm running on SunOS 4.1.2 on sparcs...

Trying to do ls -l on an automounter directory gave wierd results...
The system ls doesn't have these problems...

Using ls -l with the distributed ls I get:
ls -l /usr/AnswerBook
lrwxrwxrwx   1 root     wheel          15 Nov 11 20:48 /usr/AnswerBook -> /files4/AnswerB

when I should get:
leisner@annapurna$ ./ls -l /usr/AnswerBook
lrwxrwxrwx   1 root     wheel          15 Nov 11 20:46 /usr/AnswerBook -> /files4/AnswerBook

Working with the code, I saw a comment in get_link_name():
  /* Some automounters give incorrect st_size for mount points.
     I can't think of a good workaround for it, though.  *

This is true but very strange...
The workaround I came up with quickly was:
*** 1.1 1992/11/12 01:22:41
--- ls.c        1992/11/12 01:45:22
***************
*** 1017,1023 ****
  #ifdef _AIX
    register int bufsiz = PATH_MAX; /* st_size is wrong. */
  #else
!   register int bufsiz = f->stat.st_size;
  #endif
    register int linksize;
  
--- 1017,1025 ----
  #ifdef _AIX
    register int bufsiz = PATH_MAX; /* st_size is wrong. */
  #else
!   register int bufsiz = f->stat.st_size*2; /* these is a kludge trying to work around
!                                           * the automounter problem -- ml
!                                           */
  #endif
    register int linksize;
  


Essentially, make bufsiz bigger...it works in this case...

For symbolic links, it will waste some space...  I can't wait for a rational
OS with source....


Marty    leisner.henr801c@xerox.com 
 	 leisner@eso.mc.xerox.com 
          Member of the League for Programming Freedom 
 The Feynman Problem Solving Algorithm:
 1) Write down the problem
 2) Think very hard
 3) Write down the answer     -- Murray Gell-mann
Technical Details
Message-ID: <9211120156.AA01044@annapurna.wbst147.xerox.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!eso.mc.xerox.COM!leisner

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!eso.mc.xerox.COM!leisner
From: leisner@eso.mc.xerox.COM ( Marty Leisner)
Subject: Problem with ls (fileutils 3.4)
Message-ID: <9211120156.AA01044@annapurna.wbst147.xerox.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 12 Nov 1992 01:56:36 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 56