From mboxrd@z Thu Jan 1 00:00:00 1970 From: j.neuschaefer@gmx.net (Jonathan =?utf-8?Q?Neusch=C3=A4fer?=) Date: Tue, 6 Aug 2013 16:35:29 +0200 Subject: Pushd and Propd issue in filesystem In-Reply-To: References: Message-ID: <20130806143529.GA3007@debian.debian> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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