Commit Graph

24 Commits

Author SHA1 Message Date
Stephen Heumann
c6aa37c3ff Add ISC license and apply it to all source files. 2024-07-14 13:48:45 -05:00
Stephen Heumann
cae1983d32 Adjust file attribute mapping for Mac servers.
The macOS server uses FILE_ATTRIBUTE_READONLY in a different way from the Microsoft specifications, so we now try to check if the server is a Mac and adjust the mapping of file attributes accordingly.
2024-05-18 13:39:34 -05:00
Stephen Heumann
96aa55d712 Factor out code for sending close requests into helper functions. 2024-05-17 13:28:55 -05:00
Stephen Heumann
734484abd7 Work around Samba not giving FileStreamInformation for resource fork.
This is essentially the same limitation already handled for macOS, but Samba gives a different error code, so we have to detect that.
2024-05-16 19:11:58 -05:00
Stephen Heumann
6f5976b422 Use compounded messages for GetFileInfo. 2024-05-15 14:06:33 -05:00
Stephen Heumann
ce38f47d69 Always indicate that SMB share volumes cannot be renamed.
This prevents HandleDiskInsert from prompting to rename them if there are duplicate volume names.
2024-05-13 21:39:43 -05:00
Stephen Heumann
10f80c3c77 Change SendMessageAndGetResponse to take a DIB argument.
This consolidates two arguments into one and gives it access to the DIB in case it needs to be modified, e.g. on reconnect.
2024-04-27 20:45:41 -05:00
Stephen Heumann
305283542b GetFileInfo: Work around unavailability of stream info.
Windows does not let us query FileStreamInformation on FAT filesystems, so we should simply treat this as an indication that the AFP info and resource fork are not available, rather than as an error condition.
2024-04-19 22:14:05 -05:00
Stephen Heumann
fdd652c5ca Reorganize files info subdirectories. 2024-04-19 18:42:59 -05:00
Stephen Heumann
93f0e63cce Implement GetDirEntry.
This is an initial implementation that should work but may be fairly slow. It can be optimized later, e.g. by caching directory information and by using the "AAPL" extensions if available.
2024-04-12 22:26:50 -05:00
Stephen Heumann
fa18aa2935 Add some TODOs. 2024-04-10 17:00:42 -05:00
Stephen Heumann
e9c897a34e Implement SetFileInfo. 2024-04-09 21:55:28 -05:00
Stephen Heumann
ca5fc8c362 Rename GetFinderInfo to GetAFPInfo. 2024-04-06 18:00:44 -05:00
Stephen Heumann
895998f3fc GetFileInfo: Skip most queries when only getting access word.
This makes things faster, and may allow the operation to work in some cases where it would otherwise fail because the file is write-only and therefore the AFP Info cannot be accessed.
2024-04-05 17:12:22 -05:00
Stephen Heumann
28392fb1c2 Translate SMB error codes to GS/OS errors. 2024-04-05 17:06:54 -05:00
Stephen Heumann
a59c508f39 GetFileInfo: Initialize resource fork sizes to 0.
Previously, they were not being set for files without a resource fork, so values from a previous file could be returned.
2024-04-04 21:47:38 -05:00
Stephen Heumann
b19a4f28e0 Work around macOS issue with getting info when opening resource forks.
It will not let us query FileStreamInformation on the resource fork (which Windows allows), so we need to open the data fork and get it from there instead.
2024-04-03 21:47:38 -05:00
Stephen Heumann
ec40eb8dd3 GetFileInfo: Try to use allocation size from Create response.
macOS gives the actual allocation size in the Create response, but just sets the allocation size equal to the EOF in FILE_STREAM_INFORMATION. To give more accurate results in such cases, we take the allocation size from the Create response if it is available and still seems to be accurate.
2024-04-03 21:10:10 -05:00
Stephen Heumann
efd1e729c9 GetFileInfo: Use attributes and dates from Create response.
This allows us to eliminate the separate query for them.
2024-04-03 19:01:07 -05:00
Stephen Heumann
9d8f902e85 Implement Create. 2024-04-03 18:49:02 -05:00
Stephen Heumann
1ce929352d Support return file info from Open.
This shares most of the same code used for GetFileInfo.
2024-04-01 22:09:34 -05:00
Stephen Heumann
704d8ce1e7 Implement GetFileInfo.
This also introduces several helper functions used to get the information and convert it into appropriate formats.
2024-04-01 17:12:49 -05:00
Stephen Heumann
f5f68925d0 Allocate a VCR for the mounted volume.
This allows regular GS/OS calls to be made on it, but they currently just give an error.
2023-12-22 22:30:29 -06:00
Stephen Heumann
633c813ef3 Add framework of FST calls. 2023-12-15 17:36:27 -06:00