Re: How to extend struct stat?

Richard B. Johnson (root@chaos.analogic.com)
Tue, 5 Oct 1999 10:02:09 -0400 (EDT)


On Tue, 5 Oct 1999, Jesse Pollard wrote:

> >I'm implementing ACLs. Project location:
> ><http://major.rithus.co.at/acl/>.
> >
> >For utilities like `ls', I need a flag `has extended access
> >control information' in `struct stat'. Also, some operations
> >in the VFS can be optimized with such a flag. An ioctl() call
> >is inappropriate; this really belongs in the VFS.
>
> Perhaps it is time to see about expanding the mode bits to include
> several more fields (most unused at this time, but I can think of
> several -a online/offline flag (file migration), a compressed flag
> (file is compressed, may be used with the online flag. (More future
> development...)
>
> >
> >Here is what I want ls to do. (This is also how Solaris
> >implements it):
> >
> > andy@snowball:/acl/test > ls -l
> > -rw-rw---- 1 andy toolies 5 Oct 5 13:27 file1
> > -rw-rw----+ 1 andy toolies 5 Oct 5 13:27 file2
> >
> >I simply would have added a bit to the st_mode field in struct stat;
> >that would have done the job. Unfortunately on i386 systems, st_mode
> >is 16 bits wide, all bits used.
>
> The display looks fine to me.
> - perhaps it is time to see about expanding
> the mode bits to include several more fields.
> >
> >I know this will break some scripts. The scripts need to be changed,
> >simply.
>
> I don't think it will hurt very many scripts - the mode field is not
> as usefull as others (byte length, file name, owner). Since it is
> still part of the first field there shouldn't too much of a problem.
>
> -------------------------------------------------------------------------
> Jesse I Pollard, II
> Email: pollard@navo.hpc.mil
>

In a related note, I recently noticed that the `struct dirent` ,
/usr/include/direntry.h, contains a d_type field that is always
zero. This makes it necessary to make additional calls to lstat
to find out the nature of a file. This may be a 'C' library problem,
but defining '__USE_BSD' (see /usr/include/dirent.h) didn't fill
in the field.

I wish that some of these little problems were fixed before potential
new ones are created.

Cheers,
Dick Johnson
**** FILE SYSTEM WAS MODIFIED ****
Penguin : Linux version 2.3.13 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/