patch: fix FUSE permission
1. fuse flag check made wrong, fix it 2. but still mount will RO flag Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
This commit is contained in:
parent
fc3187a781
commit
c529f8099d
@ -300,11 +300,6 @@ impl fuser::Filesystem for FuseServer {
|
|||||||
reply.error(libc::EBUSY);
|
reply.error(libc::EBUSY);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if flags & libc::O_RDONLY == 0 {
|
|
||||||
log::error!("fuse: entry is read only");
|
|
||||||
reply.error(libc::EACCES);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let fh = self.alloc_fd();
|
let fh = self.alloc_fd();
|
||||||
entry.add_handler(fh);
|
entry.add_handler(fh);
|
||||||
@ -409,12 +404,7 @@ impl fuser::Filesystem for FuseServer {
|
|||||||
log::error!("fuse: open: entry is not a file");
|
log::error!("fuse: open: entry is not a file");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// check flags
|
|
||||||
if flags & libc::O_RDONLY == 0 {
|
|
||||||
reply.error(libc::EACCES);
|
|
||||||
log::error!("fuse: open: entry is read only");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// check gc
|
// check gc
|
||||||
if entry.marked() {
|
if entry.marked() {
|
||||||
reply.error(libc::EBUSY);
|
reply.error(libc::EBUSY);
|
||||||
@ -435,7 +425,7 @@ impl fuser::Filesystem for FuseServer {
|
|||||||
fh: u64,
|
fh: u64,
|
||||||
offset: i64,
|
offset: i64,
|
||||||
size: u32,
|
size: u32,
|
||||||
flags: i32,
|
_flags: i32,
|
||||||
_lock_owner: Option<u64>,
|
_lock_owner: Option<u64>,
|
||||||
reply: fuser::ReplyData,
|
reply: fuser::ReplyData,
|
||||||
) {
|
) {
|
||||||
@ -455,12 +445,6 @@ impl fuser::Filesystem for FuseServer {
|
|||||||
log::error!("fuse: read: entry is not a file");
|
log::error!("fuse: read: entry is not a file");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// check flags
|
|
||||||
if flags & libc::O_RDONLY == 0 {
|
|
||||||
reply.error(libc::EACCES);
|
|
||||||
log::error!("fuse: read: entry is read only");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if entry.marked() {
|
if entry.marked() {
|
||||||
reply.error(libc::EBUSY);
|
reply.error(libc::EBUSY);
|
||||||
|
@ -132,6 +132,7 @@ impl ClipboardContext {
|
|||||||
let mnt_opts = [
|
let mnt_opts = [
|
||||||
MountOption::FSName("rustdesk-cliprdr-fs".to_string()),
|
MountOption::FSName("rustdesk-cliprdr-fs".to_string()),
|
||||||
MountOption::NoAtime,
|
MountOption::NoAtime,
|
||||||
|
MountOption::RO,
|
||||||
];
|
];
|
||||||
log::info!(
|
log::info!(
|
||||||
"mounting clipboard FUSE to {}",
|
"mounting clipboard FUSE to {}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user