------------------------------------------------------------ revno: 13877 revision-id: squid3@treenet.co.nz-20150731201723-u3w17ln5qwyfun1w parent: squid3@treenet.co.nz-20150731201345-zng30gy70srql48l author: Unknown - Debian Project committer: Amos Jeffries branch nick: 3.5 timestamp: Fri 2015-07-31 13:17:23 -0700 message: 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. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20150731201723-u3w17ln5qwyfun1w # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: 7b19e752b10ae237e4d289cfa10f9e4559bfc43d # timestamp: 2015-07-31 20:51:06 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20150731201345-\ # zng30gy70srql48l # # Begin patch === modified file 'helpers/basic_auth/SMB/basic_smb_auth.sh' --- helpers/basic_auth/SMB/basic_smb_auth.sh 2015-07-31 20:13:45 +0000 +++ helpers/basic_auth/SMB/basic_smb_auth.sh 2015-07-31 20:17:23 +0000 @@ -64,8 +64,12 @@ [ -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 / '\\\\'`