]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - debian/patches/13-preserve-explicit-port-2049.patch
mount.nfs: Preserve explicit port=2049 option (Closes: #582003)
[nfs-utils.git] / debian / patches / 13-preserve-explicit-port-2049.patch
diff --git a/debian/patches/13-preserve-explicit-port-2049.patch b/debian/patches/13-preserve-explicit-port-2049.patch
new file mode 100644 (file)
index 0000000..5d270c9
--- /dev/null
@@ -0,0 +1,17 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Subject: [PATCH] mount.nfs: Preserve any explicit port=2049 option
+
+This addresses Debian bug #582003.
+--- nfs-utils-1.2.2.orig/utils/mount/stropts.c
++++ nfs-utils-1.2.2/utils/mount/stropts.c
+@@ -434,8 +434,8 @@
+       if (po_append(options, new_option) == PO_FAILED)
+               return 0;
+-      po_remove_all(options, "port");
+-      if (nfs_pmap->pm_port != NFS_PORT) {
++      if (po_remove_all(options, "port") == PO_FOUND ||
++              nfs_pmap->pm_port != NFS_PORT) {
+               snprintf(new_option, sizeof(new_option) - 1,
+                        "port=%lu", nfs_pmap->pm_port);
+               if (po_append(options, new_option) == PO_FAILED)