Skip to content

Commit

Permalink
Use mknodat instead of mknod for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Dec 27, 2023
1 parent ef41511 commit 15d3fb4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions versions/v3.1.2/server/pve-common~mknodat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/src/PVE/Syscall.pm b/src/PVE/Syscall.pm
index 2a423e8..14c5466 100644
--- a/src/PVE/Syscall.pm
+++ b/src/PVE/Syscall.pm
@@ -16,7 +16,7 @@ BEGIN {
openat => &SYS_openat,
close => &SYS_close,
mkdirat => &SYS_mkdirat,
- mknod => &SYS_mknod,
+ mknodat => &SYS_mknodat,
faccessat => &SYS_faccessat,
setresuid => &SYS_setresuid,
fchownat => &SYS_fchownat,
diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index 766c809..353503a 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -1753,7 +1753,8 @@ sub mkdirat($$$) {

sub mknod($$$) {
my ($filename, $mode, $dev) = @_;
- return syscall(PVE::Syscall::SYS_mknod, $filename, int($mode), int($dev)) == 0;
+ # AT_FDCWD = -100
+ return syscall(PVE::Syscall::SYS_mknodat, -100, $filename, int($mode), int($dev)) == 0;
}

sub fchownat($$$$$) {

0 comments on commit 15d3fb4

Please sign in to comment.