From jrh29 at alumni.cwru.edu Sat Oct 29 00:12:07 2005 From: jrh29 at alumni.cwru.edu (Justin Hibbits) Date: Sat, 29 Oct 2005 00:12:07 -0400 Subject: System calls Message-ID: <200510290012.15268.jrh29@alumni.cwru.edu> Let's try another list, since this one is about LSD's API. Does stat() take only a file descriptor, since Adam said that open() is the only call that takes a path? Or does it follow what's listed in Headers/private/lsd.h, and have the option of path or file descriptor? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available URL: From jrh29 at alumni.cwru.edu Sun Oct 30 11:46:49 2005 From: jrh29 at alumni.cwru.edu (Justin Hibbits) Date: Sun, 30 Oct 2005 12:46:49 -0400 Subject: stat() Message-ID: <200510301146.55193.jrh29@alumni.cwru.edu> I found a problem with requiring stat() to use a file descriptor. open() only allows the given modes of access. However, you don't need read/write/execute/delete/append or whatever permissions in order to stat a file in *NIX, and that would cause some problems if someone were to try to stat a file they have no permission to in a directory they can read. We should rethink this. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available URL: From adam at fsl.cs.sunysb.edu Sun Oct 30 16:32:43 2005 From: adam at fsl.cs.sunysb.edu (Adam Martin) Date: Sun, 30 Oct 2005 16:32:43 -0500 Subject: [lsd-devel] stat() In-Reply-To: <200510301146.55193.jrh29@alumni.cwru.edu> References: <200510301146.55193.jrh29@alumni.cwru.edu> Message-ID: <53ef9b65b9a32272d38214dcfd7edfd5@fsl.cs.sunysb.edu> On 2005 Oct 30 , at 11:46, Justin Hibbits wrote: > I found a problem with requiring stat() to use a file descriptor. > > open() only allows the given modes of access. However, you don't need > read/write/execute/delete/append or whatever permissions in order to > stat a > file in *NIX, and that would cause some problems if someone were to > try to > stat a file they have no permission to in a directory they can read. > > We should rethink this. > You wouldn't need read support for a stat. Just opening with NULL permissions would be sufficient for a stat. Open() in LSD associates an fd with an actual file, and permissions to do stuff. As long as you know the file exists, and can stat it under *NIX conditions (As a baseline), you can open with NO permissions, and stat that fd. -- Adam David Alan Martin