Search squid archive

Re: Re: spaces with helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Luis Daniel Lucio Quiroz wrote:
Le vendredi 7 mai 2010 16:45:11, Luis Daniel Lucio Quiroz a écrit :
/usr/lib64/squid/squid_db_auth --dsn=DBI:mysql:joomla:localhost --user=root
-- table=jos15_users --usercol=username --passwdcol=password
--cond=block=0 -- plaintext --sql='select jos15_users.password from
jos15_users INNER JOIN jos15_acctexp_subscr ON jos15_users.id =
jos15_acctexp_subscr.userid WHERE (jos15_acctexp_subscr.status LIKE
"Active" OR jos15_acctexp_subscr.status LIKE "Excluded")  AND
jos15_users.username = ?'

this helper in command line works, but when writing it to squid it fails. I know it is bause i add the --sql param but i dont gethow shall i escape
that sentense to make it work inside squid

any help please?

LD
odd
this should be documented

spaces should need to be escaped \
--sql=select\ jos15_users.password\ from\ jos15_users\ INNER\ JOIN\ jos15_acctexp_subscr\ ON\ jos15_users.id\ =\ jos15_acctexp_subscr.userid\ WHERE\ \(jos15_acctexp_subscr.status\ LIKE\ \"Active\"\ OR\ jos15_acctexp_subscr.status\ LIKE\ \"Excluded\"\)\ AND\ jos15_users.username\ \=\ \?

this is how it works

Shell escaping is only needed if you use incorrect shell quoting.

Note the word shell in all the above.

double quote " for shell parameter quoting around the values passed to each parameter or they will be broken into multiple parameters.

single quote ' for SQL syntax internal quoting.

What you wrote in your first email was the same as:

squid_db_auth
 --dsn "DBI:mysql:joomla:localhost"
 --user "root"
--table "jos15_users INNER JOIN jos15_acctexp_subscr ON jos15_users.id=jos15_acctexp_subscr.userid"
 --usercol jos15_users.username
 --passwdcol jos15_users.password
--cond "(jos15_acctexp_subscr.status='Active' OR jos15_acctexp_subscr.status='Excluded') AND block=0"
 --plaintext

Amos
--
Please be using
  Current Stable Squid 2.7.STABLE9 or 3.1.3

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux