Re: getting the application path in VnodeScopeListener
Re: getting the application path in VnodeScopeListener
- Subject: Re: getting the application path in VnodeScopeListener
- From: Mike Smith <email@hidden>
- Date: Thu, 13 Oct 2005 23:58:31 -0700
Understood.
If what you need is strictly an *application* name, i.e. something
that the user actually launched, then if you have a userland
component you could ask Launch Services for the proper displayable
name of the process. I can't see any good reason for a kernel
component to need the name of an app, so I'm assuming that this is
for logging or display purposes.
= Mike
On Oct 13, 2005, at 8:43 PM, Ben wrote:
I cant explain my goal because I'm under NDA
On 14/10/2005, at 4:35 PM, Mike Smith wrote:
Ben,
How about you respond to my original question, then, and explain
just what it is that you're trying to achieve...
= Mike
On Oct 13, 2005, at 8:10 PM, Ben wrote:
yes, just the full application name is not perfect but it would
do. I'd be grateful for any help on that
On 14/10/2005, at 4:04 PM, Mike Smith wrote:
On Oct 13, 2005, at 4:01 PM, Ben wrote:
my current mechanism is to use vfs_context_pid then proc_name
to get the name. The main issue with this is proc_name will
only provide the first 16 bytes of the process name.
Ben,
So is it just that what you're looking for is the full name of
the application? There are other ways that you can get this.
= Mike
if I could either find a way to get the full application name,
or (this is the preferable solution) to get a vnode from a
vfs_context_t, that would satisfy this.
any function to get a path from a pid would also be suitable
On 13/10/2005, at 3:33 PM, Terry Lambert wrote:
vfs_context_pid(), which is exported in BSDKernel.exports,
will tell you the pid.
proc_name(), which is exported in BSDKernel.exports, will
convert the pid into a name and copy it into a buffer you
supply and give a length for.
This won't necessarily be the application path if the
application was launched via finder; it might also be a volfs
path, so it should not be relied on as a credential for
authorization or authentication purposes or for the granting
of some other type of trust, if you are trying to establish a
security association.
Note that you should not use file I/O in the kernel, either,
so if you are intending to use this information to get a
bundle ID from which to optain some other file path and read
it in the kernel - don't do that.
-- Terry
On Oct 12, 2005, at 3:39 PM, Ben wrote:
I am doing some work in the kauth KPI and I need to get the
application path (of the application performing the action
causing this function to get called) from within
VnodeScopeListener.
I think this will be available because VnodeScopeListener
gets passed in a vfs_context_t for the application in
question, however most of the accessor functions for this
opaque object are undocumented, so my hope is someone can
point me to which one to use to obtain a vnode from the
vfs_context_t, which I can then get a path from, or some
other way of getting the path.
I am okay if the path cannot be obtained all of the time,
just some of the time (I'm aware of the issues of trying to
use paths, so I'm not relying on them, but when they are
there they do make things easier)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mu.org
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mu.org
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden