public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] test: fix restore config test as unprivileged user
@ 2021-05-31 14:27 Fabian Ebner
  2021-06-18 15:26 ` [pve-devel] applied: " Thomas Lamprecht
  2021-06-18 15:46 ` [pve-devel] " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Ebner @ 2021-05-31 14:27 UTC (permalink / raw)
  To: pve-devel

after upgrading to bullseye, the cfs_read_file call within
restore_update_config_line() results in an error:
    Is a directory!
when done as an unprivileged user.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Is that the intended behavior?

 test/run_qemu_restore_config_tests.pl | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/run_qemu_restore_config_tests.pl b/test/run_qemu_restore_config_tests.pl
index e5d9f2a..d8c0f37 100755
--- a/test/run_qemu_restore_config_tests.pl
+++ b/test/run_qemu_restore_config_tests.pl
@@ -5,6 +5,7 @@ use warnings;
 
 use lib qw(..);
 
+use Test::MockModule;
 use Test::More;
 
 use File::Basename;
@@ -15,6 +16,13 @@ use PVE::Tools qw(dir_glob_foreach file_get_contents);
 my $INPUT_DIR = './restore-config-input';
 my $EXPECTED_DIR = './restore-config-expected';
 
+my $pve_cluster_module = Test::MockModule->new('PVE::Cluster');
+$pve_cluster_module->mock(
+    cfs_read_file => sub {
+	return {};
+    },
+);
+
 # NOTE update when you add/remove tests
 plan tests => 4;
 
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] applied: [PATCH qemu-server] test: fix restore config test as unprivileged user
  2021-05-31 14:27 [pve-devel] [PATCH qemu-server] test: fix restore config test as unprivileged user Fabian Ebner
@ 2021-06-18 15:26 ` Thomas Lamprecht
  2021-06-18 15:46 ` [pve-devel] " Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2021-06-18 15:26 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Ebner

On 31.05.21 16:27, Fabian Ebner wrote:
> after upgrading to bullseye, the cfs_read_file call within
> restore_update_config_line() results in an error:
>     Is a directory!
> when done as an unprivileged user.
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> 
> Is that the intended behavior?
> 
>  test/run_qemu_restore_config_tests.pl | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH qemu-server] test: fix restore config test as unprivileged user
  2021-05-31 14:27 [pve-devel] [PATCH qemu-server] test: fix restore config test as unprivileged user Fabian Ebner
  2021-06-18 15:26 ` [pve-devel] applied: " Thomas Lamprecht
@ 2021-06-18 15:46 ` Thomas Lamprecht
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2021-06-18 15:46 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fabian Ebner

On 31.05.21 16:27, Fabian Ebner wrote:
> Is that the intended behavior?


it effectively comes from the IPCC code's call to qb_ipcc_connect

where something (did not checked to closely) tries to do an open of /tmp with
read-write, where the write part on the directory makes no sense.

...
setsockopt(3, SOL_SOCKET, SO_PASSCRED, [0], 4) = 0
openat(AT_FDCWD, "/dev/shm/qb-", O_RDWR) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/tmp/", O_RDWR) = -1 EISDIR (Is a directory)


Maybe some odd fallback logic on libqb or parts, not sure, maybe ask around the
#kronosnet IRC channel (IIRC they moved to libera after the freenode fallout).




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-18 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31 14:27 [pve-devel] [PATCH qemu-server] test: fix restore config test as unprivileged user Fabian Ebner
2021-06-18 15:26 ` [pve-devel] applied: " Thomas Lamprecht
2021-06-18 15:46 ` [pve-devel] " Thomas Lamprecht

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