From: Bjarni Juliusson on
David Schwartz wrote:
> On Mar 4, 7:41 pm, Barry Margolin <bar...(a)alum.mit.edu> wrote:
>
>> These programs just display the permission mode from the inode.
>> Mounting a filesystem read-only doesn't change the file mode.
>
> The behavior for 'stat' seems reasonable to me, nothing assures that
> other system policies will result in you not getting the access that
> the permission bits suggest you should get. However, the behavior for
> 'access' seems unacceptable to me. This is especially true considering
> 'EROFS' is a documented return code from 'access'. The point of the
> 'access' call is to replicate the same checks the actual operation
> would do, so that the result from 'access' can be used in place of the
> normal access check.

The directory in question is 700. Is the uid mapped correctly, or is
there any chance you are being treated as "other" on the Windows side of
things? I guess the tests performed by stat() and access() in the client
are done locally using the apparent owner of the directory as supplied
by the network mount, but the access checks on the other end aren't
necessarily done the same way.


Bjarni
--

INFORMATION WANTS TO BE FREE
From: Barry Margolin on
In article
<d7b5e8b9-2074-49a5-82d4-e6ed64456e3a(a)o16g2000prh.googlegroups.com>,
RAHUL <rsharma.champ(a)gmail.com> wrote:

> Then is there any way to get the actual file permissions, with which
> the directory was shsared on its original computer.
> Will lstat help??

Not that I know of. Sometimes there's no way for the local system to
know, because you're mounting a network file system and there are
policies implemented on the server that restrict you.

The only real way to tell if you can do something is to try. Even if
stat() says you can or can't, something can change after you call it.

--
Barry Margolin, barmar(a)alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
From: RAHUL on
On Mar 6, 7:08 am, Barry Margolin <bar...(a)alum.mit.edu> wrote:
> In article
> <d7b5e8b9-2074-49a5-82d4-e6ed64456...(a)o16g2000prh.googlegroups.com>,
>
>  RAHUL <rsharma.ch...(a)gmail.com> wrote:
> > Then is there any way to get the actual file permissions, with which
> > the directory was shsared on its original computer.
> > Will lstat help??
>
> Not that I know of.  Sometimes there's no way for the local system to
> know, because you're mounting a network file system and there are
> policies implemented on the server that restrict you.
>
> The only real way to tell if you can do something is to try.  Even if
> stat() says you can or can't, something can change after you call it.
>
> --
> Barry Margolin, bar...(a)alum.mit.edu
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***
> *** PLEASE don't copy me on replies, I'll read them in the group ***

Yes you are correct,
I am using the same idea right now, try to write something and if it
fails that means I don't have the access :-)

Thanks