GNU bug report logs - #39670
Cannot mount NFS share as user or root

Previous Next

Package: guix;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Tue, 18 Feb 2020 21:35:02 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 39670 <at> debbugs.gnu.org (full text, mbox):

From: maxim.cournoyer <at> gmail.com
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: Nathan Dehnel <ncdehnel <at> gmail.com>, 39670 <at> debbugs.gnu.org
Subject: Re: bug#39670: Cannot mount NFS share as user or root
Date: Thu, 20 Feb 2020 11:25:37 -0500
Hello,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:
>
> I encountered this too.  Perhaps we should patch some references to
> mount.nfs (from nfs-utils) in the util-linux package which provides
> 'mount'.
>
> In the meantime, you should use "mount.nfs" directly.

I've looked into patching util-linux to reference explicitly the
mount.nfs helper, and I think this should do it:

--8<---------------cut here---------------start------------->8---
modified   libmount/src/context.c
@@ -1939,8 +1939,13 @@ int mnt_context_prepare_helper(struct libmnt_context *cxt, const char *name,
 		struct stat st;
 		int rc;
 
-		rc = snprintf(helper, sizeof(helper), "%s/%s.%s",
-						path, name, type);
+		if (startswith(type, "nfs")) {
+		  rc = snprintf(helper, sizeof(helper), "/gnu/store/c7kpr1jh5z3mrkz0yw9am86851y57cq7-nfs-utils-2.4.2/sbin/mount.nfs");
+		} else {
+		  rc = snprintf(helper, sizeof(helper), "%s/%s.%s",
+				path, name, type);
+		}
+
 		path = strtok_r(NULL, ":", &p);
 
 		if (rc < 0 || (size_t) rc >= sizeof(helper))

--8<---------------cut here---------------end--------------->8---

But, adding nfs-utils to util-linux creates a dependency cycle which is
bothersome to resolve (nfs-utils requires eudev through lvm2, as well as
util-linux itself).

I've also realised that when I was using 'sudo mount.nfs ...' it
wouldn't work because it'd look up the root user's PATH for the helper.
'sudo -E mount.nfs ...' should work.

We should document that the 'nfs-utils' package needs to be added to the
operating system declaration packages field when NFS file systems are
used.

Maxim




This bug report was last modified 4 years and 217 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.