mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Correct MFS behaviour when path starts with directory separator.
This commit is contained in:
@@ -51,6 +51,8 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
|||||||
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if(pathElements.Length != 1) return Errno.NotSupported;
|
if(pathElements.Length != 1) return Errno.NotSupported;
|
||||||
|
|
||||||
|
path = pathElements[0];
|
||||||
|
|
||||||
if(!filenameToId.TryGetValue(path.ToLowerInvariant(), out uint fileId)) return Errno.NoSuchFile;
|
if(!filenameToId.TryGetValue(path.ToLowerInvariant(), out uint fileId)) return Errno.NoSuchFile;
|
||||||
|
|
||||||
if(!idToEntry.TryGetValue(fileId, out MFS_FileEntry entry)) return Errno.NoSuchFile;
|
if(!idToEntry.TryGetValue(fileId, out MFS_FileEntry entry)) return Errno.NoSuchFile;
|
||||||
@@ -85,6 +87,8 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
|||||||
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if(pathElements.Length != 1) return Errno.NotSupported;
|
if(pathElements.Length != 1) return Errno.NotSupported;
|
||||||
|
|
||||||
|
path = pathElements[0];
|
||||||
|
|
||||||
if(!filenameToId.TryGetValue(path.ToLowerInvariant(), out uint fileId)) return Errno.NoSuchFile;
|
if(!filenameToId.TryGetValue(path.ToLowerInvariant(), out uint fileId)) return Errno.NoSuchFile;
|
||||||
|
|
||||||
if(!idToEntry.TryGetValue(fileId, out MFS_FileEntry entry)) return Errno.NoSuchFile;
|
if(!idToEntry.TryGetValue(fileId, out MFS_FileEntry entry)) return Errno.NoSuchFile;
|
||||||
@@ -155,6 +159,8 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
|||||||
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if(pathElements.Length != 1) return Errno.NotSupported;
|
if(pathElements.Length != 1) return Errno.NotSupported;
|
||||||
|
|
||||||
|
path = pathElements[0];
|
||||||
|
|
||||||
if(debug)
|
if(debug)
|
||||||
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
|
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
|
||||||
string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
|
string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
|
||||||
@@ -239,6 +245,8 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
|||||||
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if(pathElements.Length != 1) return Errno.NotSupported;
|
if(pathElements.Length != 1) return Errno.NotSupported;
|
||||||
|
|
||||||
|
path = pathElements[0];
|
||||||
|
|
||||||
if(!filenameToId.TryGetValue(path.ToLowerInvariant(), out uint fileId)) return Errno.NoSuchFile;
|
if(!filenameToId.TryGetValue(path.ToLowerInvariant(), out uint fileId)) return Errno.NoSuchFile;
|
||||||
|
|
||||||
if(!idToEntry.TryGetValue(fileId, out MFS_FileEntry entry)) return Errno.NoSuchFile;
|
if(!idToEntry.TryGetValue(fileId, out MFS_FileEntry entry)) return Errno.NoSuchFile;
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
|||||||
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if(pathElements.Length != 1) return Errno.NotSupported;
|
if(pathElements.Length != 1) return Errno.NotSupported;
|
||||||
|
|
||||||
|
path = pathElements[0];
|
||||||
|
|
||||||
xattrs = new List<string>();
|
xattrs = new List<string>();
|
||||||
|
|
||||||
if(debug)
|
if(debug)
|
||||||
@@ -91,6 +93,8 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
|||||||
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||||
if(pathElements.Length != 1) return Errno.NotSupported;
|
if(pathElements.Length != 1) return Errno.NotSupported;
|
||||||
|
|
||||||
|
path = pathElements[0];
|
||||||
|
|
||||||
if(debug)
|
if(debug)
|
||||||
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
|
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
|
||||||
string.Compare(path, "$Bitmap", StringComparison.InvariantCulture) == 0 ||
|
string.Compare(path, "$Bitmap", StringComparison.InvariantCulture) == 0 ||
|
||||||
|
|||||||
Reference in New Issue
Block a user