File: 13-preserve-explicit-port-2049.patch

package info (click to toggle)
nfs-utils 1%3A1.2.2-4squeeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,396 kB
  • ctags: 3,298
  • sloc: ansic: 31,349; sh: 10,787; python: 979; makefile: 663
file content (17 lines) | stat: -rw-r--r-- 618 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)