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.

Note that this change is not yet commited in the master branch. The
change id is Ie0732b58043925d7931daa53b51d90310a6964f2.

Change-Id: I420fedffa8b7d6f3958f3dc4da4eb18e087bc036
Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com>
---
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, 37 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/62/12662/1

diff --git a/Makefile b/Makefile
index 77b9d1f..6b1d3de 100644
--- a/Makefile
+++ b/Makefile
@@ -266,6 +266,10 @@
        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
+       ln -s $(DATA_DIR)/bin/engine-encrypt-passwd.sh 
$(DESTDIR)$(BIN_DIR)/engine-encrypt-passwd
+
        # 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 f8b1481..5a64de5 100644
--- a/packaging/fedora/spec/ovirt-engine.spec.in
+++ b/packaging/fedora/spec/ovirt-engine.spec.in
@@ -610,14 +610,16 @@
 %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:
 %{_bindir}/engine-config
+%{_bindir}/engine-encrypt-passwd
 %{_bindir}/engine-manage-domains
 
 # Configuration files for the configuration tool:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I420fedffa8b7d6f3958f3dc4da4eb18e087bc036
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