ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gautam Borad" <gbo...@gmail.com>
Subject Re: Review Request 40858: RANGER-758 : Handle special characters in passwords starting from -r
Date Thu, 03 Dec 2015 04:34:46 GMT


> On Dec. 2, 2015, 5:16 p.m., Madhan Neethiraj wrote:
> > jisql/src/main/java/org/apache/util/sql/Jisql.java, line 626
> > <https://reviews.apache.org/r/40858/diff/1/?file=1150127#file1150127line626>
> >
> >     Now that password/p argument is handled separately above, consider removing
"password"/"p" processing from here.

If we remove this line from here then we have to remove password/p key also from arguments
array, If we do not remove from arguments array then parser will find password/p key with
'-' and compare in accepted argument list, If password/p is not found in accepted list then
it may fail because of unknown switch. Also in parser configuration password/p is configured
as optional attribute so if password/p switch is not passed then there won't be any issue.
I would prefer to keep parser accepted list configuration as it is.


- Gautam


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40858/#review108670
-----------------------------------------------------------


On Dec. 2, 2015, 1:48 p.m., Gautam Borad wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40858/
> -----------------------------------------------------------
> 
> (Updated Dec. 2, 2015, 1:48 p.m.)
> 
> 
> Review request for ranger, Alok Lal, Don Bosco Durai, Abhay Kulkarni, Madhan Neethiraj,
Ramesh Mani, Selvamohan Neethiraj, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-758
>     https://issues.apache.org/jira/browse/RANGER-758
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> **Current Issue :**
> 
> Jisql sends argument list to jopt library to parse them according to provided keys, jopt
library assume that if argument start with '-' then its a key, Otherwise it is a value of
previous key. If password values start with '-' then jopt thinks that this is a key field,
which is not actually, Further jopt could not figure out that argument in passed keys list,
and fail to parse further assuming that provided argument list violates the contract.
> 
> **Proposed Solution:**
> If password key is found in argument list then it is assumed that password shall be in
the next argument, So I can keep a copy of password value in a String object and pass the
argument list with blank password value to jopt library. Once parsing is finished at jopt
end and parsed object is received at called jisql code location then we can continue using
actual password value which we stored earlier in the String object.
> 
> 
> Diffs
> -----
> 
>   jisql/src/main/java/org/apache/util/sql/Jisql.java cf7563c 
> 
> Diff: https://reviews.apache.org/r/40858/diff/
> 
> 
> Testing
> -------
> 
> **Steps Performed with patch:**
> a) Configured db_password=-ran*ger_$admin+ in instll.properties.
> b) Run the setup script 
> 
> **Result/Behavior:**
> Ranger installation finished without any error.
> Ranger login was working.
> 
> 
> Thanks,
> 
> Gautam Borad
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message