From b3215c1f3f2540f13545e61d7804318269a7992c Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 11 2020 22:13:16 +0000 Subject: Apply patch autofs-5.1.4-fix-NFS-version-mask-usage.patch patch_name: autofs-5.1.4-fix-NFS-version-mask-usage.patch present_in_specfile: true --- diff --git a/CHANGELOG b/CHANGELOG index 85cc370..add68aa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -23,6 +23,7 @@ xx/xx/2018 autofs-5.1.5 - tiny patch for autofs typo and possible bug. - add units After line to include statd service. - use systemd sd_notify() at startup. +- fix NFS version mask usage. 19/12/2017 autofs-5.1.4 - fix spec file url. diff --git a/include/replicated.h b/include/replicated.h index 0f482d2..95ff1f0 100644 --- a/include/replicated.h +++ b/include/replicated.h @@ -26,7 +26,9 @@ #define NFS2_SUPPORTED 0x0010 #define NFS3_SUPPORTED 0x0020 #define NFS4_SUPPORTED 0x0040 -#define NFS_VERS_MASK (NFS3_SUPPORTED) +#define NFS_VERS_DEFAULT (NFS3_SUPPORTED) +#define NFS_VERS_MASK (NFS2_SUPPORTED|NFS3_SUPPORTED) +#define NFS4_VERS_DEFAULT (NFS4_SUPPORTED) #define NFS4_VERS_MASK (NFS4_SUPPORTED) #define NFS2_REQUESTED NFS2_SUPPORTED @@ -39,6 +41,7 @@ #define UDP_REQUESTED UDP_SUPPORTED #define TCP6_REQUESTED 0x0100 #define UDP6_REQUESTED 0x0200 +#define NFS_PROTO_DEFAULT (TCP_SUPPORTED|UDP_SUPPORTED) #define NFS_PROTO_MASK (TCP_SUPPORTED|UDP_SUPPORTED) #define NFS2_TCP_SUPPORTED NFS2_SUPPORTED diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c index 4cf0cd2..426c27b 100644 --- a/modules/mount_nfs.c +++ b/modules/mount_nfs.c @@ -86,11 +86,11 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int root, name, what, fstype, options); mount_default_proto = defaults_get_mount_nfs_default_proto(); - vers = NFS_VERS_MASK | NFS_PROTO_MASK; + vers = NFS_VERS_DEFAULT | NFS_PROTO_DEFAULT; if (strcmp(fstype, "nfs4") == 0) - vers = NFS4_VERS_MASK | TCP_SUPPORTED; + vers = NFS4_VERS_DEFAULT | TCP_SUPPORTED; else if (mount_default_proto == 4) - vers = vers | NFS4_VERS_MASK; + vers = vers | NFS4_VERS_DEFAULT; /* Extract "nosymlink" pseudo-option which stops local filesystems * from being symlinked.