Bug 309113 - connecting to nfs share like nfs://<IP/hostname>/<path> gives Authorization failed, <IP/hostname> authentication not supported
Summary: connecting to nfs share like nfs://<IP/hostname>/<path> gives Authorization f...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: nfs (show other bugs)
Version: 4.9.2
Platform: Mageia RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-27 19:45 UTC by fathom
Modified: 2014-10-23 21:28 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fathom 2012-10-27 19:45:35 UTC
Trying to connect to an NFS share (without password, absolutely open NFS shares) with Krusader/Dolphin/Konqueror (anything that uses KIO-nfs) I got the error message in the summary. The authentication type is always what the IP/hostname.
Using latest Mageia cauldron.

Reproducible: Always

Steps to Reproduce:
1.Use KIO-nfs to connect to an NFS share
2.See error msg in description
Actual Results:  
No connection made to the NFS server

Expected Results:  
Usable connection to NFS server
Comment 1 fathom 2012-11-22 07:38:46 UTC
Any info you need to addres the issue? Anyone actually checking this bug?
Comment 2 fathom 2012-12-18 19:23:35 UTC
It has been submitted a month ago, anyone has read this???
Comment 3 Christoph Feck 2012-12-20 20:54:02 UTC
We do read bug reports, but we need an actual developer who understands KIO and NFS well enough to check the code. If you can help with that task, please add a comment.
Comment 4 fathom 2012-12-20 21:17:42 UTC
Hello,

Sadly I am not good enough in KIO programming (Though I have tried to read to sources). Anyway if I could I would be happy to do that:) 
I am sorry that I had been rude, but I thought KIO is something you have someone in charge of.
Comment 5 Kete Tefid 2013-04-01 11:33:51 UTC
Confirmed here. With kde 4.9.3.
The same error message.
It took me half a day to understand that this is kde related. I was wandering until I found that mounting through command line works fine but does not work through kde/dolphin.
Comment 6 Kete Tefid 2013-04-01 11:35:19 UTC
I am on Gentoo. Sorry that I forgot to mention earlier.
Comment 7 Mike Robinson 2013-09-19 21:39:08 UTC
Confirmed KDE 4.10.5. Trying to set up nfs I thought it was a problem with the config, but it's a KDE problem. I can mount just fine by command line.
Comment 8 Thomas Lübking 2014-09-12 14:06:40 UTC
this is likely bug #75757, the server needs to export with the "insecure" falg, because kio operates on ports > 1024

I however run into bug #268797 now =)
Comment 9 Mathias Tillman 2014-09-20 21:10:52 UTC
Are you able to connect to the server when running dolphin as superuser (through kdesudo)? If so, it is indeed because the export doesn't have the insecure flag.
Comment 10 Thomas Lübking 2014-09-20 22:15:44 UTC
yupp.
You don't happen to have an idea on  bug #268797, do you?
There should be some debug out from the kioslave, but even redirecting to file I don't get any.
Comment 11 Mathias Tillman 2014-09-20 22:27:43 UTC
I'm currently in the process of adding NFSv3 support and also rewriting and optimising a lot of the code (it's quite bad). I will have a look and see if I can reproduce that problem :)
Comment 12 Mathias Tillman 2014-09-20 23:42:58 UTC
Okay, I just had a look, and I can reproduce it on my new NFSv3 implementation. The good news is that I have solved it already :)
Ultimately it was caused by too big buffers being sent to the server when you were sending a big file (which is why smaller files worked). However, v3 has a new call that allows you to retrieve the maximum buffer size so unlike v2 we shouldn't be using a static max buffer size.
Comment 13 fathom 2014-09-21 09:03:27 UTC
(In reply to Thomas Lübking from comment #8)
> this is likely bug #75757, the server needs to export with the "insecure"
> falg, because kio operates on ports > 1024
> 
> I however run into bug #268797 now =)

This does not make sense to me, KIO should provide support to connect an NFS share even if it's under port 1024. For example it could ask for a root password (or sudo, or whatever). But this is just an opinion.
Comment 14 fathom 2014-09-21 09:04:52 UTC
Also, I have tried out insecure (and  got the very same error msg back).
The same happens with root privileges.
Comment 15 Thomas Lübking 2014-09-21 10:39:27 UTC
(In reply to fathom from comment #13)

> This does not make sense to me
This actually makes a lot of sense (while i kinda fail to see the sense in NFS requiring a <1024 port by default)

> KIO should provide support to connect an NFS share even if it's under port 1024.
Can't if the server forbids and you lack permissions.

> For example it could ask for a root password (or sudo, or whatever).
Yes, but that has nothing to do with "sense" in regards of the issue but is a reasonable solution (for most nfs servers won't export insecure)
I assume the pitfall here would be that the kioslave architecture (likely) doesn't include any subprocess to leverage. If it did, one could just suid that.

(In reply to fathom from comment #14)
> Also, I have tried out insecure (and  got the very same error msg back).
How did you re-export the filesystem on the server?

> The same happens with root privileges.
I can absolutely not confirm that.
Can you mount those nfs addresses at all?
Comment 16 fathom 2014-09-21 12:49:11 UTC
Hi,

Here is how the exports look:
/mnt/mirror     192.168.1.0/255.255.255.0(rw,anonuid=500,anongid=500,all_squash,insecure,async,no_subtree_check)
/mnt/store      192.168.1.0/255.255.255.0(rw,anonuid=500,anongid=500,all_squash,insecure,async,no_subtree_check)

Yes, it works through any other mechanism, I am regularly using it through autofs. Also it works in userspace for example with nautilus (or how gnome's filebrowser called).
Comment 17 Mathias Tillman 2014-09-21 14:53:54 UTC
(In reply to fathom from comment #14)
> Also, I have tried out insecure (and  got the very same error msg back).
> The same happens with root privileges.

If you can't access it even with root privileges I suspect something else is the problem here. I will see if I can reproduce it later using your export options.
Comment 18 Thomas Lübking 2014-09-21 18:22:39 UTC
ftr:
those flags seem no problem here (wasn't squashing, did fsid=root, that means NFSv4, yes) - at least reg. this error message.
I get the one of bug #268797 the moment I attempt to open the exported directory.
Comment 19 Mathias Tillman 2014-09-21 18:24:48 UTC
Okay, so I've tried to reproduce this without any luck. I do know that it's the MOUNTPROC_MNT call that fails, but since there is no debug output in the code that tells you what the call returns it's difficult to say what the reason could be (it could be something other than an actual authentication error, this needs to be fixed to output the actual result).
Does the nfs server output anything when you try to browse the nfs share? It should say something along the lines of: "Authenticated mount request from IP for MOUNTPATH".
Comment 20 Mathias Tillman 2014-09-21 18:50:27 UTC
@fathom: What is the ip address of the client and the server? I was able to reproduce this by typing another ip/netmask in the exports file.
Comment 21 fathom 2014-09-21 19:43:29 UTC
Hi,

The NFS server says this:
szept 21 21:32:58 ami unfsd[1439]: 192.168.1.198 attempted mount with unsupported protocol version

The clients are between 192.168.1.50 and 250 (this is the DHCP range on the local LAN), and the server is 183 at the end. 

What do you mean by typing other ip/netmask?
Comment 22 Mathias Tillman 2014-09-21 20:30:09 UTC
Aha, you seem to be using unfs3, which only supports NFSv3 (I think most NFS servers are backwards compatible, even though the protocol is not). The kio module as of right now is only compatible with an NFSv2 server.
I am able to reproduce this using that server, but like I said above I have almost finished implementing v3 support in the kio module, and I can confirm that unfs3 works fine now.
Comment 23 fathom 2014-09-22 06:18:29 UTC
That's woinderful, I hope it will be pushed to mageia also soon:) Thanks!
Comment 24 Mathias Tillman 2014-10-16 10:18:23 UTC
Git commit 1f13cf8b4c5ff5ac6a2c131a89c19c7e77c0194f by Mathias Tillman.
Committed on 16/10/2014 at 10:15.
Pushed by mathiastillman into branch 'master'.

Added support for NFSv3, major refactoring, fixed bugs.

REVIEW: 120343
Related: bug 268797

M  +1    -1    nfs/CMakeLists.txt
M  +2    -2    nfs/README
M  +0    -2    nfs/TODO
M  +576  -1324 nfs/kio_nfs.cpp
M  +169  -69   nfs/kio_nfs.h
D  +0    -353  nfs/mount_xdr.c
M  +4    -0    nfs/nfs.protocol
D  +0    -699  nfs/nfs_prot.h
D  +0    -886  nfs/nfs_prot_xdr.c
A  +1858 -0    nfs/nfsv2.cpp     [License: LGPL (v2+)]
A  +103  -0    nfs/nfsv2.h     [License: LGPL (v2+)]
A  +2195 -0    nfs/nfsv3.cpp     [License: LGPL (v2+)]
A  +114  -0    nfs/nfsv3.h     [License: LGPL (v2+)]
R  +71   -158  nfs/rpc_mnt2.h [from: nfs/mount.h - 051% similarity]
R  +0    -0    nfs/rpc_mnt2.x [from: nfs/mount.x - 100% similarity]
A  +277  -0    nfs/rpc_mnt2_xdr.c     [License: UNKNOWN]  *
A  +168  -0    nfs/rpc_mnt3.h     [License: UNKNOWN]  *
A  +147  -0    nfs/rpc_mnt3_xdr.c     [License: UNKNOWN]  *
A  +488  -0    nfs/rpc_nfs2_prot.h     [License: UNKNOWN]  *
R  +0    -0    nfs/rpc_nfs2_prot.x [from: nfs/nfs_prot.x - 100% similarity]
A  +699  -0    nfs/rpc_nfs2_prot_xdr.c     [License: UNKNOWN]  *
A  +1330 -0    nfs/rpc_nfs3_prot.h     [License: UNKNOWN]  *
A  +908  -0    nfs/rpc_nfs3_prot.x
A  +1908 -0    nfs/rpc_nfs3_prot_xdr.c     [License: UNKNOWN]  *

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/kio-extras/1f13cf8b4c5ff5ac6a2c131a89c19c7e77c0194f
Comment 25 Kete Tefid 2014-10-17 07:48:16 UTC
Hello,
Thank you very much for your nice efforts. Can this fix be implemented in the current kde4 through a patch? Or it would be only for kde5?  I wanted to report this to the Gentoo bugs and request them to include this fix in their portage. Would it be possible?
Comment 26 Mathias Tillman 2014-10-17 08:02:47 UTC
I will have a look at backporting it to KDE4, but I can't promise anything.
Comment 27 Mathias Tillman 2014-10-23 18:45:31 UTC
@Kete, I've submitted a review request for KDE4 here: https://git.reviewboard.kde.org/r/120761/
Comment 28 Kete Tefid 2014-10-23 21:28:12 UTC
Thank you so much!