From mint-bounce@lists.fishpool.fi  Wed Feb 27 09:02:27 2008
X-Virus-Scanned: amavisd-new at demon.co.uk
Subject: Re: [MiNT] New MiNTlib & FreeMiNT functions
From: Alan Hourihane <alanh@fairlite.demon.co.uk>
To: Frank Naumann <fnaumann@boerde.de>
Cc: mint <mint@fishpool.com>
In-Reply-To: <alpine.LFD.1.00.0802271210100.3308@localhost.localdomain>
References: <1204031086.10574.15.camel@localhost>
	 <alpine.LFD.1.00.0802271059550.3308@localhost.localdomain>
	 <1204109510.13355.23.camel@localhost>
	 <alpine.LFD.1.00.0802271210100.3308@localhost.localdomain>
Content-Type: text/plain
Date: Wed, 27 Feb 2008 13:48:10 +0000
Message-Id: <1204120090.13355.31.camel@localhost>
Mime-Version: 1.0
X-Mailer: Evolution 2.12.2 
Content-Transfer-Encoding: 7bit
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: alanh@fairlite.demon.co.uk
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>

On Wed, 2008-02-27 at 12:57 +0100, Frank Naumann wrote:
> Hello!
> 
> >> First you must define a format that Fread() give back on an open
> >> directory. Then you need to enhance every (I think at least ext2, minix,
> >> vfat and the ramfs) xfs to support this new feature and to return this
> >> format on a Fread(). At the moment the xfs just return the on disk data (I
> >> think this is a very bad idea).
> >
> > I'll check the situation with Fread, but that should just return EISDIR
> > as reading isn't allowed. So I'll fix this.
> 
> That's the point I mean with side effects ... Fread() mainly pass through 
> to the xdd. There is no check inside any xfs read() against directories 
> ...
> 
> Btw. now I'm very curious. What's the advantage if we can open directories 
> but can't read these directories? Just for fchdir()?

Yes, but fdopendir takes an open file descriptor and hands back a DIR
structure. They are convenience functions that coreutils and findutils
take advantage of.

> > Remember, we only allow opening a directory READONLY !
> 
> Even read access may have side effects. There are a lot of code paths you 
> can apply on a filedescriptor. For example fchown, fchmod, fcntl, fselect, 
> flock, fforce, fdup and a lot, lot more. All these code paths expect until 
> now only regular files. You need to check and verify all these code paths 
> for side effects (inside kernel and maybe also inside mintlib).

Yes, absolutely. Will do for the next round of patches.

Alan.


