Copilot commented on code in PR #808:
URL: https://github.com/apache/ranger/pull/808#discussion_r2697698197


##########
dev-support/ranger-docker/scripts/zk/ranger-zk.sh:
##########
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+if [ "${KERBEROS_ENABLED}" == "true" ]
+then
+  /home/ranger/scripts/wait_for_keytab.sh zookeeper.keytab
+  export 
SERVER_JVMFLAGS="-Djava.security.auth.login.config=/etc/zookeeper/jaas.conf 
-Dzookeeper.sasl.client=false ${SERVER_JVMFLAGS}"
+fi
+
+/home/ranger/scripts/ranger-zk-entrypoint.sh $*

Review Comment:
   The use of `$*` passes all arguments as a single word. Use `"$@"` instead to 
properly preserve argument boundaries and handle arguments containing spaces 
correctly.
   ```suggestion
   /home/ranger/scripts/ranger-zk-entrypoint.sh "$@"
   ```



##########
dev-support/ranger-docker/scripts/zk/ranger-zk-entrypoint.sh:
##########
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# This is a copy of /docker-entrypoint.sh from zookeeper docker image, 
customized to
+# update zoo.cfg for Kerberos authentication (lines between marker RANGER 
below).
+#
+
+set -e
+
+# Allow the container to be started with `--user`
+if [[ "$1" = 'zkServer.sh' && "$(id -u)" = '0' ]]; then

Review Comment:
   Use `==` instead of `=` for string comparison in `[[ ]]` conditional 
expressions for consistency with bash best practices, even though both work.
   ```suggestion
   if [[ "$1" == 'zkServer.sh' && "$(id -u)" == '0' ]]; then
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to