[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/10] linux-user: fix openat
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PATCH 04/10] linux-user: fix openat |
Date: |
Thu, 27 Oct 2011 15:02:50 +0300 |
From: Alexander Graf <address@hidden>
When running openat using qemu-arm, we stumbled over invalid permissions
on the created files. The reason for this is that the mode parameter gets
treates as an O_... flag, which it isn't - it's a permission bitmask.
This patch removes the needless translation of the mode parameter,
rendering permission passing of openat() to work with linux-user.
Reported-by: Dirk Mueller <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall.c | 14 +-------------
1 files changed, 1 insertions(+), 13 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 9a63357..6159571 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -379,25 +379,13 @@ static int sys_mknodat(int dirfd, const char *pathname,
mode_t mode,
}
#endif
#ifdef TARGET_NR_openat
-static int sys_openat(int dirfd, const char *pathname, int flags, ...)
+static int sys_openat(int dirfd, const char *pathname, int flags, mode_t mode)
{
/*
* open(2) has extra parameter 'mode' when called with
* flag O_CREAT.
*/
if ((flags & O_CREAT) != 0) {
- va_list ap;
- mode_t mode;
-
- /*
- * Get the 'mode' parameter and translate it to
- * host bits.
- */
- va_start(ap, flags);
- mode = va_arg(ap, mode_t);
- mode = target_to_host_bitmask(mode, fcntl_flags_tbl);
- va_end(ap);
-
return (openat(dirfd, pathname, flags, mode));
}
return (openat(dirfd, pathname, flags));
--
1.7.5.4
- [Qemu-devel] [PATCH 00/10] Linux-user patches for 1.0, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 10/10] ppc64-linux-user: Fix syscall return type., riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 07/10] sparc-linux-user: Fixup sending SIGSEGV, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 04/10] linux-user: fix openat,
riku . voipio <=
- [Qemu-devel] [PATCH 02/10] linux-user: fix rlimit syscalls on sparc(64), riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 08/10] sparc-linux-user: Add some missing syscall numbers, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 09/10] ppc64-linux-user: Properly interpret the entry function descriptor., riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 05/10] linux-user: implement reboot syscall, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 01/10] linux-user: fix TARGET_RLIM_INFINITY declaration, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 03/10] linux-user: fix abi_(u)long, target_ulong mismatch, riku . voipio, 2011/10/27
- [Qemu-devel] [PATCH 06/10] sparc-linux-user: Handle SIGILL., riku . voipio, 2011/10/27