gio mount of sftp resource unexpected and inconsistent with ssh, sftp and other mounts
Recently I had the need to access the file system of my TVision HUB, a Google TV type dongle. This device runs Android, which of course is underpinned by Linux. I installed the SimpleSSH app on the device and was able to relatively quickly get the ssh and sftp features configured. At this point I created a gio mount for its file system via sftp with unexpected results.
I found that attempting to access the mounted share with File Commander, my tool of choice, yielded "Permission denied(13)" and an inability to enter the mounted share directory. After discussion with the developer of the SimpleSSH app I used ssh running logcat to determine the cause of the error message. The mounted share was referencing the root directory of the device, which as the device is not rooted was inaccessible!
I found this unexpected, as my sftp URI included the location path. So I had expected the mounted share to reference that point in the remote directory tree. From this experience I now know that the path included with the URI was ignored by the mount command.
As I noted above this is inconsistent with the behavior of other mounts as well as the ssh and sftp commands. The ssh command accesses the home directory of the associated login. The sftp command likewise accesses the home directory by default, but with a path included will access the included path. The smb mount accesses the directory specified by the defined share.
I was further confused by the output of the gio mount -i -l which shows "default_location" for the mount to be the expected directory for sftp to that device's login. This was not changed by adding a path to the URI, and the gio mount -i -l output appears the same. The gio info and gio list outputs, however, do change with the added path information. This added to my confusion.
Would it be possible to have gio mount for sftp URIs to be consistent with the ssh and sftp commands? I imagine that would entail building out the directory walk from the root to the default directory for the login or the specified path if it is included. That should ensure that the accessed directory is accessible even in a non-rooted device. Not all tools support a "blind walk" from the root to the accessible directory.
Thank you for your consideration of my issue. I will be happy to attach detailed documentation should it be needed to assess the problem, but given the availability of un-rooted Android devices I doubt this will be necessary for experimentation.