[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/35] hw/usb/dev-mtp: create directories with a+x mode mask
From: |
Gerd Hoffmann |
Subject: |
[PULL 02/35] hw/usb/dev-mtp: create directories with a+x mode mask |
Date: |
Fri, 4 Mar 2022 15:20:50 +0100 |
From: Volker RĂ¼melin <vr_qemu@t-online.de>
Current code creates directories with mode 0644. Even the creator
can't create files in the new directory. Set all x mode flags in
variable mask and clear all x mode flags in function open() to
preserve the current open mode.
Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de>
Message-Id: <20220122140619.7514-1-vr_qemu@t-online.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/dev-mtp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 1e6ac76bef9b..e6b77a2a941d 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1607,7 +1607,7 @@ static void usb_mtp_write_data(MTPState *s, uint32_t
handle)
usb_mtp_object_lookup(s, s->dataset.parent_handle);
char *path = NULL;
uint64_t rc;
- mode_t mask = 0644;
+ mode_t mask = 0755;
int ret = 0;
assert(d != NULL);
@@ -1635,7 +1635,7 @@ static void usb_mtp_write_data(MTPState *s, uint32_t
handle)
}
d->fd = open(path, O_CREAT | O_WRONLY |
- O_CLOEXEC | O_NOFOLLOW, mask);
+ O_CLOEXEC | O_NOFOLLOW, mask & 0666);
if (d->fd == -1) {
ret = 1;
goto done;
--
2.35.1
- [PULL 00/35] Kraxel 20220304 patches, Gerd Hoffmann, 2022/03/04
- [PULL 01/35] hw/usb: pacify xhciwmi.exe warning, Gerd Hoffmann, 2022/03/04
- [PULL 02/35] hw/usb/dev-mtp: create directories with a+x mode mask,
Gerd Hoffmann <=
- [PULL 04/35] usb/ohci: Move cancelling async packet to ohci_stop_endpoints(), Gerd Hoffmann, 2022/03/04
- [PULL 03/35] usb/ohci: Move trace point and log ep number to help debugging, Gerd Hoffmann, 2022/03/04
- [PULL 05/35] usb/ohci: Move USBPortOps related functions together, Gerd Hoffmann, 2022/03/04
- [PULL 06/35] usb/ohci: Merge ohci_async_cancel_device() into ohci_child_detach(), Gerd Hoffmann, 2022/03/04
- [PULL 08/35] audio: replace open-coded buffer arithmetic, Gerd Hoffmann, 2022/03/04
- [PULL 07/35] usb/ohci: Don't use packet from OHCIState for isochronous transfers, Gerd Hoffmann, 2022/03/04
- [PULL 09/35] audio: move function audio_pcm_hw_clip_out(), Gerd Hoffmann, 2022/03/04
- [PULL 10/35] audio: add function audio_pcm_hw_conv_in(), Gerd Hoffmann, 2022/03/04
- [PULL 12/35] paaudio: increase default latency to 46ms, Gerd Hoffmann, 2022/03/04
- [PULL 11/35] audio: inline function audio_pcm_sw_get_rpos_in(), Gerd Hoffmann, 2022/03/04