From: Unknown - Debian Project <> Date: Fri, 31 Jul 2015 06:26:38 +0000 (-0700) Subject: basic_smb_auth: rejecting valid credentials X-Git-Tag: merge-candidate-3-v1~12^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f334d758ffdbd1bd981c46a8dd7c8edd80895806;p=thirdparty%2Fsquid.git basic_smb_auth: rejecting valid credentials basic_smb_auth.sh delivers the credentials via environment in a form "$USER%$PASSWORD", which is not expected from smbclient. This seem to result from an obsolete or inferior documentation of smbclient. While it is perfectly valid to deliver the credentials in this form via commandline parameter -U, for example in smbclient //domain_controller/NETLOGON -d 0 -E -W windows_domain -c "get proxyauth -" -U herrmann%mysecurepassword 2>/dev/null this form is not valid, when the credentials will be delivered via environment. Via environment the credentials must be delivered in two separate variables USER=$USER% PASSWD=$PASSWORD. --- diff --git a/helpers/basic_auth/SMB/basic_smb_auth.sh b/helpers/basic_auth/SMB/basic_smb_auth.sh index 863e941be9..6c536f2b83 100755 --- a/helpers/basic_auth/SMB/basic_smb_auth.sh +++ b/helpers/basic_auth/SMB/basic_smb_auth.sh @@ -64,8 +64,12 @@ echo "Domain controller NETBIOS name: $dcname" [ -n "$dcname" ] || exit 1 # Pass password to smbclient through environment. Not really safe. -USER="$SMBUSER%$SMBPASS" +# NOTE: this differs from what the smbclient documentation says. +# But works when the smbclient documented way does not. +USER="$SMBUSER" +PASSWD="$SMBPASS" export USER +export PASSWD # Read the contents of the file $AUTHFILE on the $AUTHSHARE share authfilebs=`echo "$AUTHFILE" | tr / '\\\\'`