public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH storage] CephConfig: ensure newline in $secret parameter
Date: Mon, 24 Jan 2022 15:18:40 +0100	[thread overview]
Message-ID: <eb395ab0-b478-8421-b6e3-3545f52af3c8@proxmox.com> (raw)
In-Reply-To: <d92b8457-ac42-c1ed-2d54-14b265e23684@proxmox.com>



On 1/24/22 15:03, Thomas Lamprecht wrote:
> On 17.01.22 11:11, Aaron Lauterer wrote:
>> Ping? Patch should still apply
>>
>> On 11/26/21 16:02, Aaron Lauterer wrote:
>>> Ensure that the user provided $secret ends in a newline. Otherwise we
>>> will have Input/output errors from rados_connect.
>>>
>>> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
>>> ---
>>>    PVE/CephConfig.pm | 1 +
>>>    1 file changed, 1 insertion(+)
>>>
>>> diff --git a/PVE/CephConfig.pm b/PVE/CephConfig.pm
>>> index 5c94a04..ac28e76 100644
>>> --- a/PVE/CephConfig.pm
>>> +++ b/PVE/CephConfig.pm
>>> @@ -227,6 +227,7 @@ sub ceph_create_keyfile {
>>>        eval {
>>>            if (defined($secret)) {
>>>            mkdir '/etc/pve/priv/ceph';
>>> +        $secret = "${secret}\n" if $secret !~ m/\n$/;
> 
> FWIW, we normally use chomp for this, e.g.:
> 
> chomp $secret
> file_set_contents($ceph_storage_keyring, "$secret\n", 0400);
> 
> https://perldoc.perl.org/functions/chomp
> 
> IIRC, that little nit made me not apply+push it immediately and then it seems
> like it went under the radar.

Okay. I'll incorporate that in a v2




  reply	other threads:[~2022-01-24 14:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26 15:02 Aaron Lauterer
2022-01-17 10:11 ` Aaron Lauterer
2022-01-24 14:03   ` Thomas Lamprecht
2022-01-24 14:18     ` Aaron Lauterer [this message]
2022-01-24 11:26 ` Fabian Ebner
2022-01-24 14:42   ` Aaron Lauterer

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=eb395ab0-b478-8421-b6e3-3545f52af3c8@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal