From: Markus Klotzbuecher <mk@creamnet.de>
To: "Gautam Pagedar" <gautam@cins.unipune.ernet.in>,
<linux-kernel@vger.kernel.org>
Subject: Re: can i modify ls
Date: Wed, 25 Feb 2004 16:01:50 +0100 [thread overview]
Message-ID: <200402251601.50489.mk@creamnet.de> (raw)
In-Reply-To: <005601c3fd75$1c681510$8c01080a@crayii>
On Friday 27 February 2004 22:03, Gautam Pagedar wrote:
> working on a project to tweak the working of 'ls' command depending on my
> requirement. I have observed that 'ls' show ALL THE FILES and DIRECTORIES
> in a particular location even though a user has no access rights to it. I
> want to hide all
> such files for that particular user.
>
> The Algorithm i beleive should work like this when an 'ls' command is
> called.
>
> 1. Check the current directory.
> 2. Extract the files or directory to be displayed.
> 3. Check the user permissions for these files.
> 4. Display only those files wher user had either read, write or execute
> access for all owner,group and others.
>
> I have found out that 'ls' uses getdents64() system call for gathering the
> directory information. How do i move ahead from here.
You could do it in the kernel, by using a stackable filesystem and tweaking
the readdir file operation to do what you want. Then you can mount it on top
of the root filesystem, and all accesses will pass through it, where you hold
back the files a user shouldn't see.
On www.filesystems.org you can find bare stackable filesystem templates by
Erez Zadoc, but maybe you could even use the high level Fist language to
generate such a filesystem.
Just an idea...
Cheers
Markus
next prev parent reply other threads:[~2004-02-25 14:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-27 21:03 can i modify ls Gautam Pagedar
2004-02-24 11:10 ` Erik Mouw
2004-02-24 15:55 ` Alessandro Salvatori
2004-02-24 16:35 ` Tomas Szepe
2004-02-24 16:44 ` Richard B. Johnson
2004-02-24 16:59 ` Tomas Szepe
2004-02-24 18:44 ` Richard B. Johnson
2004-02-26 20:56 ` Denis Vlasenko
2004-02-25 15:01 ` Markus Klotzbuecher [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-02-24 15:04 James Lamanna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200402251601.50489.mk@creamnet.de \
--to=mk@creamnet.de \
--cc=gautam@cins.unipune.ernet.in \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox