[PATCH] sample/auto.smb: Use AUTOFS_ prevised environment variables

Salvatore Bonaccorso <[email protected]>
Newsgroups org.kernel.vger.autofs
Message-ID <[email protected]>
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 <[email protected]>
---
 samples/auto.smb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/samples/auto.smb b/samples/auto.smb
index f6d41d35f121..faa5a0acebc6 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
-- 
2.45.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.