public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: "Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
	"Phillipp Röll" <pr@lima-city.de>
Subject: Re: [pve-devel] [PATCH] Check only first part of script parameter for executability
Date: Fri, 22 Oct 2021 09:36:31 +0200	[thread overview]
Message-ID: <ac5288b8-3075-1feb-c4c9-eeeea1008bc5@proxmox.com> (raw)
In-Reply-To: <efd1d1a259bfc95c632e1106f7aa2c0f@lima-city.de>

Hi Phillipp,

On 21/10/2021 20:15, Phillipp Röll wrote:
> I'll skip the legal stuff for now, until we figure out if the patch has a chance
> to be merged, ok?

sounds fine to me.

> 
>> That would break existing configuration that use a script with whitespace in its
>> path name.
> 
> There could be two checks, check if either the full script name is executable OR
> just the first part (split by whitespaces).

Hmm, that could be an option, for splitting I'd recommend using the `split_args` helper
from the PVE::Tools module, it's made for this case and should handle some subtleties
better than a plain split on any whitespace.

> 
>> Can you please provide your usecase where the arguments Proxmox VE sets for the
>> script aren't enough? So that we've a better picture about possible options.
> 
> We have a backup & restore management system, where the state, retention period etc.
> of a backup is stored. All proxmox backup states are updated by a hook script calling
> a REST API. We need to pass the ID of the backup from the management system to the
> hook script, which is no longer possible since the check was introduced.

Is the ID related to the VMID? As in, could it be possible to save a mapping from
VMID to current backup ID somewhere (node local or cluster shared on /etc/pve through
pmxcfs), e.g., as JSON file, read that file in the hook script and get the BACKUP ID
then from that mapping using the VMID as key?

Could be slightly more robust and could potentially reduce the amount of REST calls
and pmxcfs updates, I mean those resources are not _that_ scarce or performance
critical, but with many guests and big clusters the pmxcfs load may get noticeable.

But, that said, I'm open into introducing your implementation, that formerly rather
worked by accident, as actual and documented possible behaviour.

> 
> We comment/patch these checks out automatically on all systems, but that's a bit
> annoying.
> 
> So actually the (much) earlier introduction of the check already broke our use case,
> but before today the pain to report it/change something simply wasn't great enough.
> 

It could help leading with that in the commit message or the like, as having an
existing use case broken should get you more attention in your favour compared to
people thinking you want add a new behaviour as we do not want to break existing
use cases if possible, but that side effect was not recognized as being used :)




      reply	other threads:[~2021-10-22  7:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21  8:46 Phillipp Röll
2021-10-21  9:05 ` Thomas Lamprecht
2021-10-21 18:15   ` Phillipp Röll
2021-10-22  7:36     ` Thomas Lamprecht [this message]

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=ac5288b8-3075-1feb-c4c9-eeeea1008bc5@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pr@lima-city.de \
    --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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal