Package: opennebula
Version: 3.2.1-1
Severity: grave
Tags: patch

Hi,
on upgrades ~oneadmin/.one/one_auth gets overwritten unconditionally 
which makes subsequent commands fail. Attached patch fixes this.
Cheers,
 -- Guido


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (50, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From b8645f2d329828c8ef9c96f9f8d8492ec89f3e13 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <a...@sigxcpu.org>
Date: Wed, 28 Mar 2012 10:16:49 +0200
Subject: [PATCH] Don't overwrite admin password on upgrades

---
 debian/opennebula.postinst |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/debian/opennebula.postinst b/debian/opennebula.postinst
index a052ba7..b5f48f7 100644
--- a/debian/opennebula.postinst
+++ b/debian/opennebula.postinst
@@ -22,11 +22,13 @@ if [ "$1" = "configure" ]; then
             dpkg-statoverride --update --add $ONE_USER $ONE_GROUP 700 /var/lib/one/.one
     fi
 
-    ONE_PASSWORD=`apg -m 12 -M cNl -n 1`
-    if [ -n "${ONE_PASSWORD}" ]; then
-        echo "${ONE_USER}:${ONE_PASSWORD}" > $ONEAUTH
-        chown $ONE_USER:$ONE_GROUP $ONEAUTH
-        chmod 600 $ONEAUTH
+    if [ ! -f $ONEAUTH ]; then
+        ONE_PASSWORD=`apg -m 12 -M cNl -n 1`
+        if [ -n "${ONE_PASSWORD}" ]; then
+            echo "${ONE_USER}:${ONE_PASSWORD}" > $ONEAUTH
+            chown $ONE_USER:$ONE_GROUP $ONEAUTH
+            chmod 600 $ONEAUTH
+        fi
     fi
 fi
 
-- 
1.7.9.1

Reply via email to