Using paths in share names

Moderators: Gully, peteru

Post Reply
prl
Wizard God
Posts: 32706
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Using paths in share names

Post by prl » Sun Mar 21, 2021 14:50

I have a Fritz!Box 7590 router that has SMBv3 capability, but very limited configurability.

It exports everything via a single share name (default FRITZ.NAS), but allows access control for individual users.

I want to just export saved recordings from its attached HDD, and I can do that by setting up the relevant user permissions on the 7590, and then use something like FRITZ.NAS/Movies as the Server share for configuration. That works to allow the share to be mounted.

However, whenever the NetworkBrowser wants to match a mount entry (as represented by the <cifs/> elements in /etc/enigma2/automounts.xml) against a share (e.g. in MENU>Setup>Network>NetworkBrowser, OK on a share), it compares the share name in automounts.xml (FRITZ.NAS/Movies) with the share name returned by smbclient (FRITZ.NAS) and fails.

That means that the share always shows up in NetworkBrowser as having not been mounted when it is mounted, and when I try to edit it in the network browser, it resets all the fields to their defaults, rather than what I've configured it to.

The tests between the share name from smb and the sharedir field automounts.xml are also inconsistent. In come cases it's smbShareName.endswith(sharedata['sharedir']), and in others it's sharedata['sharedir'] in smbShareName. The smbShareName isn't literally in the code, it's just to make the test clearer here. The actual tests can be found by searching for the string 'sharedir'.

These tests would work in my case if, in some sense, they are reversed, to be more like:
sharedata['sharedir'].startswith( smbShareName)
or
smbShareName in sharedata['sharedir']
The first form is more specific, and probably better, though something like
smbShareName == sharedata['sharedir'].split('/', 1)[0]
would probably be even better.

I think that would solve my problems with share naming, but would it be likely to break anything else?
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32706
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Using paths in share names

Post by prl » Mon Mar 22, 2021 15:05

The handling of NFS share names in NetworkBrowser is also strange.

One place that's odd is that in /etc/auto.network it looks as though it would write NFS entries in a form like:

Code: Select all

localShareName -fstype=nfs,rw,nolock,tcp,nfsvers=3,rsize=8192,wsize=8192,proto=tcp,timeo=14,soft 11.22.33.44://exported/path
rather than the last field just being 11.22.33.44:/exported/path.

I don't think that it's an error, but it's untidy.

Any NFS share users there than can confirm that? It will also confirm some other things I thing are correct about NFS share names (and that I think are a bit weird about how they're handled in NetworkBrowser.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: Using paths in share names

Post by MrQuade » Mon Mar 22, 2021 15:24

prl wrote:
Mon Mar 22, 2021 15:05
One place that's odd is that in /etc/auto.network it looks as though it would write NFS entries in a form like:

Code: Select all

localShareName -fstype=nfs,rw,nolock,tcp,nfsvers=3,rsize=8192,wsize=8192,proto=tcp,timeo=14,soft 11.22.33.44://exported/path
rather than the last field just being 11.22.33.44:/exported/path.

I don't think that it's an error, but it's untidy.

Any NFS share users there than can confirm that? It will also confirm some other things I thing are correct about NFS share names (and that I think are a bit weird about how they're handled in NetworkBrowser.
The last field in my nfs share is just <ipaddress>:/<exported path> (single slash before the path which is just the sharename since I mount the root directory of the share)
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

prl
Wizard God
Posts: 32706
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Using paths in share names

Post by prl » Mon Mar 22, 2021 15:26

Thanks MrQuade.

Could you post the output of:
showmount -e address_of_your_nfs_server

I can't see how, given the code, the slashes aren't doubled, but perhaps I'm missing something.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32706
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Using paths in share names

Post by prl » Mon Mar 22, 2021 15:32

Could you also post the contents of the /etc/enigma2/automounts.xml entry for the mount? Anonymise IP address and any username/password fields (though NFS entries shouldn't have the latter).
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32706
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Using paths in share names

Post by prl » Mon Mar 22, 2021 15:43

Does NFS server work on any boxes with the current beta (20210119)? Then I can maybe answer some of these questions myself :)
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
MrQuade
Uber Wizard
Posts: 11844
Joined: Sun Jun 24, 2007 13:40
Location: Perth

Re: Using paths in share names

Post by MrQuade » Mon Mar 22, 2021 15:45

prl wrote:
Mon Mar 22, 2021 15:43
Does NFS server work on any boxes with the current beta (20210119)? Then I can maybe answer some of these questions myself :)
Yep, it works on the V2.

Just need to make an exports file and turn on the NFS service.
Logitech Harmony Ultimate+Elite RCs
Beyonwiz T2/3/U4/V2, DP-S1 PVRs
Denon AVR-X3400h, LG OLED65C7T TV
QNAP TS-410 NAS, Centos File Server (Hosted under KVM)
Ubiquiti UniFi Managed LAN/WLAN, Draytek Vigor130/Asus RT-AC86U Internet
Pixel 4,5&6, iPad 3 Mobile Devices

prl
Wizard God
Posts: 32706
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Using paths in share names

Post by prl » Mon Mar 22, 2021 16:42

I found the place where the leading '/' in the NFS export filename is stripped off.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Post Reply

Return to “Developers Community”