----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/54937/#review159957 -----------------------------------------------------------
Ship it! Ship It! - Colm O hEigeartaigh On Dec. 22, 2016, 1:25 a.m., Qiang Zhang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/54937/ > ----------------------------------------------------------- > > (Updated Dec. 22, 2016, 1:25 a.m.) > > > Review request for ranger, Don Bosco Durai, Madhan Reddy, Ramesh Mani, and > Velmurugan Periasamy. > > > Bugs: RANGER-1275 > https://issues.apache.org/jira/browse/RANGER-1275 > > > Repository: ranger > > > Description > ------- > > At the beginning of the security-admin/scripts/setup.sh file there are three > logical errors. > 1. The logic to judgment if the install.properties file exists is wrong . The > reason for the error is that the author doesn't understand the meaning of the > "$?" correctly in shell script. > 2. The "/var/run/ranger" path is very important. So the program should > determine whether the directory has been created successfully. > 3. The following error occurred if the 'log "$PROPFILE file not > found....!!";' could be executed. > ./setup.sh: line 27: log: command not found > =========================================================== > Code error analysis is as follow: > 1. code > PROPFILE=$PWD/install.properties > pidFolderName='/var/run/ranger' > mkdir -p ${pidFolderName} > propertyValue='' > if [ ! $? = "0" ];then > log "$PROPFILE file not found....!!"; > exit 1; > fi > 2. analysis > 1). The "$?" is the result value of the "propertyValue=''" in (if [ ! $? = > "0" ];then). So the (! $? = "0") expression is always equal to false, the > (log "$PROPFILE file not found....!!") code always can't be executed. > 2). The log function should be declared before execute. So the following > error occurred when execute the (log "$PROPFILE file not found....!!") code. > ./setup.sh: line 27: log: command not found > =========================================================== > Reproducible Steps? > ------------------------------------------------------------------------------- > 1. Run "mv install.properties install.properties.bak" command. > 2. Run setup.sh. > Result: > The following statements will not be executed. > log "$PROPFILE file not found....!!"; > exit 1; > --------------------------------------------------------------------------------------- > 1. Comment out the line 26 and 29 lines and add "exit 0" at the 30 line in > the security-admin/scripts/setup.sh file. > 2. Run setup.sh. > Result. > ./setup.sh: line 27: log: command not found > > > Diffs > ----- > > security-admin/scripts/setup.sh 2ec26f7 > > Diff: https://reviews.apache.org/r/54937/diff/ > > > Testing > ------- > > > Thanks, > > Qiang Zhang > >
