Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fstab ignores allow_other #37

Closed
greerso opened this issue Nov 11, 2015 · 17 comments
Closed

fstab ignores allow_other #37

greerso opened this issue Nov 11, 2015 · 17 comments

Comments

@greerso
Copy link

greerso commented Nov 11, 2015

Here is my fstab entry:

`goofys#cpirepsarchive   /mnt/cpirepsarchive.s3 fuse    allow_other,--file-mode=0777,--dir-mode=0777,--uid="33,--gid="33",--storage-class="REDUCED_REDUNDANCY"    0       0`

Here is the strace:

`ubuntu@ip-10-0-0-27:~$ sudo strace -f mount /mnt/mountpoint >& xout
^C
ubuntu@ip-10-0-0-27:~$ grep exec xout
execve("/bin/mount", ["mount", "/mnt/mountpoint"], [/* 15 vars */]) = 0
[pid  6240] execve("/sbin/mount.fuse", ["/sbin/mount.fuse", "goofys#bucketname", "/mnt/mountpoint", "-o", "rw,allow_other,--file-mode=0777,"...], [/* 11 vars */]) = 0
[pid  6240] execve("/bin/sh", ["/bin/sh", "-c", "'goofys' 'bucketname' '/mnt/"...], [/* 12 vars */]) = 0
[pid  6241] execve("/usr/bin/goofys", ["goofys", "bucketname", "/mnt/mountpoint", "-o", "rw,allow_other,--file-mode=0777,"...], [/* 13 vars */]) = 0
[pid  6244] execve("/home/ubuntu/.gvm/pkgsets/go1.5.1/global/bin/goofys", ["/home/ubuntu/.gvm/pkgsets/go1.5."..., "bucketname", "/mnt/mountpoint", "-o", "rw,allow_other,--file-mode=0777,"...], [/* 14 vars */]) = 0
[pid  6250] execve("/bin/fusermount", ["fusermount", "-o", "default_permissions,fsname=cpire"..., "--", "/mnt/mountpoint"], [/* 16 vars */] <unfinished ...>
[pid  6250] <... execve resumed> )      = 0
[pid  6253] execve("/bin/mount", ["/bin/mount", "--no-canonicalize", "-i", "-f", "-t", "fuse", "-o", "rw,default_permissions,allow_oth"..., "bucketname", "/mnt/mountpoint"], [/* 0 vars */]) = 0`
@kahing
Copy link
Owner

kahing commented Nov 11, 2015

Wasn't it working before? What's changed?

@greerso
Copy link
Author

greerso commented Nov 11, 2015

fstab mount was never working. Once you made the fix that got it working, this new issue arose.

If I mount from command line the -o allow_other does work and has been working.

@kahing
Copy link
Owner

kahing commented Nov 11, 2015

What's the symptom? I am able to have allow_other in fstab and mount as root, and then access the files as a regular user.

@greerso
Copy link
Author

greerso commented Nov 11, 2015

I was not getting that behavior. I 'sudo mount /mnt/mountpoint' as normal user, do not receive any errors, but the mount was owned by root and I could not access.

I will try again now and reconfirm the behavior.

@greerso
Copy link
Author

greerso commented Nov 11, 2015

When I mount using fstab as stated above, the mount point is owned by root:root and although with 0777 normal user cannot create files.

@kahing
Copy link
Owner

kahing commented Nov 11, 2015

Looks like allow_other is fine but user/umask are not plumbed through correctly

@greerso
Copy link
Author

greerso commented Nov 11, 2015

I see. Is that a me thing or you?

Danny Greer
CPi Syndication
Direct Tel/Fax: (212) 500-0913

On Nov 11, 2015, at 6:19 PM, Ka-Hing Cheung notifications@github.com wrote:

Looks like allow_other is fine but user/umask are not plumbed through correctly


Reply to this email directly or view it on GitHub.

@kahing
Copy link
Owner

kahing commented Nov 11, 2015

Yes I can reproduce the problem

@kahing kahing closed this as completed in d033e1d Nov 12, 2015
@greerso
Copy link
Author

greerso commented Nov 12, 2015

I deleted the source and binary, then did go get and go install again but have the same problem. I've checked that the latest source did download.

@kahing
Copy link
Owner

kahing commented Nov 12, 2015

Did go install put goofys at the right place to be run by mount?

@greerso
Copy link
Author

greerso commented Nov 12, 2015

It doesn't but I have a symlink in /usr/bin

Danny Greer
CPi Syndication
Direct Tel/Fax: (212) 500-0913

On Nov 12, 2015, at 3:21 AM, Ka-Hing Cheung notifications@github.com wrote:

Did go install put goofys at the right place to be run by mount?


Reply to this email directly or view it on GitHub.

@kahing
Copy link
Owner

kahing commented Nov 12, 2015

I am not able to reproduce this:

$ tail -1 /etc/fstab
goofys#goofys   /tmp/mnt        fuse    allow_other,--file-mode=0777,--uid=1001 0       0
$ touch /tmp/mnt/a
$ ls -l /tmp/mnt/
-rwxrwxrwx 1 khc root         0 Nov 12 12:47 a

In another issue you mentioned that there's a copy of goofys in /bin, can you try to strace thing again and see if it's executing the correct copy?

@greerso
Copy link
Author

greerso commented Nov 12, 2015

You have the same problem. a is owned by root. try with a --uid=[other than root].

The mount will still be owned by root. I get the correct drwxrwxrwx but owner of the mount is root even though I specified the www-data:www-data account.

I can create files because of the permissions being -rwxrwxrwx but they are owned by root and not the user specified but --uid or even the current user.

I have verified that I only have one goofys binary in the filesystem anywhere and one symlink pointing to it.

@kahing
Copy link
Owner

kahing commented Nov 12, 2015

No, a is owned by khc and group is root. uid 1001 in fstab is khc.

@kahing
Copy link
Owner

kahing commented Nov 12, 2015

just verified --gid works from mount too:

$ tail -1 /etc/fstab
goofys#goofys   /tmp/mnt        fuse    allow_other,--file-mode=0777,--uid=1001,--gid=1001      0       0
$ ls -l /tmp/mnt/a
-rwxrwxrwx 1 khc khc         0 Nov 12 12:47 a

@kahing
Copy link
Owner

kahing commented Nov 12, 2015

Your fstab looks a little strange:

`goofys#cpirepsarchive   /mnt/cpirepsarchive.s3 fuse    allow_other,--file-mode=0777,--dir-mode=0777,--uid="33,--gid="33",--storage-class="REDUCED_REDUNDANCY"    0       0`

notice the extra " after --uid

@greerso
Copy link
Author

greerso commented Nov 12, 2015

Thank you! I was just examining that line in fstab looking for a typo, and could not see it staring me in the face.

It, of course works now. But I'm afraid I have found a new problem.... Try to 'touch test', then 'rm test' then if you 'touch test' again and 'ls' there is nothing. I'll create a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants