From: Ben Hutchings Date: Wed, 14 Sep 2011 17:25:19 +0000 (-0400) Subject: mount.nfs: Preserve any explicit port=2049 option X-Git-Tag: debian/1%1.2.5-1~11^2~18 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=9069ff05d0b94d250cfe0a722bee97154490730e;p=nfs-utils.git mount.nfs: Preserve any explicit port=2049 option If NFS port (2049) is supplied explicitly, don't ignore this setting by requesting it to portmapper again. Signed-off-by: Luk Claes Signed-off-by: Steve Dickson --- diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 7a2edab..314a806 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -437,8 +437,8 @@ static int nfs_construct_new_options(struct mount_options *options, 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)