public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Filip Schauer <f.schauer@proxmox.com>
To: Fiona Ebner <f.ebner@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH container] Fix invalid device passthrough being added to config
Date: Mon, 15 Apr 2024 15:18:55 +0200	[thread overview]
Message-ID: <7c82c50e-36de-429e-b32b-e7306e3c738e@proxmox.com> (raw)
In-Reply-To: <a90c9302-4aa0-40a1-8a22-6de34bd34351@proxmox.com>

On 11/04/2024 14:18, Fiona Ebner wrote:
>> -
>>   	my $absolute_path = $device->{path};
>>   	my ($mode, $rdev) = (stat($absolute_path))[2, 6];
>>   
>> -	die "Device $absolute_path does not exist\n" if $! == ENOENT;
>> -
>>   	die "Error accessing device $absolute_path\n"
>>   	    if (!defined($mode) || !defined($rdev));
>>   
>> -	die "$absolute_path is not a device\n"
>> -	    if (!S_ISBLK($mode) && !S_ISCHR($mode));
>> -
> Is there any downside to keeping these checks here as well? What a path
> points to might change in between being set in the config and some later
> time when the container is started, so these checks still make sense
> here IMHO. Could then become a helper function since it's used in two
> places, which would also reduce the amount of lines in the
> update_{pct,lxc}_config functions.

Good point, I sent a patch v2:
https://lists.proxmox.com/pipermail/pve-devel/2024-April/062973.html





      reply	other threads:[~2024-04-15 13:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 14:29 Filip Schauer
2024-04-11 12:18 ` Fiona Ebner
2024-04-15 13:18   ` Filip Schauer [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=7c82c50e-36de-429e-b32b-e7306e3c738e@proxmox.com \
    --to=f.schauer@proxmox.com \
    --cc=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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal