autofs-5.1.9 - Use AUTOFS_ prefixed environment variables in sample/auto.smb

From: Salvatore Bonaccorso <carnil@debian.org>

As the default value for 'force_standard_program_map_env' from
autofs.conf(5) is 'no', for a program map that uses the UID and GID
standard environment variables they are prefixed with "AUTOFS_".

To match the behaviour under default conditions of
'force_standard_program_map_env' use AUTOFS_UID and AUTOFS_GID in the
sample code for the auto.smb program map.

Link: https://bugs.debian.org/949075
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG        |    1 +
 samples/auto.smb |    6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 3dd4ce651..b3ddd8bde 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,6 +18,7 @@
 - fix get parent multi-mount check in try_remount().
 - fix deadlock in remount.
 - Remove mentioning of nonstrict option in comment in samples/auto.net.
+- Use AUTOFS_ prefixed environment variables in sample/auto.smb.
 
 02/11/2023 autofs-5.1.9
 - fix kernel mount status notification.
diff --git a/samples/auto.smb b/samples/auto.smb
index f6d41d35f..faa5a0ace 100755
--- a/samples/auto.smb
+++ b/samples/auto.smb
@@ -24,7 +24,7 @@
 
 get_krb5_cache() {
     cache=
-    uid=${UID}
+    uid=${AUTOFS_UID}
     for x in $(ls -d /run/user/$uid/krb5cc_* 2>/dev/null); do
         if [ -d "$x" ] && klist -s DIR:"$x"; then
 	    cache=DIR:$x
@@ -53,12 +53,12 @@ done
 
 creds=/etc/creds/$key
 if [ -f "$creds" ]; then
-    opts="$opts"',uid=$UID,gid=$GID,credentials='"$creds"
+    opts="$opts"',uid=${AUTOFS_UID},gid=${AUTOFS_GID},credentials='"$creds"
     smbopts="-A $creds"
 else
     get_krb5_cache
     if [ -n "$cache" ]; then
-        opts="$opts"',multiuser,cruid=$UID,sec=krb5i'
+        opts="$opts"',multiuser,cruid=${AUTOFS_UID},sec=krb5i'
         smbopts="-k"
         export KRB5CCNAME=$cache
     else
