From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 7165872E75 for ; Thu, 17 Jun 2021 10:10:07 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5E4F118DC1 for ; Thu, 17 Jun 2021 10:09:37 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 74B8D18DB1 for ; Thu, 17 Jun 2021 10:09:33 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 3CC21441A9 for ; Thu, 17 Jun 2021 10:09:33 +0200 (CEST) To: Thomas Lamprecht , Proxmox VE development discussion References: <20210616072700.54289-1-f.ebner@proxmox.com> <20210616072700.54289-5-f.ebner@proxmox.com> <422e61d2-821c-d58b-9bcd-2c270c64c88c@proxmox.com> From: Fabian Ebner Message-ID: Date: Thu, 17 Jun 2021 10:09:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <422e61d2-821c-d58b-9bcd-2c270c64c88c@proxmox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 1 AWL -1.673 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_SOMETLD_ARE_BAD_TLD 5 .stream, .trade, .pw, .top, .press, .guru, .casa & .date TLD Abuse NICE_REPLY_A -0.17 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH v2 storage 1/5] postinst: move cifs credential files into subdirectory upon update X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2021 08:10:07 -0000 Am 16.06.21 um 15:11 schrieb Thomas Lamprecht: > On 16.06.21 09:26, Fabian Ebner wrote: >> +case "$1" in >> + configure) >> + if test -n "$2"; then >> + >> + # TODO: remove once PVE 8.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 >> + mkdir -p "/etc/pve/priv/storage" >> + echo "Info: found CIFS credentials using old path: $file" >&2 >> + base=$(basename --suffix=".cred" "$file") >> + target="/etc/pve/priv/storage/$base.pw" >> + if [ -f "$target" ]; then >> + echo "Warning: not renaming $file, because $target already exists!" >&2 > > can we diff in this case and remove the old one if the files are identical? > Sure, I'll send a follow-up. >> + else >> + echo "Info: renaming $file to $target" >&2 >> + mv "$file" "$target" >> + fi >> + fi >> + done >> + fi >> + fi >> + ;; >> + >> +esac >> + >> +exit 0 >> >