Writing a file belonging to root

27 visualizações
Pular para a primeira mensagem não lida

David Teller

não lida,
31 de out. de 2016, 16:35:5431/10/2016
para OSXFUSE
      Hi everybody,

I am trying to write to a filesystem in which the root directory belongs to `root`. This works on other platform but fails for some reason on Mac. Can anyone help me?

Steps:

1/ Mount the virtual file system to `filesystem/` using a custom executable. The implementation of the file system is RedoxFS. I'm not the author of said executable.

2/ Check that it is mounted (succeeds)

```
$ ls -lah filesystem/
total 0
drwxr-xr-x   1 root   wheel     0B Jan  1  1970 .
drwxr-xr-x  19 david  staff   646B Oct 31 21:21 ..
```

3/ Attempt to write anything to it as myself (fails, should succeed)

```
$ touch filesystem/foo
touch: filesystem/foo: Permission denied
```

4/ Attempt to write anything to it as `root` (fails, as expected)

```
$ sudo touch filesystem/foo
Password: XXXXXXXX
touch: filesystem/foo: Operation not permitted
```

On Linux, step `3/` works as expected and step `4/` fails as expected. So what am I doing wrong?

Thanks,
 David

Sam Moffatt

não lida,
31 de out. de 2016, 21:44:1731/10/2016
para osxfus...@googlegroups.com
Hi David,

Try adding '-o allow_other' to your FS invocation. More details here: https://github.com/osxfuse/osxfuse/wiki/Mount-options

The behaviour you're seeing is that OSXFUSE blocks third party users from completing operations on the filesystem by default, including root. However the OS also enforces the permissions that the filesystem is handing back which means that only root can touch the location. Looking at the output of "ls -lah", it seems like the FS is probably not returning the correct response for the root directory given epoch date. I'd expect the FS to default to your own user for the root directory of the FS unless it's picking up the directory stat info from some other location.

Cheers,

Sam


--
You received this message because you are subscribed to the Google Groups "OSXFUSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osxfuse-group+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Teller

não lida,
2 de nov. de 2016, 02:57:4802/11/2016
para osxfus...@googlegroups.com
Thank you very much. Using `allow_root` did the trick.

Cheers,
David
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem