* short version of the problem:
Although files or directory permissions are set to 755 it is possible to delete files or directories as a non-owner when having access to a ZFS FreeBSD 9.1 server via sftp/sshfs.
* long version:
For testing purposes I am running a fresh and raw FreeBSD 9.1 AMD64 as file server (no ports, but latest updates installed, no Internet connection). The only network service running is sshd. The FreeBSD ZFS file system is accessed from a Fedora 19 client via sshfs (shell login disabled, remote users isolated into a single common group created for this purpose).
Then a file/directory (owner root:wheel, permissions set to 755) is created via root shell login.
As expected:
After that when accessing this file/directory via Fedora sshfs as remote user nonroot:nonwheel reading is possible, writing to the file/directory is impossible. The same is true with local shell login.
If using a shell login to delete this file/directory as user nonroot:nonwheel it is impossible too.
Unexpected Behaviour:
But deleting the file/directory as nonroot:nonwheel via sftp/sshfs is reproducibly possible without any problem!
One can use any other user1:group1 user2:group2 combination to test this behaviour. Of course group1 is the only group user1 belongs to and group2 is the only group user2 belongs to.
Do I miss an essential aspect or is this a very big bug?
Thank you in advance for any comments.
Bernd
Although files or directory permissions are set to 755 it is possible to delete files or directories as a non-owner when having access to a ZFS FreeBSD 9.1 server via sftp/sshfs.
* long version:
For testing purposes I am running a fresh and raw FreeBSD 9.1 AMD64 as file server (no ports, but latest updates installed, no Internet connection). The only network service running is sshd. The FreeBSD ZFS file system is accessed from a Fedora 19 client via sshfs (shell login disabled, remote users isolated into a single common group created for this purpose).
Then a file/directory (owner root:wheel, permissions set to 755) is created via root shell login.
As expected:
After that when accessing this file/directory via Fedora sshfs as remote user nonroot:nonwheel reading is possible, writing to the file/directory is impossible. The same is true with local shell login.
If using a shell login to delete this file/directory as user nonroot:nonwheel it is impossible too.
Unexpected Behaviour:
But deleting the file/directory as nonroot:nonwheel via sftp/sshfs is reproducibly possible without any problem!
One can use any other user1:group1 user2:group2 combination to test this behaviour. Of course group1 is the only group user1 belongs to and group2 is the only group user2 belongs to.
Do I miss an essential aspect or is this a very big bug?
Thank you in advance for any comments.
Bernd