Juan Hernandez has uploaded a new change for review.

Change subject: packaging: Move passwd encryption script to tools
......................................................................

packaging: Move passwd encryption script to tools

This script used to be in the PKI directory, but it is a tool used
outside of the PKI environment, so it is better placed in the bin
directory and owned by the tools package.

Change-Id: Iafde9090b17dcc3ddf56de6b5117806870eeb855
Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com>
(cherry picked from commit cdab98683d8e5eb63a58fc7ca4d92b7ce2b1937f)
---
M Makefile
D backend/manager/conf/ca/encryptpasswd.sh
A backend/manager/tools/src/main/shell/engine-encrypt-passwd.sh
M packaging/fedora/setup/basedefs.py
M packaging/fedora/spec/ovirt-engine.spec.in
5 files changed, 35 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/61/12861/1

diff --git a/Makefile b/Makefile
index 77b9d1f..0204d5c 100644
--- a/Makefile
+++ b/Makefile
@@ -266,6 +266,9 @@
        install -m 644 packaging/fedora/setup/post_upgrade.py 
$(DESTDIR)$(DATA_DIR)/scripts
        install -m 644 
packaging/fedora/setup/add_fn_db_get_async_tasks_function.sql 
$(DESTDIR)$(DATA_DIR)/scripts
 
+       # Script to encrypt passwords:
+       install -m 750 
backend/manager/tools/src/main/shell/engine-encrypt-passwd.sh 
$(DESTDIR)$(DATA_DIR)/bin
+
        # Install man pages
        install -dm 755 $(DESTDIR)$(MAN_DIR)/man8
        install -m 644 packaging/engine-setup.8 $(DESTDIR)$(MAN_DIR)/man8/
diff --git a/backend/manager/conf/ca/encryptpasswd.sh 
b/backend/manager/conf/ca/encryptpasswd.sh
deleted file mode 100644
index 29db117..0000000
--- a/backend/manager/conf/ca/encryptpasswd.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh 
-die () {
-    printf >&2 "$@"
-    exit 1
-}
-
-
-
-usage () {
-       printf "encryptpasswd.sh - Generate a an encrypted password from the 
plain-text password given.\n"
-       printf "Usage: \n"
-       printf "encryptpasswd [Plain-Text-Password]\n"
-       printf "Where:\n"
-       printf "Plain-Text-Password = The password to encrypt in plain text.\n"
-       return 0
-}
-
-if [ ! "$#" -eq 1 ]; then
-    usage
-    die "Error: wrong argument number: $#.\n"
-fi
-
-
-JAVA_BIN=java
-if [[ "x${JAVA_HOME}" != "x" ]] ;then
-    JAVA_BIN=$JAVA_HOME/bin/java
-fi
-
-
-pushd  $JBOSS_HOME
-#if [ -e "common/lib/jbosssx.jar" ]; then
-#    $JAVA_BIN -cp client/jboss-logging-spi.jar:common/lib/jbosssx.jar 
org.jboss.resource.security.SecureIdentityLoginModule $1
-#elif [ -e "lib/jbosssx.jar" ]; then
-#      $JAVA_BIN -cp client/jboss-logging-spi.jar:lib/jbosssx.jar 
org.jboss.resource.security.SecureIdentityLoginModule $1
-#else
-#        echo "unable to find jbosssx jar..."
-#        exit 1
-#fi
-
-$JAVA_BIN -cp `build-classpath jboss-logging picketbox/picketbox` 
org.picketbox.datasource.security.SecureIdentityLoginModule "$1"
-
-popd
-
-exit $?
diff --git a/backend/manager/tools/src/main/shell/engine-encrypt-passwd.sh 
b/backend/manager/tools/src/main/shell/engine-encrypt-passwd.sh
new file mode 100644
index 0000000..c1605db
--- /dev/null
+++ b/backend/manager/tools/src/main/shell/engine-encrypt-passwd.sh
@@ -0,0 +1,29 @@
+#!/bin/sh 
+
+# Load the prolog:
+. "$(dirname "$(readlink -f "$0")")"/engine-prolog.sh
+
+die () {
+    printf >&2 "$@"
+    exit 1
+}
+
+usage () {
+        printf "engine-encrypt-passwd.sh - Generate a an encrypted password 
from the plain-text password given.\n"
+        printf "Usage: \n"
+        printf "engine-encrypt-passwd.sh [Plain-Text-Password]\n"
+        printf "Where:\n"
+        printf "Plain-Text-Password = The password to encrypt in plain text.\n"
+        return 0
+}
+
+if [ ! "$#" -eq 1 ]; then
+    usage
+    die "Error: wrong argument number: $#.\n"
+fi
+
+exec "${JAVA_HOME}/bin/java" \
+  -jar "${JBOSS_HOME}/jboss-modules.jar" \
+  -dependencies org.picketbox \
+  -class org.picketbox.datasource.security.SecureIdentityLoginModule \
+  "$@"
diff --git a/packaging/fedora/setup/basedefs.py 
b/packaging/fedora/setup/basedefs.py
index 9db89c4..6822183 100644
--- a/packaging/fedora/setup/basedefs.py
+++ b/packaging/fedora/setup/basedefs.py
@@ -140,7 +140,7 @@
 EXEC_SERVICE="/sbin/service"
 EXEC_CHKCONFIG="/sbin/chkconfig"
 EXEC_LSOF="/usr/sbin/lsof"
-EXEC_ENCRYPT_PASS="%s/encryptpasswd.sh"%(DIR_OVIRT_PKI)
+EXEC_ENCRYPT_PASS="%s/ovirt-engine/bin/engine-encrypt-passwd.sh" % 
DIR_USR_SHARE
 EXEC_RPM="/bin/rpm"
 EXEC_FREE="/usr/bin/free"
 EXEC_DF = "/bin/df"
diff --git a/packaging/fedora/spec/ovirt-engine.spec.in 
b/packaging/fedora/spec/ovirt-engine.spec.in
index 45d8bf6..d8c77af 100644
--- a/packaging/fedora/spec/ovirt-engine.spec.in
+++ b/packaging/fedora/spec/ovirt-engine.spec.in
@@ -609,10 +609,11 @@
 %files tools
 
 # Scripts:
-%{engine_data}/bin/engine-prolog.sh
 %{engine_data}/bin/engine-config.sh
+%{engine_data}/bin/engine-encrypt-passwd.sh
 %{engine_data}/bin/engine-manage-domains.sh
 %{engine_data}/bin/engine-notifier.sh
+%{engine_data}/bin/engine-prolog.sh
 %{_initddir}/engine-notifierd
 
 # Links to the scripts:


--
To view, visit http://gerrit.ovirt.org/12861
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafde9090b17dcc3ddf56de6b5117806870eeb855
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: engine_3.2
Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to