@@ -53,9 +53,6 @@ const FMODE_EXEC: i32 = 0x20;
5353
5454// const MAX_NAME_LENGTH: u32 = 255 - ENCRYPT_FILENAME_OVERHEAD_CHARS as u32;
5555
56- // Flags returned by the open request
57- const FOPEN_DIRECT_IO : u32 = 1 << 0 ; // bypass page cache for this open file
58-
5956pub struct DirectoryEntryIterator ( crate :: encryptedfs:: DirectoryEntryIterator , u64 ) ;
6057
6158impl Iterator for DirectoryEntryIterator {
@@ -133,34 +130,17 @@ impl Iterator for DirectoryEntryPlusIterator {
133130
134131pub struct EncryptedFsFuse3 {
135132 fs : Arc < EncryptedFs > ,
136- direct_io : bool ,
137- suid_support : bool ,
138133}
139134
140135impl EncryptedFsFuse3 {
141136 pub async fn new (
142137 data_dir : PathBuf ,
143138 password_provider : Box < dyn PasswordProvider > ,
144139 cipher : Cipher ,
145- direct_io : bool ,
146- #[ allow( unused_variables) ] suid_support : bool ,
147140 ) -> FsResult < Self > {
148- // #[cfg(feature = "abi-7-26")]
149- // {
150- // Ok(Self {
151- // fs: EncryptedFs::new(data_dir, password_provider, cipher).await?,
152- // direct_io,
153- // suid_support,
154- // })
155- // }
156- // #[cfg(not(feature = "abi-7-26"))]
157- // {
158141 Ok ( Self {
159142 fs : EncryptedFs :: new ( data_dir, password_provider, cipher) . await ?,
160- direct_io,
161- suid_support,
162143 } )
163- // }
164144 }
165145
166146 fn get_fs ( & self ) -> Arc < EncryptedFs > {
@@ -169,11 +149,7 @@ impl EncryptedFsFuse3 {
169149
170150 #[ allow( clippy:: cast_possible_truncation) ]
171151 const fn creation_mode ( & self , mode : u32 ) -> u16 {
172- if self . suid_support {
173- mode as u16
174- } else {
175- ( mode & !( libc:: S_ISUID | libc:: S_ISGID ) ) as u16
176- }
152+ ( mode & !( libc:: S_ISUID | libc:: S_ISGID ) ) as u16
177153 }
178154
179155 #[ instrument( skip( self , name) , fields( name = name. to_str( ) . unwrap( ) ) , err( level = Level :: WARN ) , ret( level = Level :: DEBUG ) ) ]
@@ -933,7 +909,6 @@ impl Filesystem for EncryptedFsFuse3 {
933909 EIO
934910 } ) ?;
935911 }
936- let open_flags = if self . direct_io { FOPEN_DIRECT_IO } else { 0 } ;
937912 let fh = self
938913 . get_fs ( )
939914 . open ( inode, read, write)
@@ -942,10 +917,7 @@ impl Filesystem for EncryptedFsFuse3 {
942917 error ! ( err = %err) ;
943918 EIO
944919 } ) ?;
945- Ok ( ReplyOpen {
946- fh,
947- flags : open_flags,
948- } )
920+ Ok ( ReplyOpen { fh, flags : 0 } )
949921 } else {
950922 return Err ( EACCES . into ( ) ) ;
951923 }
@@ -1102,10 +1074,9 @@ impl Filesystem for EncryptedFsFuse3 {
11021074 } ;
11031075
11041076 if check_access ( attr. uid , attr. gid , attr. perm , req. uid , req. gid , access_mask) {
1105- let open_flags = if self . direct_io { FOPEN_DIRECT_IO } else { 0 } ;
11061077 Ok ( ReplyOpen {
11071078 fh : 0 , // we don't use handles for directories
1108- flags : open_flags ,
1079+ flags : 0 ,
11091080 } )
11101081 } else {
11111082 return Err ( EACCES . into ( ) ) ;
@@ -1485,8 +1456,7 @@ async fn mount_fuse(
14851456 info ! ( "Checking password and mounting FUSE filesystem" ) ;
14861457 Ok ( Session :: new ( mount_options)
14871458 . mount_with_unprivileged (
1488- EncryptedFsFuse3 :: new ( data_dir, password_provider, cipher, direct_io, suid_support)
1489- . await ?,
1459+ EncryptedFsFuse3 :: new ( data_dir, password_provider, cipher) . await ?,
14901460 mount_path,
14911461 )
14921462 . await ?)
0 commit comments