site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com
It would seem the answer is ... no. At least not via kauth. It looks like it would require some changes internally; right now you would need to get passed in the struct nameidata down, and vnode_authorize only takes two vnodes as arguments.
You could use vn_getpath (see vnode.h) but it does not ask the filesystem for names, so it can't handle hard link nodes, and might return an error.
I don't think that's going to work in this case. As I understand it, the original poster asked about getting the filename at authorization (via kauth) time. Unfortunately, you're not given a target vnode to the kauth function because the vnode hasn't been created yet. What would be ideal would be for the desired filename to be passed down to the kauth routine, but that isn't done.
It is not that hard to use getattrlist inside a kernel. This is the best way to get the name of a vnode. Just fill out the vnop_getattr_args and call VNOP_GETATTRLIST. For example: [...]
You mean VNOP_GETATTR(), right? I will note that from what I can see, only hfs actually returns va_name on MacOS X (okay, it's pretty likely you're going to be using hfs at least for local filesystems, but I guess my point is that it's not a guarantee that it will work). --Ken _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Ken Hornstein