summary refs log tree commit diff
path: root/ripple/fossil
diff options
context:
space:
mode:
authoredef <edef@unfathomable.blue>2022-03-24 18:09:10 +0000
committeredef <edef@unfathomable.blue>2022-04-11 17:01:36 +0000
commit43eca585e23e1c5f4b0420f2f1b7694aa07b438f (patch)
treebe71cacf5bb78832a46e7773777fd1dcccc54dba /ripple/fossil
parent891655b2b1ad12b5eaf813a346fc2c177e4fa062 (diff)
downloadunf-legacy-43eca585e23e1c5f4b0420f2f1b7694aa07b438f.tar.zst
ripple/fossil/mount: stub out anything we don't want to implement
Change-Id: I7c2f940a411346230835f1befc5d4fe384e2b67e
Diffstat (limited to 'ripple/fossil')
-rw-r--r--ripple/fossil/src/bin/mount.rs304
1 files changed, 103 insertions, 201 deletions
diff --git a/ripple/fossil/src/bin/mount.rs b/ripple/fossil/src/bin/mount.rs
index 55dd6bf..5e4063e 100644
--- a/ripple/fossil/src/bin/mount.rs
+++ b/ripple/fossil/src/bin/mount.rs
@@ -2,7 +2,7 @@
 // SPDX-License-Identifier: OSL-3.0
 
 use {
-	libc::{c_int, ENOSYS, EPERM},
+	libc::{c_int, ENOSYS, EROFS},
 	log::{debug, warn},
 };
 
@@ -58,27 +58,22 @@ impl fuser::Filesystem for Filesystem {
 	fn setattr(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		mode: Option<u32>,
-		uid: Option<u32>,
-		gid: Option<u32>,
-		size: Option<u64>,
+		_ino: u64,
+		_mode: Option<u32>,
+		_uid: Option<u32>,
+		_gid: Option<u32>,
+		_size: Option<u64>,
 		_atime: Option<fuser::TimeOrNow>,
 		_mtime: Option<fuser::TimeOrNow>,
 		_ctime: Option<std::time::SystemTime>,
-		fh: Option<u64>,
+		_fh: Option<u64>,
 		_crtime: Option<std::time::SystemTime>,
 		_chgtime: Option<std::time::SystemTime>,
 		_bkuptime: Option<std::time::SystemTime>,
-		flags: Option<u32>,
+		_flags: Option<u32>,
 		reply: fuser::ReplyAttr,
 	) {
-		debug!(
-			"[Not Implemented] setattr(ino: {:#x?}, mode: {:?}, uid: {:?}, \
-            gid: {:?}, size: {:?}, fh: {:?}, flags: {:?})",
-			ino, mode, uid, gid, size, fh, flags
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn readlink(&mut self, _req: &fuser::Request<'_>, ino: u64, reply: fuser::ReplyData) {
@@ -89,49 +84,36 @@ impl fuser::Filesystem for Filesystem {
 	fn mknod(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		parent: u64,
-		name: &std::ffi::OsStr,
-		mode: u32,
-		umask: u32,
-		rdev: u32,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_mode: u32,
+		_umask: u32,
+		_rdev: u32,
 		reply: fuser::ReplyEntry,
 	) {
-		debug!(
-			"[Not Implemented] mknod(parent: {:#x?}, name: {:?}, mode: {}, \
-            umask: {:#x?}, rdev: {})",
-			parent, name, mode, umask, rdev
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn mkdir(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		parent: u64,
-		name: &std::ffi::OsStr,
-		mode: u32,
-		umask: u32,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_mode: u32,
+		_umask: u32,
 		reply: fuser::ReplyEntry,
 	) {
-		debug!(
-			"[Not Implemented] mkdir(parent: {:#x?}, name: {:?}, mode: {}, umask: {:#x?})",
-			parent, name, mode, umask
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn unlink(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		parent: u64,
-		name: &std::ffi::OsStr,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
 		reply: fuser::ReplyEmpty,
 	) {
-		debug!(
-			"[Not Implemented] unlink(parent: {:#x?}, name: {:?})",
-			parent, name,
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn rmdir(
@@ -151,49 +133,36 @@ impl fuser::Filesystem for Filesystem {
 	fn symlink(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		parent: u64,
-		name: &std::ffi::OsStr,
-		link: &std::path::Path,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_link: &std::path::Path,
 		reply: fuser::ReplyEntry,
 	) {
-		debug!(
-			"[Not Implemented] symlink(parent: {:#x?}, name: {:?}, link: {:?})",
-			parent, name, link,
-		);
-		reply.error(EPERM);
+		reply.error(EROFS);
 	}
 
 	fn rename(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		parent: u64,
-		name: &std::ffi::OsStr,
-		newparent: u64,
-		newname: &std::ffi::OsStr,
-		flags: u32,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_newparent: u64,
+		_newname: &std::ffi::OsStr,
+		_flags: u32,
 		reply: fuser::ReplyEmpty,
 	) {
-		debug!(
-			"[Not Implemented] rename(parent: {:#x?}, name: {:?}, newparent: {:#x?}, \
-            newname: {:?}, flags: {})",
-			parent, name, newparent, newname, flags,
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn link(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		newparent: u64,
-		newname: &std::ffi::OsStr,
+		_ino: u64,
+		_newparent: u64,
+		_newname: &std::ffi::OsStr,
 		reply: fuser::ReplyEntry,
 	) {
-		debug!(
-			"[Not Implemented] link(ino: {:#x?}, newparent: {:#x?}, newname: {:?})",
-			ino, newparent, newname
-		);
-		reply.error(EPERM);
+		reply.error(EROFS);
 	}
 
 	fn open(&mut self, _req: &fuser::Request<'_>, _ino: u64, _flags: i32, reply: fuser::ReplyOpen) {
@@ -222,27 +191,16 @@ impl fuser::Filesystem for Filesystem {
 	fn write(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		fh: u64,
-		offset: i64,
-		data: &[u8],
-		write_flags: u32,
-		flags: i32,
-		lock_owner: Option<u64>,
+		_ino: u64,
+		_fh: u64,
+		_offset: i64,
+		_data: &[u8],
+		_write_flags: u32,
+		_flags: i32,
+		_lock_owner: Option<u64>,
 		reply: fuser::ReplyWrite,
 	) {
-		debug!(
-			"[Not Implemented] write(ino: {:#x?}, fh: {}, offset: {}, data.len(): {}, \
-            write_flags: {:#x?}, flags: {:#x?}, lock_owner: {:?})",
-			ino,
-			fh,
-			offset,
-			data.len(),
-			write_flags,
-			flags,
-			lock_owner
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn flush(
@@ -361,61 +319,45 @@ impl fuser::Filesystem for Filesystem {
 	fn setxattr(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		name: &std::ffi::OsStr,
+		_ino: u64,
+		_name: &std::ffi::OsStr,
 		_value: &[u8],
-		flags: i32,
-		position: u32,
+		_flags: i32,
+		_position: u32,
 		reply: fuser::ReplyEmpty,
 	) {
-		debug!(
-			"[Not Implemented] setxattr(ino: {:#x?}, name: {:?}, flags: {:#x?}, position: {})",
-			ino, name, flags, position
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn getxattr(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		name: &std::ffi::OsStr,
-		size: u32,
+		_ino: u64,
+		_name: &std::ffi::OsStr,
+		_size: u32,
 		reply: fuser::ReplyXattr,
 	) {
-		debug!(
-			"[Not Implemented] getxattr(ino: {:#x?}, name: {:?}, size: {})",
-			ino, name, size
-		);
 		reply.error(ENOSYS);
 	}
 
 	fn listxattr(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		size: u32,
+		_ino: u64,
+		_size: u32,
 		reply: fuser::ReplyXattr,
 	) {
-		debug!(
-			"[Not Implemented] listxattr(ino: {:#x?}, size: {})",
-			ino, size
-		);
 		reply.error(ENOSYS);
 	}
 
 	fn removexattr(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		name: &std::ffi::OsStr,
+		_ino: u64,
+		_name: &std::ffi::OsStr,
 		reply: fuser::ReplyEmpty,
 	) {
-		debug!(
-			"[Not Implemented] removexattr(ino: {:#x?}, name: {:?})",
-			ino, name
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn access(&mut self, _req: &fuser::Request<'_>, ino: u64, mask: i32, reply: fuser::ReplyEmpty) {
@@ -426,117 +368,83 @@ impl fuser::Filesystem for Filesystem {
 	fn create(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		parent: u64,
-		name: &std::ffi::OsStr,
-		mode: u32,
-		umask: u32,
-		flags: i32,
+		_parent: u64,
+		_name: &std::ffi::OsStr,
+		_mode: u32,
+		_umask: u32,
+		_flags: i32,
 		reply: fuser::ReplyCreate,
 	) {
-		debug!(
-			"[Not Implemented] create(parent: {:#x?}, name: {:?}, mode: {}, umask: {:#x?}, \
-            flags: {:#x?})",
-			parent, name, mode, umask, flags
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn getlk(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		fh: u64,
-		lock_owner: u64,
-		start: u64,
-		end: u64,
-		typ: i32,
-		pid: u32,
+		_ino: u64,
+		_fh: u64,
+		_lock_owner: u64,
+		_start: u64,
+		_end: u64,
+		_typ: i32,
+		_pid: u32,
 		reply: fuser::ReplyLock,
 	) {
-		debug!(
-			"[Not Implemented] getlk(ino: {:#x?}, fh: {}, lock_owner: {}, start: {}, \
-            end: {}, typ: {}, pid: {})",
-			ino, fh, lock_owner, start, end, typ, pid
-		);
 		reply.error(ENOSYS);
 	}
 
 	fn setlk(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		fh: u64,
-		lock_owner: u64,
-		start: u64,
-		end: u64,
-		typ: i32,
-		pid: u32,
-		sleep: bool,
+		_ino: u64,
+		_fh: u64,
+		_lock_owner: u64,
+		_start: u64,
+		_end: u64,
+		_typ: i32,
+		_pid: u32,
+		_sleep: bool,
 		reply: fuser::ReplyEmpty,
 	) {
-		debug!(
-			"[Not Implemented] setlk(ino: {:#x?}, fh: {}, lock_owner: {}, start: {}, \
-            end: {}, typ: {}, pid: {}, sleep: {})",
-			ino, fh, lock_owner, start, end, typ, pid, sleep
-		);
 		reply.error(ENOSYS);
 	}
 
 	fn bmap(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		blocksize: u32,
-		idx: u64,
+		_ino: u64,
+		_blocksize: u32,
+		_idx: u64,
 		reply: fuser::ReplyBmap,
 	) {
-		debug!(
-			"[Not Implemented] bmap(ino: {:#x?}, blocksize: {}, idx: {})",
-			ino, blocksize, idx,
-		);
 		reply.error(ENOSYS);
 	}
 
 	fn ioctl(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		fh: u64,
-		flags: u32,
-		cmd: u32,
-		in_data: &[u8],
-		out_size: u32,
+		_ino: u64,
+		_fh: u64,
+		_flags: u32,
+		_cmd: u32,
+		_in_data: &[u8],
+		_out_size: u32,
 		reply: fuser::ReplyIoctl,
 	) {
-		debug!(
-			"[Not Implemented] ioctl(ino: {:#x?}, fh: {}, flags: {}, cmd: {}, \
-            in_data.len(): {}, out_size: {})",
-			ino,
-			fh,
-			flags,
-			cmd,
-			in_data.len(),
-			out_size,
-		);
 		reply.error(ENOSYS);
 	}
 
 	fn fallocate(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino: u64,
-		fh: u64,
-		offset: i64,
-		length: i64,
-		mode: i32,
+		_ino: u64,
+		_fh: u64,
+		_offset: i64,
+		_length: i64,
+		_mode: i32,
 		reply: fuser::ReplyEmpty,
 	) {
-		debug!(
-			"[Not Implemented] fallocate(ino: {:#x?}, fh: {}, offset: {}, \
-            length: {}, mode: {})",
-			ino, fh, offset, length, mode
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 
 	fn lseek(
@@ -558,22 +466,16 @@ impl fuser::Filesystem for Filesystem {
 	fn copy_file_range(
 		&mut self,
 		_req: &fuser::Request<'_>,
-		ino_in: u64,
-		fh_in: u64,
-		offset_in: i64,
-		ino_out: u64,
-		fh_out: u64,
-		offset_out: i64,
-		len: u64,
-		flags: u32,
+		_ino_in: u64,
+		_fh_in: u64,
+		_offset_in: i64,
+		_ino_out: u64,
+		_fh_out: u64,
+		_offset_out: i64,
+		_len: u64,
+		_flags: u32,
 		reply: fuser::ReplyWrite,
 	) {
-		debug!(
-			"[Not Implemented] copy_file_range(ino_in: {:#x?}, fh_in: {}, \
-            offset_in: {}, ino_out: {:#x?}, fh_out: {}, offset_out: {}, \
-            len: {}, flags: {})",
-			ino_in, fh_in, offset_in, ino_out, fh_out, offset_out, len, flags
-		);
-		reply.error(ENOSYS);
+		reply.error(EROFS);
 	}
 }