netbsd-tech-kern mailing list

FromSubjectsort iconDate
Elad Efrat
Vnode scope implementation
Hi, I'd like to start implementing the vnode scope for some of our file-systems. As with the rest of kauth(9), we'll do so in several steps, rather than switch all functionality at once. The first step will be implementing the back-end itself: the scope definition, some actions (just read/write/execute for now), an authorization wrapper, and a bsd44/suser simple listener ("if root or file-system allows then allow") -- see the attached diff. Once the back-end is in place, I'll follow-up with so...
Jul 4, 1:14 pm 2009
Alan Barrett
Re: Vnode scope implementation
On a machine where int is a 32-bit type, 1<<31 is undefined (per section 6.5.7 of the C99 standard). I suggest writing this as 0x80000000, and similarly for other constants. --apb (Alan Barrett)
Jul 4, 3:12 pm 2009
Marc Balmer
Re: Vnode scope implementation
can't you explain beforehand a bit what the goals are? Why do we need
Jul 4, 1:52 pm 2009
Elad Efrat
Re: Vnode scope implementation
You can see the purpose it will serve by reading Apple's TN2127, on which kauth(9) is loosely based. Basically, as I've said in several emails in the past, the vnode scope allows authorization of file-system related operations (such as read, write, execute, change owner, change flags, change modes, ...) using kauth(9). In other words, it allows us to plug security models that extends the traditional behavior to other things -- like the ACLs I've posted not too long ago: Yes, it is. Thanks, ...
Jul 4, 2:15 pm 2009
Matthew Mondor
Re: Vnode scope implementation
On Sat, 4 Jul 2009 21:15:42 +0300 It's the second time I'm looking at this, and each time I wondered: hopefully a cleaner representation than XML will be used in the final ACL control tools? :) Thanks, -- Matt
Jul 4, 3:17 pm 2009
Elad Efrat
Re: Vnode scope implementation
When we get to the point where we're considering the addition of "virtual ACLs" to NetBSD, we can discuss the on-disk format... for now let's focus on the back-end and vnode scope integration. ;) Thanks, -e.
Jul 4, 3:29 pm 2009
David Holland
Re: Vnode scope implementation
I'd like to see some examples of what this is expected to look like. > /* > + * Vnode scope - actions. > + */ > +#define KAUTH_VNODE_READ_DATA (1 << 0) > +#define KAUTH_VNODE_LIST_DIRECTORY KAUTH_VNODE_READ_DATA > +#define KAUTH_VNODE_WRITE_DATA (1 << 1) > +#define KAUTH_VNODE_ADD_FILE KAUTH_VNODE_WRITE_DATA > +#define KAUTH_VNODE_EXECUTE (1 << 2) > +#define KAUTH_VNODE_SEARCH KAUTH_VNODE_EXECUTE > + > +#define KAUTH_VNODE_AC...
Jul 4, 1:38 pm 2009
Elad Efrat
Re: Vnode scope implementation
Hi, I've got a feeling that you haven't read the man-page or Apple's TN2127, but anyway-- There are numerous examples of how this will look like: anything that was already converted to kauth(9), pretty much, as well as the ACL Yes. If you will read Apple's TN2127, you'll see that the vnode scope's actions are bits so several of them can be authorized in one More than a few. Again, if you will look at TN2127, you'll see that it contains both the definitions you see above as well as several ...
Jul 4, 2:08 pm 2009
Christoph Egger
Re: Vnode scope implementation
If these need to be really bits then please use __BIT(0), __BIT(1), __BIT(2) and __BIT(31) Christoph
Jul 4, 1:45 pm 2009
David Laight
Re: Vnode scope implementation
Grrr.... I hate those sort of defines - they just force you to go and look up their definitions to see which numbering scheme is being used. IMHO using (1 << n) is enough to say 'these might be or'ed together. Even a sequence of hex constants will be an obvious bit pattern list. David -- David Laight: david@l8s.co.uk
Jul 4, 6:24 pm 2009
Matthew Mondor
Re: Vnode scope implementation
On Sat, 4 Jul 2009 23:24:53 +0100 I agree that C bit operators are obvious enough, although that may be a per-project style preference issue. With the bit operators, noone has to look at whatever the macro may expand to, especially that every project might define its unstandard wrapper... Moreover, the macros aren't necessarily shorter or more readable, and they result in less portable code. It seems that KNF doesn't have a suggestion about it either. But I don't have a strong opinion about t...
Jul 4, 6:52 pm 2009
Elad Efrat
Re: Vnode scope implementation
They need to be bits. I'll use the __BIT() macro. Thanks, -e.
Jul 4, 2:09 pm 2009
previous daytodaynext day
July 3, 2009July 4, 2009July 5, 2009