#1076508 autofs: auto.net opts are not used for nfs verions 3

Package:
autofs
Source:
autofs
Description:
kernel-based automounter for Linux
Submitter:
Duncan Webb
Date:
2024-07-17 14:15:04 UTC
Severity:
normal
#1076508#5
Date:
2024-07-17 14:11:28 UTC
From:
To:
Dear Maintainer,

There are no options passed to automounter for NFS version 3

The reason is that the options are initialized after they are used.

In
https://salsa.debian.org/debian/autofs/-/blob/master/debian/patches/fix-nfs4-mounts-in-auto-net.patch?ref_type=heads
the opts assignment was moved from line 10 to line 58 and is below
its usage in line 52.

The fix is to move the opts before the showmount command

```
HOWMOUNT="$SMNT --no-headers -e $key"

opts="-fstype=nfs,vers=3,hard,intr,nodev,nosuid"

$SHOWMOUNT | LC_ALL=C cut -d' ' -f1 | LC_ALL=C sort -u | \
```

It would be nice to add the vers=3 into the opts. With my ancient
Synology NAS running DSM 4.2 it causes the system to crash and needs
a power cycle to recover.

Kind regards,
Duncan