On Thu, 22 Feb 2001, Stephen C. Tweedie wrote:

> Hi,
> 
> On Tue, Feb 20, 2001 at 11:31:52PM +0100, Andreas Gruenbacher wrote:
> 
> > > We're going round in circles again. :-)
> > > 
> > > Why should the ACL API have to assume that the ACLs are in fact stored
> > > inside EAs?  It is perfectly valid for a filesystem to support ACLs
> > > without supporting generic EAs.
> > 
> > Then let's assume an ACL syscall, if you wish.
> 
> I don't wish, that's exactly the point.
> 
> By having an EA API which is generic enough to cope with ACLs too, we
> can use the same API for other things such as MAC labels or DMAPI
> information, just by defining new attribute namespaces.  It's 
> analogous to BSD socket API's address families.

There already _are_ numeric namespaces in the interface. As I think we're
not going to make much progress without discussing ACLs again, here is the
format and the semantics that I think we should use:

- The whole ACL is passed to the kernel in one chunk of memory.
- There is a header, followed by a number of entries. The entry
  format depends on the type of the ACL, as specified in the header:

struct acl_header {
        int class;
        unsigned int entries;
};

/* Entry format for Posix ACLs (class = ACL_CLASS_POSIX) */
struct posix_acl_entry {
        short e_tag;      /* ACL_USER_OBJ, ACL_USER, etc. */
        short e_id_type;  /* 0 = numeric ID's */
        int   e_perm;     /* permission bits */
        union {
                id_t e_numeric_id;
                ...
        } e_id;
};

The entry length can be dynamic, if the ID is not of fixed length (e.g.,
"user@domain" format).

For other types of ACLs the format might differ completely. As there has
to be custom code in the kernel for each format, forcing all ACEs into the
same entry format doesn't buy us anything anyway.

For passing this structure to the kernel, we could either define a new
system call, or pass it via an EA system call. I'm assuming an EA system
call here.

If we are going to use an EA system call, then we could either put all
ACLs (or even all "system objects") in the same namespace, and distinguish
them by the attribute name, or we could create several different
namespaces. These approaches don't differ significantly. In any case will
it be necessary in the kernel to check both the namespace and the name to
find the right function for handling the EA.

> By avoiding the issue, you miss the opportunity to get an API which
> is extensible enough for all of the other semantically rich attributes
> which we might want to support in the future. 

Now which opportunities does this approach miss, and why do you think this
format is not extensible enough?

For ACLs and all the other things that can be passed as EA's and/or stored
as EA's it's not necessary to use other formats; especially it's not
necessary to handle arrays of entries at the EA level. But _if_ that
should become necessary one day, we can still define a few additional EA
operations, and a new namespace for these things to live in.

> I guess it's worth passing by Linus, though: he might prefer separate
> syscalls for this.

I don't know Linus' opinion on this, but there are still many other things
we need to sort out that might make this decision clear in the end.

Cheers,
Andreas.

------------------------------------------------------------------------
 Andreas Gruenbacher, [EMAIL PROTECTED]
 Contact information: http://www.bestbits.at/~ag/

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]

Reply via email to