From: Keith Keller on
On 2010-03-11, Francis Moreau <francis.moro(a)gmail.com> wrote:
> On Mar 11, 2:51�pm, Jon LaBadie <jlaba...(a)aXcXm.org> wrote:
>> Francis Moreau wrote:
>> > Hello,
>>
>> > I didn't think that could happen but yes, the root user can't ls(1) a
>> > directory whereas a simple user can.
>>
>> > $ ls -ld /home/francis/.gvfs/
>> > dr-x------ 2 francis francis 0 2010-03-10 16:59 /home/francis/.gvfs
>> > $ su -
>> > $ ls /home/francis/.gvfs/
>> > ls: cannot access /home/francis/.gvfs/: Permission denied
>
> But I'm not trying to access the content of the directory (hence not
> trying to access to the remote data), I'm just try to stat the
> directory .gvfs on which something is mounted (that's why I pass '-ld'
> switches to ls(1))

You didn't pass any switches to ls after gaining root, so ls is indeed
trying to read the remote data. Try adding your switches and see if you
get the desired behaviour.

--keith

--
kkeller-usenet(a)wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information

From: Francis Moreau on
On Mar 11, 7:58 pm, Keith Keller <kkeller-use...(a)wombat.san-
francisco.ca.us> wrote:
> On 2010-03-11, Francis Moreau <francis.m...(a)gmail.com> wrote:
>
>
>
>
>
> > On Mar 11, 2:51 pm, Jon LaBadie <jlaba...(a)aXcXm.org> wrote:
> >> Francis Moreau wrote:
> >> > Hello,
>
> >> > I didn't think that could happen but yes, the root user can't ls(1) a
> >> > directory whereas a simple user can.
>
> >> > $ ls -ld /home/francis/.gvfs/
> >> > dr-x------ 2 francis francis 0 2010-03-10 16:59 /home/francis/.gvfs
> >> > $ su -
> >> > $ ls /home/francis/.gvfs/
> >> > ls: cannot access /home/francis/.gvfs/: Permission denied
>
> > But I'm not trying to access the content of the directory (hence not
> > trying to access to the remote data), I'm just try to stat the
> > directory .gvfs on which something is mounted (that's why I pass '-ld'
> > switches to ls(1))
>
> You didn't pass any switches to ls after gaining root, so ls is indeed
> trying to read the remote data.  Try adding your switches and see if you
> get the desired behaviour.
>

Sorry I probably forgot to add them when I was writing my initial
post. But I checked and ls(1) fails the same way with the switches.
From: Barry Margolin on
In article
<74384b7d-fac6-48bf-9da3-86894ecc5cd5(a)z11g2000yqz.googlegroups.com>,
Francis Moreau <francis.moro(a)gmail.com> wrote:

> But I'm not trying to access the content of the directory (hence not
> trying to access to the remote data), I'm just try to stat the
> directory .gvfs on which something is mounted (that's why I pass '-ld'
> switches to ls(1))

Stat accesses the mounted directory, not the underlying mount point.

--
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: Francis Moreau on
On Mar 12, 3:10 am, Barry Margolin <bar...(a)alum.mit.edu> wrote:
> In article
> <74384b7d-fac6-48bf-9da3-86894ecc5...(a)z11g2000yqz.googlegroups.com>,
>  Francis Moreau <francis.m...(a)gmail.com> wrote:
>
> > But I'm not trying to access the content of the directory (hence not
> > trying to access to the remote data), I'm just try to stat the
> > directory .gvfs on which something is mounted (that's why I pass '-ld'
> > switches to ls(1))
>
> Stat accesses the mounted directory, not the underlying mount point.
>

So are there any ways to stats the underlying mount point ?
From: Decare on
Francis Moreau <francis.moro(a)gmail.com> writes:

> On Mar 11, 2:51 pm, Jon LaBadie <jlaba...(a)aXcXm.org> wrote:
>> Francis Moreau wrote:
>> > Hello,
>>
>> > I didn't think that could happen but yes, the root user can't ls(1) a
>> > directory whereas a simple user can.
>>
>> > $ ls -ld /home/francis/.gvfs/
>> > dr-x------ 2 francis francis 0 2010-03-10 16:59 /home/francis/.gvfs
>> > $ su -
>> > $ ls /home/francis/.gvfs/
>> > ls: cannot access /home/francis/.gvfs/: Permission denied
>>
>> > There's something mounted on that directory:
>>
>> > $ mount | grep gvfs
>> > gvfs-fuse-daemon on /home/francis/.gvfs type fuse.gvfs-fuse-daemon
>> > (rw,nosuid,nodev,user=francis)
>>
>> > But is this the expected behaviour ?
>>
>> Yes, particularly for remotely mounted file systems (NFS etc.).
>>
>> Consider if you had root access on your laptop and mounted a
>> share from some other computer.  Should you still be root on
>> that other remote computer?  I hope not.  Thus, across remote
>> mounts the default is the remote root is just an ordinary
>> "nobody" user.  And your options show that to be the case,
>> note the "nosuid" option is in effect (no set user id).
>
> But I'm not trying to access the content of the directory (hence not
> trying to access to the remote data), I'm just try to stat the
> directory .gvfs on which something is mounted (that's why I pass '-ld'
> switches to ls(1))
>

For remote filesystem, you are an ordinary user and
r-x------
suggests that you do not have permission to read the
directory.

--
cogito ergo sum!