[pve-devel] [RFC container] use new SyscallMap module instead of raw syscall numbers
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Apr 28 18:08:07 CEST 2017
To make the module more portable
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
debian/control | 2 +-
src/PVE/LXC.pm | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/debian/control b/debian/control
index e9c7364..b88b725 100644
--- a/debian/control
+++ b/debian/control
@@ -9,6 +9,6 @@ Package: pve-container
Section: perl
Priority: optional
Architecture: all
-Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, libpve-common-perl, libpve-guest-common-perl, libpve-storage-perl, pve-cluster (>= 4.0-8), pve-ha-manager, lxc-pve, xz-utils, file
+Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, libpve-common-perl, libpve-guest-common-perl, libpve-storage-perl, pve-cluster (>= 4.0-8), pve-ha-manager, lxc-pve, xz-utils, file, libpve-common-sys-perl
Description: Proxmox VE Container management tool
Tool to manage Linux Containers on Proxmox VE.
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index b2f2c13..1951d5e 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -17,6 +17,7 @@ use PVE::Exception qw(raise_perm_exc);
use PVE::Storage;
use PVE::SafeSyslog;
use PVE::INotify;
+use PVE::ArchDependent::SyscallMap;
use PVE::Tools qw($IPV6RE $IPV4RE dir_glob_foreach lock_file lock_file_full O_PATH);
use PVE::CpuSet;
use PVE::Network;
@@ -1102,9 +1103,9 @@ sub __bindmount_verify {
die "failed to open mount point: $!\n" if !$destdh;
if ($ro) {
my $dot = '.';
- # 269: faccessat()
# no separate function because 99% of the time it's the wrong thing to use.
- if (syscall(269, fileno($destdh), $dot, &POSIX::W_OK, 0) != -1) {
+ if (syscall(PVE::ArchDependent::SyscallMap::SYS_faccessat,
+ fileno($destdh), $dot, &POSIX::W_OK, 0) != -1) {
die "failed to mark bind mount read only\n";
}
die "read-only check failed: $!\n" if $! != EROFS;
--
2.11.0
More information about the pve-devel
mailing list