]> gitweb.fluxo.info Git - puppet-samba.git/commitdiff
Proper tcl quoting for password in expect
authorTomas Edwardsson <tommi@tommi.org>
Mon, 2 Sep 2013 15:13:58 +0000 (15:13 +0000)
committerTomas Edwardsson <tommi@tommi.org>
Mon, 2 Sep 2013 15:17:21 +0000 (15:17 +0000)
See [5] Braces -  http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M9

templates/configure_active_directory.erb
templates/verify_active_directory.erb

index c860c780ddef61447a0e13146d28374db73b3372..4f9b6e0339b86b7ebd7e69bffa082c8056f6e15f 100644 (file)
@@ -125,10 +125,11 @@ for attempt in $(seq 1 $max_attempts); do
     echo "$attempt of $max_attempts:"
     ad_settle
     echo "Getting TGT for ${winbind_acct}@${my_realm}" >&2
-    $EXPECT -c spawn -noecho kinit -c $KRB5CCNAME '${winbind_acct}@${my_realm};
+    $EXPECT -c "spawn -noecho kinit -c $KRB5CCNAME ${winbind_acct}@${my_realm};
         expect :;
-        send ${password}\n;
-        expect eof'
+        send {${password}};
+        send \n;
+        expect eof"
     klist -c $KRB5CCNAME &> /dev/null && break
 done
 
index 5a2a506d16bae7478a98dd1b1ace287fc349886e..0917c4937e9347fc8d91eeab488a8f589b47828b 100644 (file)
@@ -21,7 +21,7 @@ fi
 #  } >&2
 #fi
 
-password="<%= scope.lookupvar('samba::server::ads::winbind_pass') -%>"
+password='<%= scope.lookupvar('samba::server::ads::winbind_pass') -%>'
 
 # short hostname from facter
 my_hostname="<%= hostname -%>"
@@ -62,7 +62,8 @@ get_tgt() {
   (
   $EXPECT -c "spawn -noecho kinit -c $KRB5CCNAME ${winbind_acct}@${default_realm};
        expect :;
-       send ${password}\n;
+       send {${password}};
+       send \n;
        expect eof"
   ) &> /dev/null
   klist -c $KRB5CCNAME &> /dev/null