andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From 982e661b460fb2cfc9a039d29d77448f0badb885 Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Wed, 3 Jun 2015 15:02:40 -0700
Subject: [PATCH 331/333] Ticket #48148 - start/stop/restart-dirsrv utilities
 should ignore admin-serv directory

Description: coverity defect
Defect type: SHELLCHECK_WARNING
/usr/sbin/start|stop|restart-dirsrv: warning: In POSIX sh, == is not supported.
Replacing
    if [ $SERV_ID == "admin" ]; then
with
    if [ "$SERV_ID" = "admin" ] ; then

https://fedorahosted.org/389/ticket/48148
(cherry picked from commit d49ef9b91ae60799e3c497a907d22400499b33f8)
---
 ldap/admin/src/scripts/restart-dirsrv.in | 2 +-
 ldap/admin/src/scripts/start-dirsrv.in   | 2 +-
 ldap/admin/src/scripts/stop-dirsrv.in    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ldap/admin/src/scripts/restart-dirsrv.in b/ldap/admin/src/scripts/restart-dirsrv.in
index 79fc1b1..87c9581 100644
--- a/ldap/admin/src/scripts/restart-dirsrv.in
+++ b/ldap/admin/src/scripts/restart-dirsrv.in
@@ -10,7 +10,7 @@
 restart_instance() {
     SERV_ID=$1
 
-    if [ $SERV_ID == "admin" ]; then
+    if [ "$SERV_ID" = "admin" ] ; then
         #ignore admin
         return 0
     fi
diff --git a/ldap/admin/src/scripts/start-dirsrv.in b/ldap/admin/src/scripts/start-dirsrv.in
index 4e36939..32fb7fa 100755
--- a/ldap/admin/src/scripts/start-dirsrv.in
+++ b/ldap/admin/src/scripts/start-dirsrv.in
@@ -19,7 +19,7 @@ start_instance() {
     shift
 
     # source env. for this instance
-    if [ $SERV_ID == "admin" ] ; then
+    if [ "$SERV_ID" = "admin" ] ; then
         # ignore admin
         return 0 
     elif [ -f $initconfig_dir/dirsrv-$SERV_ID ] ; then
diff --git a/ldap/admin/src/scripts/stop-dirsrv.in b/ldap/admin/src/scripts/stop-dirsrv.in
index 15a84a4..8889ecc 100755
--- a/ldap/admin/src/scripts/stop-dirsrv.in
+++ b/ldap/admin/src/scripts/stop-dirsrv.in
@@ -10,7 +10,7 @@ stop_instance() {
     SERV_ID=$1
 
     # source env. for this instance
-    if [ $SERV_ID == "admin" ] ; then
+    if [ "$SERV_ID" = "admin" ] ; then
         # ignore admin
         return 0 
     elif [ -f $initconfig_dir/dirsrv-$SERV_ID ] ; then
-- 
1.9.3