* Pushd and Propd issue in filesystem
@ 2013-08-06 6:36 Saket Sinha
2013-08-06 14:35 ` Jonathan Neuschäfer
0 siblings, 1 reply; 2+ messages in thread
From: Saket Sinha @ 2013-08-06 6:36 UTC (permalink / raw)
To: kernelnewbies
I have to support pushd and popd from userspace in a filesystem that I have
designed.
In my filesystem driver, to implement it I have done the following
for popd - the driver implementation is
https://github.com/disdi/hepunion/blob/master/fs/hepunion/hepunion.h#L386
#define pop_root() \
current->fsuid = context->uid; \
current->fsgid = context->gid; \
recursive_mutex_unlock(&context->id_lock)
for pushd - the driver implementation is
https://github.com/disdi/hepunion/blob/master/fs/hepunion/hepunion.h#L393
#define push_root() \
recursive_mutex_lock(&context->id_lock); \
context->uid = current->fsuid; \
context->gid = current->fsgid; \
current->fsuid = 0; \
current->fsgid = 0
But this implementation is failing at run time.
This is the script with which I am testing this driver. All pushd and propd
are not working in this script.
After trying many other alternatives, I think overriding commits would be a
better choice. So then I would try overriding commits as the below link
http://lxr.free-electrons.com/source/fs/open.c?v=3.8#L312
Regards,
Saket Sinha
Can somebody help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130806/ec41a7d9/attachment.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Pushd and Propd issue in filesystem
2013-08-06 6:36 Pushd and Propd issue in filesystem Saket Sinha
@ 2013-08-06 14:35 ` Jonathan Neuschäfer
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Neuschäfer @ 2013-08-06 14:35 UTC (permalink / raw)
To: kernelnewbies
On Tue, Aug 06, 2013 at 12:06:52PM +0530, Saket Sinha wrote:
> I have to support pushd and popd from userspace in a filesystem that I have
> designed.
>
> In my filesystem driver, to implement it I have done the following
>
> for popd - the driver implementation is
> https://github.com/disdi/hepunion/blob/master/fs/hepunion/hepunion.h#L386
> #define pop_root() \
> current->fsuid = context->uid; \
> current->fsgid = context->gid; \
> recursive_mutex_unlock(&context->id_lock)
What you're seeing there are *not* implementations of the pushd/popd
bash commands; these just use chdir, as you can find out by running bash
under strace.
>
> for pushd - the driver implementation is
> https://github.com/disdi/hepunion/blob/master/fs/hepunion/hepunion.h#L393
> #define push_root() \
> recursive_mutex_lock(&context->id_lock); \
> context->uid = current->fsuid; \
> context->gid = current->fsgid; \
> current->fsuid = 0; \
> current->fsgid = 0
>
>
> But this implementation is failing at run time.
How is it failing?
Thanks,
Jonathan Neusch?fer
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-06 14:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-06 6:36 Pushd and Propd issue in filesystem Saket Sinha
2013-08-06 14:35 ` Jonathan Neuschäfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).