From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH/RFC storage 1/3] postinst: move cifs credential files into subdirectory upon update
Date: Fri, 4 Jun 2021 15:49:31 +0200 [thread overview]
Message-ID: <20210604134946.152720-8-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210604134946.152720-1-f.ebner@proxmox.com>
and drop the compat code.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
PVE/Storage/CIFSPlugin.pm | 3 ---
debian/postinst | 30 ++++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 3 deletions(-)
create mode 100644 debian/postinst
diff --git a/PVE/Storage/CIFSPlugin.pm b/PVE/Storage/CIFSPlugin.pm
index be06cc7..9d69b01 100644
--- a/PVE/Storage/CIFSPlugin.pm
+++ b/PVE/Storage/CIFSPlugin.pm
@@ -59,9 +59,6 @@ sub get_cred_file {
if (-e $cred_file) {
return $cred_file;
- } elsif (-e "/etc/pve/priv/${storeid}.cred") {
- # FIXME: remove fallback with 7.0 by doing a rename on upgrade from 6.x
- return "/etc/pve/priv/${storeid}.cred";
}
return undef;
}
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..e2453d2
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+case "$1" in
+ configure)
+ if test -n "$2"; then
+
+ # TODO: remove once PVE 7.0 is released
+ if dpkg --compare-versions "$2" 'lt' '7.0-3'; then
+ for file in /etc/pve/priv/*.cred; do
+ if [ -f "$file" ]; then
+ base=$(basename --suffix=".cred" "$file")
+ if [ -f "/etc/pve/priv/storage/$base.pw" ]; then
+ echo "Warning: found obsolete CIFS credentials file: $file" >&2
+ echo "File: /etc/pve/priv/storage/$base.pw also exists" >&2
+ else
+ cp "$file" "/etc/pve/priv/storage/$base.pw" && rm "$file"
+ fi
+ fi
+ done
+ fi
+ fi
+ ;;
+
+esac
+
+exit 0
--
2.30.2
next prev parent reply other threads:[~2021-06-04 13:50 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 13:49 [pve-devel] [PATCH-SERIES] Some breaking API changes/cleanups Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH guest-common 1/2] vzdump: remove deprecated size parameter Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH/RFC guest-common 2/2] vzdump: defaults: keep all backups by default for 7.0 Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH container 1/1] migrate: remove deprecated force parameter Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH qemu-server 1/3] Revert "revert spice_ticket prefix change in 7827de4" Fabian Ebner
2021-06-07 8:27 ` Stefan Reiter
2021-06-04 13:49 ` [pve-devel] [PATCH qemu-server 2/3] scan volids: remove superfluous parameter Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH qemu-server 3/3] vm destroy: do not remove unreferenced disks by default Fabian Ebner
2021-06-04 13:49 ` Fabian Ebner [this message]
2021-06-08 13:18 ` [pve-devel] [PATCH/RFC storage 1/3] postinst: move cifs credential files into subdirectory upon update Fabian Grünbichler
2021-06-09 6:35 ` Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH storage 2/3] update reminder to remove maxfiles Fabian Ebner
2021-06-08 13:04 ` Fabian Grünbichler
2021-06-08 16:23 ` Thomas Lamprecht
2021-06-09 6:30 ` Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH storage 3/3] api: get rid of moved 'usb' call Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH novnc-pve 1/1] avoid passing deprecated 'upgrade' parameter Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 01/12] vzdump: remove deprecated size parameter Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 02/12] configs: vzdump: use prune-backups instead of the deprecated maxfiles Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 03/12] test: vzdump: adapt to new default Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 04/12] Revert "VZDump: add TARFILE to environment for hookscripts" Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 05/12] api: nodes: remove deprecated upgrade parameter for xtermjs Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 06/12] api: nodes: remove deprecated upgrade parameter for spiceshell Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 07/12] api: nodes: remove deprecated upgrade parameter for vncshell Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 08/12] api: move cpu path into qemu/capabilities Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 09/12] api: ceph: remove obsoleted disks call Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 10/12] api: ceph: remove moved 'flags' calls Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 11/12] api: ceph: osd: create: rename size parameters Fabian Ebner
2021-06-04 13:49 ` [pve-devel] [PATCH manager 12/12] cli: pveceph: remove outdated comment Fabian Ebner
2021-06-09 9:44 ` [pve-devel] applied-partially: [PATCH-SERIES] Some breaking API changes/cleanups Fabian Grünbichler
2021-06-09 11:15 ` Fabian Ebner
2021-06-10 9:36 ` Fabian Grünbichler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210604134946.152720-8-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox