Logo by Browallia (anonymous IP: 3.148.117.237,0) | ||||||||||||
| ||||||||||||
Audio (343) Datatype (51) Demo (203) Development (602) Document (24) Driver (97) Emulation (149) Game (1011) Graphics (500) Library (118) Network (234) Office (66) Utility (932) Video (69) Total files: 4399 Full index file Recent index file
 Amigans.net  OpenAmiga  Aminet  UtilityBase  IntuitionBase  AmigaBounty
Support the site
|
[Show comments] [Show snapshots] [Show videos] [Show content] [Show crashlogs] SMBFS 2.22 - A SMB file system wrapper for AmigaOS ================================ SMBFS implements an SMB file system for AmigaOS. This file system can be used to access files made available by file servers which implement the SMB protocol, such as 'Microsoft Windows' or any other platform which supports the free 'Samba' product. These files can be accessed using shell commands such as 'List', the Workbench or utilities such as 'Directory Opus' as if the file server were a local disk drive. Changelog smbfs 1.103 (14.4.2016) - Added DUMPSMBLEVEL option which controls how much raw data output is produced. By default (level 0) no raw data output is produced at all. Level 1 will print the contents of the command data area. Level 2 will print the raw data used by the respective commands, with any management/control information stripped off. smbfs 1.104 (16.4.2016) - For smb_request_write_raw() return values of 0 now indicate success. - Simplified the raw read portion of smba_read() by removing the test that avoids dropping into a read loop below. The loop handles the special case well. - Recalculated the overhead for SMB_COM_READ. It's still 52 bytes, but now the documentation states how this number comes about. - Recalculated the overhead for SMB_COM_WRITE. It's 52 bytes and not 56 bytes. - Recalculated the overhead for the SMB_COM_WRITE_RAW command, and it's 63 bytes, not 4. - Unless smb_proc_write_raw() finds that sending the packet results in a transmission error, it will try to pick up the server responses. Previously, it would not even try that, which could deadlock the client<->server message exchange. smbfs 1.105 (16.4.2016) - Fixed decoding of maximum buffer size; this used to come out as 0, which made smbfs switch back to the default minimum supported (1024 bytes). - Corrected use of the maximum raw write size as the size used by the client to perform raw reads with. The maximum allowed are 65535 bytes for a raw read request. Likewise, the maximum raw write size is 65535 bytes, too. smbfs 1.106 (17.4.2016) - More detailed error class/code translation information now shows up in the debug log. - The SMB dump output can now be stored in a file, rather than having to be redirected to one. When storing it in a file, the output will be appended to an existing file, otherwise a new file will be created. - The raw read/write functions now respect the upper limit for the amount of data to be written, as given by the server. smbfs 1.107 (20.4.2016) - Added WRITEBEHIND and PREFERWRITERAW options. WRITEBEHIND will allow SMB_COM_WRITE_RAW commands to complete asynchronously. PREFERWRITERAW will make the file system use SMB_COM_WRITE_RAW over SMB_COM_WRITE when it has a choice. smbfs 1.108 (23.4.2016) - Now properly handles the error code returned when Samba is asked to remove a non-empty directory. The error is translated to ENOTEMPTY. smbfs 1.109 (23.4.2016) - Activated the PREFERWRITERAW option which had not been wired up yet. Oops :-( Turns out that with this option enabled write operations are indeed slower than the with the adaptive SMB_COM_WRITE/SMB_COM_WRITE_RAW code, on account that that SMB_COM_WRITE_RAW transmits the data in two packets, plus overhead for the server response. - Recalculated the threshold below which a write operation will be performed using SMB_COM_WRITE instead of SMB_COM_WRITE_RAW. - Fixed how the WRITEBEHIND option for the SMB_COM_WRITE_RAW command is implemented: the client must not wait for the server to acknowledge the command. - Investigated the performance difference between SMB_COM_WRITE_RAW using the "write behind" and "write through" modes. In my tests the difference came down to about 10% performance gain for the "write behind" mode. - Compared the performance of plain SMB_COM_WRITE (Windows 7) and the adaptive SMB_COM_WRITE/SMB_COM_WRITE_RAW (Samba 3.0.25). The adaptive SMB_COM_WRITE/SMB_COM_WRITE_RAW is about as fast as the plain SMB_COM_WRITE, with "Windows 7" running on the same machine as WinUAE (with AmigaOS 3.9) and Samba running on a local server connected via GBit Ethernet. This means that SMB_COM_WRITE is significantly slower with Windows 7. smbfs 1.110 (1.5.2016) - Added the DEBUGFILE/K option. Not everybody has Sashimi or a tool like it running in the background, which makes sharing file system level debug information difficult. smbfs 1.111 (11.5.2016) - You can now identify smbfs by checking the DosList->dol_misc.dol_volume.dol_DiskType field. It will read back as 0x534D4200, which is equivalent to the signature "SMB�". This change was suggested by Chris Handley and Chris Young. Thank you very much! smbfs 1.112 (26.9.2016) - The negotiation in smb_proc_reconnect() picked up the server's maximum buffer size and then always added 4 bytes on top of it. From the looks of it, this was intended to account for the 4 byte NetBIOS session header to be prepended to each SMB command block. In practice it could push the size of a write operation beyond what the server would accept. smbfs 1.113 (29.9.2016) - Removed the SMB_HEADER_LEN constant, since it wasn't actually referring to the length of the SMB header, but the NetBIOS session header plus the SMB header. This led to some confusion as to what exactly the packet byte offsets used by "proc.c" would reference. - "proc.c" now lists the byte offset values into the packet buffer, so as to make it clearer what exactly is being referenced. - smb_valid_packet() now correctly displays the expected and actual packet size. - smb_setup_header() no longer includes the NetBIOS session header in the total message length calculation. Which means that smbfs no longer sends packets with a NetBIOS header which claims that the messages should be longer than they actually are. - smb_proc_write_raw() no longer cares about the number of command words, but only about the number of data bytes and the command, when waiting for a raw write operation to conclude. smbfs 1.114 (1.10.2016) - The packet buffer size is now increased during the protocol negotiation, if the default buffer size proves to be too small. This avoids trouble with the MAXTRANSMIT option, which used to leave the original packet buffer size unchanged, and too short. - The raw write operation no longer stumbles into a 0 length write, which the server would not expect and not respond to. - Moved the test for the "write behind" option in the raw write operation so that it is handled before the server response (which hasn't arrived yet) is checked. - Verified that the raw write operation can deal properly with the server response (interim update and write completion). smbfs 1.115 (2.10.2016) - The MAXTRANSMIT option controls how much data smbfs is prepared to receive. That value cannot be smaller than 8000 bytes, and it cannot be larger than 65535. The code which sets up this parameter and verifies that it is in range is now implemented only once, and not twice in different places. - The MAXTRANSMIT option also controls how much data smbfs may send to the server. This limit is no longer capped at 65535 bytes. - The size of the message reception/transmission buffer can no longer be smaller than 8000 bytes and it cannot be smaller than the number of bytes which may be sent to the server. smbfs 1.116 (3.10.2016) - smb_receive_trans2() now verifies that the amount of data received is not larger than the maximum acceptable by the client. Previously, it compared the amount of data received against the server's upper limit. Ouch :-( - smba_readdir() now stops immediately if no directory entries are supplied. Previously, it could deliver a bogus directory entry to the scanning function. - The number of directory entries accepted by smb_proc_readdir_short() is now calculated according to how much data the client will accept, and not according to the server's limit. - smb_proc_readdir_long() now reports how much data the client will accept, rather than how much the server will accept. This was problematic because that number is a 16 bit value, and the server's maximum transmission value could be larger than 65535 bytes, causing directory scanning to fail because the truncated 16 bit value could be too tiny to report even a single result. smbfs 1.117 (11.4.2018) - Looks like the SMB_COM_WRITE_RAW implementation is really as simple as the documentation suggested. Just two packets need to be sent to to the server. smbfs 1.118 (29.4.2018) - Added const qualifier to pointers to immutable data, to identify further trouble spots. - Replaced some instances of memcpy() with memmove(). For all others a debug version of memcpy() is being used which should log an error if the source/destination should overlap. - When started as a shell command, error messages now go to stderr, if possible. - Action_ExamineObject() could remove the leading '' path separator from the internal representation of the object's path name, but fail to remember that it had truncated the name. This would result in Examine() returning a file/directory name with a trailing NUL character. The file system cannot access an object by that name, which means that it would report an error for an object which clearly exists. Fixing this bug might just resolve a number of inexplicable file access errors. smbfs 1.119 (1.5.2018) - Replaced the constant 4 with what it actually stands for, this being the size of the NetBIOS frame header (NETBIOS_HEADER_SIZE). - The debug output no longer includes any plain text passwords. Note that weakly-encrypted password data may still show up, though. - The size of the packet buffer used for transmission and reception of NetBIOS frames is now stored properly and does not include the extra 512 byte safety margin added to the end. - How much data the SMB_COM_READ/SMB_COM_WRITE and SMB_COM_WRITE_RAW may receive and transmit is now decoded much more accurately, with the respective limitations (local transmit buffer size, server's reported size limits) taken into account. - Renamed the various "maximum whatever size" variables used by the SMB_COM_READ/SMB_COM_READ_RAW and SMB_COM_WRITE/SMB_COM_WRITE_RAW commands to make it slightly clearer which respective command the limitations apply to. smbfs 1.120 (1.5.2018) - Both SMB_COM_WRITE and SMB_COM_WRITE_RAW commands would copy the data to be transmitted into the transmit buffer and then send the transmit buffer contents. It is not actually necessary to make this redundant copy because the contents of the NetBIOS frame header and the SMB commands do not depend upon knowledge of what's in the data to be sent. So we just send the header with send() and the data with another send() call. This might improve write performance somewhat. Note that the payload of the write operations will no longer show up as part of the SMB dump, as it is transmitted later. Similar code exists for SMB_COM_READ, but smbfs will always try to use SMB_COM_READ_RAW first, which does not return its data in a separate NetBIOS frame whose contents first have to be picked apart. No change should be necessary here. smbfs 1.121 (4.5.2018) - Replaced sendto() with send(), and recvfrom() with recv() where possible. - When reading directory entries with ExNext(), entries with names longer than 107 characters will now be skipped. It worked like that for Examine() already, which flagged overly long names with the error code ERROR_INVALID_COMPONENT_NAME. - Dropped the stub functions smb_request_ok_unlock() and smb_setu_header_exclusive() which were remnants of the original smbfs kernel code but served no practical purpose. - Added additional buffer overflow checks. - When reading and decoding directory entries, the buffer to hold the individual names is no longer grown by single bytes, but in steps of 16 characters, if needed. - Simplified smb_request_write_raw(). - Removed unused local variables and function parameters. smbfs 1.122 (5.5.2018) - Rewrote smb_receive_trans2() for better readability, replacing the multiple pointer dereferentiations. Any error code returned is now converted from whatever seems most appropriate instead of passing EIO to the caller, expecting the caller to perform the conversion (which it doesn't). - smb_release() now just closes the socket and does not allocate it again. smb_connect() reallocates the socket if necessary. - smb_connect() now shows which server IPv4 address is being used. - Added more debug output to sock.c, especially for all those cases which just returned error code EIO without stating what led to this point. - proc.c no longer uses type 'word' function parameters and local variables unless these absolutely have to be unsigned 16 bit integers. This is what finally (!) made the SMB_COM_WRITE command work properly with 65535 bytes to be written. Because the final NetBIOS frame size came out as 65583 bytes (which the NetBIOS frame handles fine), and the size parameter being a 16 bit integer, the truncated size (47 bytes) wreaked havoc all over the place. smbfs 1.123 (6.5.2018) - smb_proc_readdir_long() could return an error code which would be mistaken as the number of directory entries available. The error code should have been negative. Fixed. - Action_ExamineObject() failed to compare the correct file name length against the maximum permitted file name length. It retained the full path name length, which could lead to the operation being aborted. The same problem also existed in Action_ExamineFH(). - The buffer size check in the UTF-8 conversion code used by Action_ExamineObject() should have verified that the name in ISO 8859-1 form fits into the name buffer. Fixed. - Time stamps used for cache validation are now unsigned integers rather than signed integers. smbfs 1.124 (6.5.2018) - recv() returning 0 is now consistently treated as it should be: end of stream. - SMB_COM_READ now receives the inbound data straight into the file read buffer instead of into the packet buffer, from which it would then be copied into the file read buffer. smbfs 1.125 (8.5.2018) - smba_write() no longer decides on the fly whether or not it should use SMB_COM_WRITE or SMB_COM_WRITE_RAW. It's either one or the other now, and the same command is used throughout the entire write operation until it has failed or is finished. - The write operation no longer stops if fewer data could be written than expected. This is documented and not an error. - smba_read() now also sticks to either SMB_COM_READ or SMB_COM_READ_RAW. - You can disable the use of SMB_COM_WRITE_RAW and SMB_COM_READ_RAW, respectively through the new DISABLEWRITERAW and DISABLEREADRAW options. These are intended for testing purposes only. smbfs 1.126 (9.5.2018) - Added the TIMEOUT option which can be used to set a send/receive timeout. The timeout is given as the number of seconds to wait for the reception/transmission to pick up again. If it fails to pick up an error condition will be flagged. - Not all the calls to the recv() function took into account that the request to read the incoming data could be fulfilled only partly. The recv() calls have been replaced by a single function which makes sure that either all the requested data has been received, the connection has been closed or an error has occured. This bug is at least 20 years old, since it is present in the original "Sharity-Light" code which I ported in the year 2000. smbfs 1.127 (10.5.2018) - If the smb_receive_raw() function receives fewer data than expected it will always lead to the connection getting closed. Previously, missing data could lead to the session getting out of sync with what the server expected the client to process. smbfs 1.128 (10.5.2018) - Added support for built-in CP437 and CP850 "OEM character set" translation. CP850 appears to be the default character set encoding for file and directory names which Samba uses. - The code page based translation now checks if the respective file or directory name can be translated and will ignore or reject it if necessary. smbfs 1.129 (13.5.2018) - The SMB protocol error information (error class and error code) is now retained in untranslated form for the AmigaDOS file system layer to report and maybe convert into a more suitable form. - Error reporting ("something's wrong"), and specifically what is wrong are no longer the same thing throughout the file system code. This allows for the SMB protocol errors to be distinct from the POSIX error information, which previously was lumped together and made it harder to act upon. For example, a protocol error could be misinterpreted as a network error, causing the server connection to be dropped when this was not strictly necessary. - SMB message decoding now produces its own specific error codes instead of using EIO. The errors which the directory entry decoding has to put up with are now specific to this function's purpose. smbfs 1.130 (13.5.2018) - Failure to set up an SMB session with the server is no longer reported twice. - Failure to set up an SMB session with the server is no longer reported twice. - SMB session setup error messages now display the SMB error information, if available. - The debug output now prints the SMB error information along with the POSIX version and the AmigaDOS version. This might finally produce the kind of insights which so far have been denied to us during long data copying sessions which either stalled or stopped for no apparent reason. smbfs 1.131 (14.5.2018) - Hitting Ctrl+C (or using the Break shell command) no longer allows smbfs to shut down and then retry to open the connection to the server. - smb_proc_read(), smb_proc_read_raw(), smb_proc_write(), smb_proc_write_raw(), smb_proc_create(), smb_proc_trunc(), smb_proc_getattrE(), smb_proc_setattrE() and smb_proc_dskattr() now try to reconnect to the server if the connection was broken by the previous network access. - The reconnection attempt no longer overwrites the previously recorded error code if it fails to succeed. smbfs 1.132 (19.5.2018) - If raw SMB mode is not used, the NetBIOS session setup now works again. - Reading directories which contain long names supports only the two documented entry formats now. All the other formats which might or might not have been supported by OS/2, etc. are gone now. This simplified the whole overly complex directory scanner code. - Directory entries whose names are too long are now skipped while reading the directory, rather than getting truncated. - Replaced the deprecated commands SMB_COM_CREATE, SMB_COM_OPEN, SMB_COM_QUERY_INFORMATION_DISK, SMB_COM_QUERY_INFORMATION, SMB_COM_CREATE_DIRECTORY and SMB_COM_SET_INFORMATION with their CIFS counterparts. The old commands are still in place, on the off chance that you just might want to connect smbfs to an OS/2 or Windows 3 server. - If possible, SMB_COM_WRITE_ANDX and SMB_COM_READ_ANDX will now be used in place of the older SMB_COM_WRITE/SMB_COM_WRITE_RAW and SMB_COM_READ/SMB_COM_READ_RAW commands. This makes both read/write operations much simpler than they used to be. - Just to repeat the point here: smbfs no longer uses any SMB commands which the CIFS documentation describes as either "deprecated" or "obsolete" (unless the server which smbfs connected to does not support the LAN Manager 2.0 or NT LAN Manager protocols). - Removed the use of the SMB_COM_SEEK command, which wasn't doing anything useful in the first place: none of the read/write commands actually required it (this is the one command which the CIFS documentation labeled as "obsolete"). - ACTION_SET_FILE_SIZE now actually works: you can make files both shorter or longer, as needed. Previously, you could not make files any shorter, only longer. - Added the NATIVEOS option, which allows you to override the default of "AmigaOS", in case this should be necessary. - smbfs now reports itself ("Native LAN Manager") as "smbfs" with the version number tacked on ("smbfs 1.132"). - Changed the translation of the POSIX error codes EPERM (operation not permitted) and EACCESS (permission denied) from "object not found" to "read protected". This is less misleading, but not much clearer either. Pity that we don't have an AmigaDOS error code which matches the blanket "you can't do that" error. Anyway, if it says "read protected" it now indicates a permission problem, rather than suggesting some file or directory does not exist. - Changed the translation of the POSIX error codes EADDRNOTAVAIL, ENETDOWN, ENETUNREACH, ENETRESET, ECONNABORTED, ECONNRESET, EHOSTDOWN and EHOSTUNREACH from "object not found" to "directory not found". This is still a poor match for the purpose of the error flagged, but at least you'll get an idea that something isn't accessible on the network, rather than file or directory might be missing. - Open(...,MODE_NEWFILE), which translates into ACTION_FINDOUTPUT, can finally truncate an existing file, or will create it if it does not exist. This uses the SMB_COM_NT_CREATE_ANDX command, if available (too bad for OS/2, etc.). - Simplified the Seek() handling, because the formerly underlying SMB_COM_SEEK was basically only slightly worse than useless. - Added another (so far) unaccounted error code (123) to the list of errors for which we have labels. - Verified that the directory scanner built on top of the SMB_COM_TRANSACTION2+TRANS2_FIND_FIRST2/TRANS2_FIND_NEXT2 commands actually does work. The SMB_COM_TRANSACTION2 message it set up was two bytes longer than it should have been, though. - All file operations (reading, writing, setting the file size, obtaining the size of a file, reading directory entries) now support file sizes larger than 4 Gigabytes. In theory anyway, because the AmigaDOS API is currently restricted to just 2 Gigabytes. Should the need arise, the 64 bit integer values could be made to do the job they were intended for. Note that file sizes > 4 Gigabytes are currently "clipped", which means that only the least significant 32 bits are used. There is is currently no weird workaround in place to avoid the side-effects of this policy. - Updated the 64 bit integer math operations for the SetFileDate() function, which now has to deal with the SMB_COM_TRANSACTION2 TRANS2_SET_FILE_INFORMATION command. TRANS2_SET_FILE_INFORMATION uses 64 bit date/time. - Opening a file or directory, which is something akin to the AmigaDOS Lock() operation, now defaults to read access unless write access is required. The previous implementation always opened for read/write access, and if that didn't work, tried again with read access only. The read/write access is rarely needed, but is mandatory for file/directory delete operations. - Manipulating file/directory attributes (which consists of flipping the "protection bits" for "read-only" and "was archived" as needed) is much simplified and no longer requires figuring out if the OS/2 or MS-DOS server at the other end of the connection can handle extended file attributes (unless you desperately want to, of course). - Changing the attributes of a file/directory (as in: flip the "read-only" and "was archived" bits) is now distinct from changing the size of a file. smbfs 1.133 (20.5.2018) - The transmit buffer overflow check no longer warns about an overflow for the SMB_COM_READ_ANDX command. - Reinstated the SMB_COM_CREATE_DIRECTORY command, since the TRANS2_CREATE_DIRECTORY command (recommended) does not appear to work with Samba 3.0.25. - Creating a new file (through Open(..,MODE_NEWFILE)) will no longer end up creating a hidden file on the server. For good measure, I also added creation options to the effect that the object to be created must not be a directory, and that it is intended for random access. - The "read only" attribute now maps to the Amiga "protected from deletion attribute" only. Previously, a "read only" file on the server would be reported as being both protected from writing and from deletion. On the Amiga side, protecting a file from deletion only changed the file on the server to "read only" if the protection from writing was in effect, too. Now we have a functionally identical mapping which hinges only on the delete protection. smbfs 1.134 (20.5.2018) - Ouch, so smb_trans2_request() no longer has to return any transaction parameter or data response information, but the code still updated the respective pointer and length information passed as pointers, even if these pointers were NULL... smbfs 1.135 (21.5.2018) - Creating a new file failed to close it after having just created it. Because file IDs are 16 bit integers, at some point the SMB server would have run out of IDs. It was reported to me that one SMB server may have refused to assign any further file IDs after 500 files were created. - When creating a file using SMB_COM_CREATE, the read-only, archived and system attributes are no longer set. We just create a "normal" file. - If the connection to the server is no longer reliable, it will actually get closed now, to be reopened later (maybe). - Added a check to verify that prior to deleting a file or directory, all currently active file handles referring to the same file can be closed. This also goes for renaming files. - Added a safety check to make sure that a file/directory which has already been opened is not opened again. Note that this should not strictly be necessary, but the current smbfs "architecture" identifies files and directories internally through their fully qualified path names rather than their file IDs. - During session setup smbfs now properly reports that it supports raw read/write mode, large readx/writex mode, the TRANS2_FIND_FIRST2 and TRANS2_FIND_NEXT2 commands and 64 bit file offsets (sort of). - The length limits of the server and client names (16 characters) are now only enforced if NetBIOS session setup is used (which is disabled by default). The length of the workgroup/domain name is not checked any more (maximum length was 15 characters). Note that length limits may still exist which the server enforces and complains about. - When creating new files the sharing permissions now include deletion, too, just in case you need to remove debris after smbfs had to be shut down, or your Amiga needed to be restarted. - The "pure" file protection bit is no longer associated with the "system" attribute of a file or directory. This leaves only the "read-only" and "archived" attributes for manipulation. - Connecting and reconnecting to the server now obeys the same timeout restrictions as the read and write operations. Should the server communication fail because of a timeout, reestablishing a connection to the server should no longer hang indefinitely. smbfs 1.136 (22.5.2018) - The network connection opened for the server now has the "keepalive" option enabled, just in case... - Looks like reconnecting to the server after that connection broke down or was severed never actually worked for read, write, record locking and file attribute operations. Now it might just work... smbfs 1.137 (24.5.2018) - Updated the table of error codes which eventually get translated into AmigaDOS error codes. Quite a number of error codes were not properly covered. - We now show how much memory smbfs has used (in debug mode), and how much memory has not been released yet. - Trying to delete a file or directory now first checks if there is still a file handle or file lock attached to it. That test has been missing for the past 18 years... - When trying to delete a file or directory, smbfs now asks the server for write access permission first. The server might want to object to this request before everything gets really serious. - Added more debug output to show when a file/directory is being opened, and in which mode, and when it is closed. We also show how much of these file/directory references are currently in use. - When performing SetDate(), SetProtect() and SetFileSize(), the respective file/directory is now opened in write access mode. - SetProtect() now only permits you to change the "archived" and "delete protected" attributes. These are the only attributes which the SMB server really cares about on the file system level. - Extended the "safety margin" for the SMB receive buffer to 1024 bytes (used to be half that much, but Samba uses double). - smbfs now only sends a NetBIOS broadcast name query for the server name that's part of the share if the server name is shorter than 15 characters. If it's longer, the DNS lookup better work instead. - If a file to be deleted has the "hidden" or "system" attributes set the SMB_COM_DELETE command is no longer ignored. - Added further tests to figure out if a directory could not be deleted because it was not empty. However, it's difficult to tell all three cases apart which share the same error code. We'll try anyway... smbfs 1.138 (25.5.2018) - The name translation performed by the directory scanning code is now a bit more paranoid than before. They will check if the names can be translated into something suitable for use on the Amiga. This rules out control characters, for example. If a name is unsuitable, an explanation why it is unsuitable will be printed in the debug output. - The SBM directory scanning code which uses the TRANSACT2_FINDFIRST2 and TRANSACT2_FINDNEXT2 commands now uses the correct flag codes instead of naked numeric constants. - Removed support for the "write raw" and "read raw" commands, which extends to the command line parameters and tool types which could be used to disable them or adjust how they would be used. smbfs 1.139 (26.5.2018) - Added more const qualifiers to pointers, so that unintended changes are more easily detected. - Text that uses 8 bit characters now uses type TEXT rather than UBYTE, and TEXT * replaces STRPTR where it makes sense. - Text buffer size and maximum size (without terminating NUL byte) of the string that may be stored in there are now distinct. - Building the error message list for display in an error requester is now more efficient, as it no longer resorts to strcat(). - Removed the last traces of the SMB "system" file attribute and its mapping to the "pure" protection bit on the Amiga. - File sizes returned (through the Examine(), ExNext() and ExAll() functions) now refer to the original SMB file size information which may be a 64 bit integer. Same goes for the file sizes referenced by Seek() and SetFileSize(). Note that for now the sizes returned will be truncated, which means that if they exceed what an unsigned 32 bit integer may represent, then the number 4294967295 will be used instead. There could be hilarious consequences: watch out! - When scanning directory contents, names which end up containing unprintable names (not "#$()&%*!") after conversion to Amiga format are now ignored. - Reading/writing files updates the internal seek position of the respective file, which is now a 64 bit integer. You can actually read from files > 4 Gigabytes (and write to them, too) as long as you do not use Seek(file, ..., OFFSET_BEGINNING) because that will box you into the first 4 Gigabytes of the file. Note that the result of Seek() and SetFileSize() will be a truncated position (4294967295) if the position happens to be beyond what can be represented by an unsigned 32 bit integer. Because "4294967295" is also known as the signed 32 bit integer "-1" you probably won't be able to tell it apart from a seek error (unless you check the IoErr() value, of course, but who does?). This used to be a problem with "normal" Amiga file systems, and now it's a problem again :-( - When decoding directory entry data, we no longer replace the "last change" time with the "last write access" time, and then swap both time records again (who ordered that?). The "last change" time now stays the last change time, and this is what goes into the Amiga FileInfoBlock/ExAllData records. - The debug output for the directory scanner now prints the original untranslated name in 'C' style escaped form, in case this might reveal further insights into why the directory entry names look like they do. Note that all file, directory and path names used by the SMB file system layer now appear only in escaped form, which means for example that all backslash characters which serve as path delimiters show up twice as much. smbfs 1.140 (27.5.2018) - When opening a file or directory for access, the access rights required now follow the original smbfs implementation which always required write access regardless of whether it was needed or not. If write access was not available it would retry using read-only access. The new code now starts with write access, even if only read access was required, and will retry with read-only access if needed. However, if write access was required, no retry with read-only access will be made. - Only the directory cache needs to keep track of how much memory is available for storing file and directory names during directory scanning. Opening a file or directory doesn't have to bother, which is why smbfs can now do its job without allocating a minimum of 256 bytes per path name. This also simplified the path name management. Incidentally, the path name management could not reliably guarantee a NUL-terminated buffer :-( - Finally figured out why files or directories created through smbfs could not be deleted again: smbfs could end up marking them as "ready-only". Fixed! - Found and fixed a few utterly embarrassing "use after free" cases, which thankfully had little impact :-/ - The debug code now shows which file IDs the server assigned to opened files/directories. smbfs 1.141 (28.5.2018) - smbfs now makes sure to dispatch any "keep alive" NetBIOS messages which the server might send. This should avoid the problem of these messages piling up in the inbound traffic queue until all receive buffers have been consumed by them. - When opening a file or directory the desired access modes are no longer "generic read" and "generic write", but very specific to the access mode. Write access now uses "read data", "write data" and "delete file", whereas read access uses "read data". On top of that "read attributes" and "write attributes" are also requested. smbfs 1.142 (30.5.2018) - Deleting entries from a directory no longer directly collides with directory scanning if the same process is reading the directory contents and deleting them one at a time. This means that the "delete foo all" command may work better than before (or maybe not). - Constructing the parent directory path of the file/directory to be deleted now figures out how long the parent directory name is before copying it, rather than copying the full name of the file/directory in question and then truncating it. Also, the new code handles deletion from the root directory better. smbfs 1.143 (30.5.2018) - Renaming a file or directory can restart filling the directory scan cache if the file/directory was moved from its home directory to a different directory. smbfs 1.144 (1.6.2018) - When closing a file its modification time is no longer updated unless its contents had been modified. Simply accessing a file or directory without writing to it no longer has the effect of bumping its modification time. - If reading from a file failed, the error code was not translated properly for AmigaDOS and always came out as ERROR_ACTION_NOT_KNOWN. Fixed. - Dropped the NATIVEOS switch and the corresponding tool type. - Added the UNICODE switch and the corresponding tool type. This switch will enable limited Unicode support for servers which cannot deliver proper directory information, such as the Samba 3.0.37 version which is part of the FRITZ!Box firmware. Note that once Unicode support is enabled, the UTF8, CP437, CP850 and TRANSLATE options will be ignored. smbfs 1.145 (2.6.2018) - I broke renaming by mixing up the length of the new name with the old name length. Fixed. - Renaming now also works on hidden files and system files, just like deletion works on system files and hidden files, too. Keep in mind that a file or directory which is not write-enabled cannot be renamed (that's what the documentation says, anyway). - Plugged the SMB_COM_READ_RAW/SMB_COM_WRITE_RAW code back into the file system. Added support for 64 bit file position information. smbfs 1.146 (3.6.2018) - Added extra sanity checks for file handles and file locks, which should prevent files from getting closed twice, or locks from getting freed twice. We also detect files and locks which smbfs does not know and reject these before it's too late. - Dropped more unused code, e.g. in the cache invalidation function. - Instead of using local string buffers, we now allocate memory for the buffers instead. This avoids truncating path/service names if these would have become too long for the original local string buffer to hold. - Added the options PREFERWRITERAW, PREFERREADRAW and WRITEBEHIND. The first two will make smbfs use SMB_COM_WRITE_RAW over SMB_COM_WRITE_ANDX and SMB_COM_READ_RAW over SMB_COM_READ_ANDX, respectively. WRITEBEHIND activates somewhat asynchronous SMB_COM_WRITE_RAW operations, but don't get your hopes up just yet, as the effects are (so far) rather minor. Careful about the PREFERWRITERAW/PREFERREADRAW switches: if the server does not support these operations, smbfs will fall back onto the original SMB_COM_WRITE and SMB_COM_READ commands which cannot be used safely with files larger than 4 Gigabytes. - Changed the command template: the debug options are now at the end of the list. - The use of the DEBUGFILE option would pretty reliably trigger an Enforcer hit, followed by a system crash. Note to self: don't leave dangling BPTRs behind. - If no modification time is provided for a directory entry, the creation time will be substituted for it. smbfs 1.147 (5.6.2018) - When processing the icon tool types, the values given for TZ/TIMEZONEOFFSET and DST/DSTOFFSET would override each other. Fixed. - Path names which carry meaning within the AmigaDOS semantics (e.g. "dev:foo/bar//baz", which is the same as "dev:foo/baz") but do not necessarily have the same meaning or any meaning at all within SMB path names are now preprocessed so that they always come out as the proper absolute SMB path names required. smbfs 1.148 (8.6.2018) - Changed how the TZ/TIMEZONEOFFSET parameter works: for time zones east of GMT (such as CET) the number of minutes given now has to be positive (e.g. CET -> TZ=60). This follows the practice of describing a time zone relative to GMT, rather than how many minutes need to be added to current time to bring it to GMT. Hence, with TZ=60 you now state that your local time zone is 60 Minutes ahead of GMT. - If the server shuts down the network connection smbfs should no longer wind up discovering that no more data would be forthcoming from the server, over and over again in a loop. - When creating directories or files, smbfs now requests write access to the parent directory of the object to create. - Consolidated all the SMB path name parsing and processing code into a set of functions which should (hopefully) be more robust than what was previously available. This simplified the code which needed to know the parent directory of a file/directory. - Moved the file and path name conversion which deals with the translation from Amiga (ISO-8859-1) to SMB (UTF-8, CP437, CP850, etc.) into two functions (encoding and decoding) instead of replicating essentially the same code in almost all the packet handling functions which deal with names. - Cleaned up the naming of functions and data structures a bit. smbfs 1.149 (9.6.2018) - Reworked the path name conversion code again. It now correctly handles "foo" which becomes "", and it will always remove a trailing "" character from a path because unlike in AmigaDOS, the SMB path name only uses "" characters in the path name as delimiters: at the end of a path a delimiter has no meaning. - Tried to improve the contents of the error messages which smbfs will print when it cannot use the service and share name information, such as if the syntax has problems or the server name or network address cannot be looked up. smbfs 1.150 (10.6.2018) - File comments are no longer rejected, they are merely ignored just like any attempt to change the hold, pure, script, execute, read and write protection bits of files and drawers. - The file creation/modification/access/write time information obtained when opening a file through SMB_COM_NT_CREATE_ANDX was "converted" to UTC, which is not correct. Only the older SMB_COM_OPEN command would provide local time information which had to be converted to UTC first. Same problem for the TRANSACT2_QFILEINFO command. Fixed. - Just to see if it has a positive impact, SMB_COM_NT_CREATE_ANDX is now replaced by SMB_COM_CREATE for the purpose of creating new files. At least one Samba version crashed with the SMB_COM_NT_CREATE_ANDX command in use. - If reading the keepalive packets sent by the server turns out to detect a broken server connection, we now shut it down on our side rather than waiting for a retry. smbfs 1.151 (11.6.2018) - The WORKGROUP parameter is no longer mandatory. If you omit it, then the default text "WORKGROUP" will be used. - The UNICODE parameter now expects ON/OFF as arguments rather than being a simple enable switch. Note that the default is UNICODE=ON now, which means that if both server and client support Unicode, then smbfs will use it and ignore the TRANSLATE, CP437 and CP850 parameters. - Added the PROTOCOL parameter which can be either NT1 or CORE, with NT1 being the default. If you use PROTOCOL=CORE, then none of the new SMB commands (introduced in 1994) added to smbfs will be used, which might make smbfs work more robustly with certain servers. - smbfs now only asks the SMB server for write access to a file or directory if that file is to be written to, or if the file/directory attributes are to be modified. I double-checked that these constraints are followed consistently. - Reworked the logic for Open() with MODE_OLDFILE/MODE_NEWFILE and MODE_UPDATE. MODE_OLDFILE will open the file for read access and implies a shared lock. MODE_NEWFILE will open the file for read/write access and truncate it to 0 bytes, creating it if it does not yet exist, and implies an exclusive lock. MODE_UPDATE will open the file for read/write access and implies an exclusive lock. - When opening a "file" smbfs now checks if the file is really a file and not a directory. The SMB_COM_NT_CREATE_ANDX and SMB_COM_OPEN commands can be told not to open a directory if a file is expected, but the current smbfs implementation makes it a wee bit too difficult to plug this into the API :-/ Well, we may see about this later. smbfs 1.152 (11.6.2018) - Ouch. Forgot that pretty much all the core functions were still not supporting Unicode mode. Fixed. smbfs 1.153 (14.6.2018) - The modification time of files which were written to no longer get updated when those files are closed again. We now trust the server's file system to do its job. - The SMB_COM_READ_RAW and SMB_COM_WRITE_RAW commands did not reopen the files they were handling after succeeding in reestablishing a connection to the server (following a timeout and whatnot). Fixed. - If a command fails because of an error, we now only try to reestablish a server connection and repeat the command if the error reported is not an SMB protocol error. The protocol error may persist even when trying to repeat the command, but a network error may be resolved by closing the connection to the server and then reopening it. - Removed the UTF-8 translation option, since it is not needed. The SMB protocol as implemented by smbfs only uses UTF-16 (Unicode) or code page based path name encoding. UTF-8 support was added due to my mistaken assumption that what I now know is corrupted data sent by the server may have been UTF-8-encoded. smbfs 1.154 (16.6.2018) - The conversion of UTF-16 text to ISO Latin 1 and vice versa now stops as soon as the limits of the destination buffer have been reached. Previously, the code would still keep looking at what's in the source buffer. - The log output now also includes information on how long the configured read/write/connect timeout is. - The QUERY_PATH_INFO command now decodes the path name, if possible. This information is logged but not used for anything else yet. - smb_proc_create() no longer closes the file just created. The function calling smb_proc_create() now takes care of that (which would be the smba_create() function). - Added more debug output, covering the program options, directory entry decoding and other particularly exciting minutiea :-/ - The SMB_COM_WRITE_RAW did not properly fill in the 64 bit integer write offset, of which only half of the most significant 32 bits were stored in the command buffer. On top of that, the maximum size calculated as being available for the payload to be sent to the server was too small by four bytes. Ouch :-( - The test to verify that reopening the server connection has succeeded should have tested for a return value >= 0, instead of == 0. The problem is really with the API design of smb_request() and smb_request_ok() which either return the number of bytes received (for success) or -1 (for failure). So, the solution is to make both smb_request() and smb_request_ok() return 0 for success and -1 for failure. - Added the RAISEPRIORITY option. Instead of always raising the task priority of the smbfs program to 10 while it is running, this is configurable feature now. - You can now stop smbfs even while it's currently polling and processing incoming DOS packets. Between each call to GetMsg() it checks the break signal and will stop as soon as it can. smbfs 1.155 (24.6.2018) - Added a bit more debug output for the time/date conversion which is performed on directory entries. - Directory scanning using the SMB_COM_SEARCH command did not remove padding characters from directory entry names. Fixed. - The MS-DOS date/time conversion for directory entries returned by core protocol commands failed to account for local/utc conversion. Fixed. Now I'm curious if this actually manages to make things worse because the SMB server may have reported its "local time" as UTC :-/ smbfs 1.156 (24.6.2018) - When processing the entries returned by directory scanning the names of entries would not be processed correctly if these were neither NUL-terminated nor NUL-padded. Thanks go to Tony Wyatt for reporting the problem. - When preparing for reading from a file which was not yet ready to be accessed, accessing it could return an error code indicating that the access mode was not correct. Instead of retrying to access the file in read-only mode, the relevant function aborted the access attempt. This has been replaced by asking for read-only access and retrying. Thanks go to Tony Wyatt for reporting the problem. - Slightly more robust handling of ExAll() due to the correct size of the the entry being known more early on. - Printing the list of ExAll() entries to be returned crashed "reliably" if the number of entries was zero. Thanks go to Hubert Maier for reporting the problem. smbfs 1.157 (26.6.2018) - The ACTION_SETDATE implementation now shows the date/time to be used before it is handed over to the respective SMB commands which change it for a file/directory. Because the different SMB commands (three of them) cannot but change three times (creation, modification, access) we now make sure that all three are initialized by reusing the current state of affairs. smbfs 1.158 (27.6.2018) - Changing the attributes of a file/directory, as in "archived" or "deletable" did not work at all in protocol=core because the original code which handled this used the command SMB_COM_SET_INFORMATION2 in place of SMB_COM_SET_INFORMATION. The command SMB_COM_SET_INFORMATION2 can only change time information but not the attributes. I changed this to use SMB_COM_SET_INFORMATION when necessary. - Changing the attributes and/or times of files/directories would have no effect if the server dropped out, the connection had to be reestablished and the file/directory in question had to be reopened because all the attribute and file information was overwritten. Fixed. smbfs 1.159 (29.6.2018) - Examine() did not use the creation time provided by the SMB server in place of the modification time in case the modification time was not currently set. Fixed. - Simplified the handling of the file/directory protection flags. Because only two flags are actually reported by the SMB protocol and may be changed, only these two now receive attention. smbfs still makes up the rest (hold/script/pure/read/write/execute), but the respective group/other read/write/execute/delete flags are no longer filled in. smbfs 1.160 (30.6.2018) - The default for the "protocol" option is now "core" rather than "nt1" because it appears to be generally the most compatible choice. - Delete(), CreateDir(), Lock(), SetProtect(), Rename(), Open(), SetDate() and SetComment() now ignore any part of the path name passed in which includes the name of an assignment, volume or device name (e.g. "smbfs0:directory/file") and only pay attention to the part which follows it (e.g. for "smbfs0:directory/file" only "directory/file" is considered relevant). This is necessary for assignments and also soft links to work. Thanks go to Thomas Rapp for reporting the problem. - The SMB commands underlying the Delete() and Rename() operations support MS-DOS wildcards for selecting the directory entries affected. This is a major problem because there is no "escape" from the wildcard scheme. Hence, attempting to delete a file called "*" will delete everything in the same directory as the file "*". For now I have blocked the use of the "*" and "?" characters in file/directory names for Delete(), Rename(), Open(...,MODE_NEWFILE) and CreateDir(). It's possible that the same restrictions will have to be applied to the '>', '"' and '<' characters which are the Windows NT variants of the MS-DOS '?', '.' and '*' characters used in wildcards. - The SMB_COM_RENAME command needed an extra alignment byte preceding the destination name if Unicode support was enabled. Because the destination name was misaligned, the individual characters were decoded incorrectly by the SMB server. This is what caused the "renamed" directories to wind up in the share's top level directory bearing names composed of Chinese, Japanese and Korean ideographs, none of which were printable on the Amiga. This caused the rename directory entries to disappear from view. Thanks go to Thomas Rapp for finding the problem. - Removed the unused and non-working code for TRANS2_CREATE_DIRECTORY. What remains is the working SMB_COM_CREATE_DIRECTORY support. - Cleaned up the SMB_COM_SET_INFORMATION command setup, which did not zero out the reserved data and added an unnecessary empty string. smbfs 1.161 (6.7.2018) - Simplified the directory entry processing for ExAll(). - The ExAll() entry processing did not handle buffer overflows safely. It failed to detect the case of the first entry to be added to the ExAllData buffer being too large, which should have always resulted in the directory scanning process to be aborted. - All ExAllData buffer entries now have a NULL pointer in the ed_Comment field instead of a pointer to an empty string. This matches the documented behaviour of the Amiga ROM file system. - The ExAll() code now stops reading further directory entries from the server either when it has completely filled the ExAllData buffer or when an error has occured. - ExAll() now ends with result == DOSFALSE and error == ERROR_NO_MORE_ENTRIES only if no directory entry could be read and the server has stated that no more entries will be forthcoming. - ExAll() now assumes that entries of type ED_NAME need to be returned as the minimum requirement. Any values outside the range of ED_NAME..ED_OWNER will be treated like ED_OWNER. smbfs 1.162 (7.7.2018) - Added extra sanity checking for the Examine/ExamineFH code to make sure that the length of the directory or file name in question, which might be the name of the volume itself, does not overrun the FileInfoBlock name buffer. - The FHFromLock code did not verify if the FileLock in question actually did refer to a file. Fixed. - The RenameDisk code did not check if the new volume was sound and suitable for a volume. Fixed. - Added a "bug compatibility" fix for ChangeMode to the effect that if the new mode is one of MODE_OLDFILE or MODE_READWRITE then the mode will be converted to SHARED_LOCK, and if it is MODE_NEWFILE then it will be converted to EXCLUSIVE_LOCK. - Added an example program of how to use ExAll(), for testing the smbfs implementation of this function. smbfs 1.163 (15.7.2018) - The service may now include a port number or TCP service name, e.g //server-name:445/share-name would use port 445 when connecting to the server named "server-name" rather than using the default port number (which depends upon the use of the "netbios" option). - Added the MAXNAMELEN option which can be used to omit files and drawers while drawer contents are searched and returned to the Amiga. Names longer than what the MAXAMELEN option states will be ignored. The MAXAMELEN option default is not to omit any file and drawer names. smbfs 1.164 (17.7.2018) - The result of a successful gethostbyname() lookup does not contain a list of IP addresses and protocol information which can be used straight away. It must be copied to a 'struct sockaddr_in' before it can be used with the connect() function, for example. This led to problems on 68000 machines because the contents of the data structure referenced are not guaranteed to be 16-bit word aligned, for example. Thanks go to Timm Mueller for finding the problem! smbfs 1.165 (19.7.2018) - The device, volume or assignment part of a fully qualified path name must be removed, including the ":" character which terminates it. Previously, the device/volume/assignment name was removed, but a second step further down the line took care of the ":" character. The new approach is more consistent. - Replaced the processing function whose purpose is to combine an existing SMB path name with a translated form of an AmigaDOS path name. The new code works very much like an actual local disk based file system would in handling the ":" and "/" path separators. Previously, the SMB path and the AmigaDOS path were combined and then processed, which could have the effect of quietly swallowing the effects of invalid path specifications. The new code is able to detect these and will report them. - The handling of ACTION_PARENT with lock = root directory is now different from what happens if ACTION_LOCATE_OBJECT is used with name = "/" and the lock = root directory. ACTION_PARENT with lock = root directory are valid parameters and will return the "ZERO lock". ACTION_LOCATE_OBJECT with name = "/" and lock = root directory is not a valid combination and must return failure with error code = ERROR_OBJECT_NOT_FOUND. Without this distinction software may be unable to successfully navigate the file system tree and get stuck in a loop. The new path processing code allows both cases to be different, whereas previously the results could be identical. smbfs 1.166 (20.7.2018) - Added the DISABLEEXALL switch which can be used to completely disable support for the dos.library/ExAll() function within smbfs. Disabling the ExAll() function is recommend if you intend to use software with smbfs which reserves too little memory for the buffer which smbfs is to fill when processing the directory contents it is reading. If there is not enough memory provided, smbfs may eventually stop providing further directory entries, flagging an error. This can give the appearance of smbfs losing directory entries during the scanning process when in fact it stopped because was unable to store the directory entry names in the buffer supplied by the application which invoked it. Stopping because it cannot continue may not necessarily be handled well by the application, which may just treat it no different from the any indication that smbfs has no further entries to provide because the SMB server has already transmitted the last entry. - When running out of space trying store another directory entry, the smbfs ExAll() function could fail to allow for scanning to resume. This would cause smbfs to lose directory entries. - Updated the "exall-example" program to allow easier testing with small buffer sizes. The default buffer size used to be 4096 bytes which failed to reproduce most of the smbfs ExAll implementation problems :-( smbfs 1.167 (20.7.2018) - Added real support for ExAllEnd(). Previously, the implementation was only pretending that it was stopping directory scanning. - Rewrote the ExAll() code again to be clearer with regard to how the data structures are initialized and what its return code means. It now always returns DOSFALSE after the last directory entry has been delivered, since the ExAll() implementation is to mirror what ExAll() would do in the same situation: return FALSE only if it is certain that no more entries can be delivered. smbfs 1.168 (21.7.2018) - Added more detailed information about the sender of a packet, which can now be traced to the CLI number and the name of the command involved, if any. - Open(..,MODE_READWRITE) now attempts to create a file if it does not yet exist, otherwise it opens it for write access. This hasn't worked properly yet. Thanks go to Hubert Maier who provided a test case. smbfs 1.169 (22.7.2018) - Open(..,MODE_READWRITE) implies a shared lock. - The test for MS-DOS characters in the names of files to be created is now delayed for Open(..,MODE_READWRITE) until it is certain that a file needs to be created. - When creating a new file for Open(..,MODE_NEWFILE) or for Open(..,MODE_READWRITE), the process is no longer aborted if the creation fails. Failure may just be the result of a different SMB client succeeding in creating it first. smbfs now tries to create the file and the later attempts to open it. Failure to open the file is then reported as an error. smbfs 1.170 (22.7.2018) - Path name processing failed to deal properly with subdirectories of directories which were located in the root directory. Thanks go to Hubert Maier who reported the problem. smbfs 1.171 (24.7.2018) - Calling Info((BPTR)NULL, parameterBlock) would trash memory. Fixed. - Replaced all the various checks for valid locks and files with common code. smbfs 1.172 (26.7.2018) - SetFileSize() never checked if the volume was write-protected. Ouch. - ExAll() now checks if the type of records it should return is valid, which in this case means if it is > 0. Previously, it treated 0 just like it would treat values > ED_OWNER. Now it rejects 0 with the error code ERROR_BAD_NUMBER. smbfs 1.173 (5.8.2018) - Turns out that there is a counterpart to the broadcast name query which Christopher R. Hertel provided me with. It is possible to ask an SMB server about its own name if you send it a NetBIOS status query, and if it responds to the query. Normally, you'd ask the primary domain controller, which maintains the browse list of all SMB servers in the neighbourhood, but this can work, too. Anyway, you no longer need to add a local DNS record which associates the IPv4 address of a SMB server with the name of that server. smbfs 1.174 (8.8.2018) - "SHARE" is now an alias for "SERVICE". - I no workgroup name is provided, smbfs will now first try to ask the server about its workgroup name before eventually falling back onto the default name "WORKGROUP". - Removed the "PREFERREADRAW" and "PREFERWRITERAW" switches since they lack a purpose, now that "PROTOCOL=core" has been the default operating mode for smbfs for quite a while... smbfs 1.175 (9.8.2018) - The command line template would still include the PREFERREADRAW/S and PREFERWRITERAW/S entries. Fixed. - The debug options and the debug file are now taken care of as early as possible, so as to allow for the icon tool type/shell parameter processing to be logged. - Simplified the process of opening/creating the debug output file. - Which environment variables are used when the WORKGROUP, USERNAME, PASSWORD, DEVICENAME and PROTOCOL arguments are omitted now shows up in the debug output. - All the parameter which control how smbfs works are now shown in the debug output. The password text is omitted, though, but there is a placeholder which indicates whether a password was used, or whether it was omitted. - Added more debug output to the SendNetBIOSStatusQuery() function. - Updated the documentation. smbfs 1.176 (12.8.2018) - The smb_proc_reconnect() function did not handle SMB_COM_SESSION_SETUP_ANDX correctly if Unicode support was enabled both by the server and smbfs. The plain text password should have been transmitted in UTF16LE form, as well as the user name, the workgroup name, the native OS and the native LAN manager information. Strangely, with these corrections the session setup no longer works with Windows 7, but it works well with Samba. So, what do we do? It appears that you can delay throwing the "the client uses Unicode strings" switch until after the session has been properly established. We now have a new option to control how this is done. SESSIONSETUP=DELAY (the default) delays the switch to Unicode and SESSIONSETUP=NODELAY switches to Unicode at the earliest possible time. - The CASESENSITIVE option now correctly clears the "path names are not case sensitive" flag of the SMB messages which smbfs sends to the server. - The default workgroup name of "WORKGROUP" could still be used even if the server had been queried to provide its current workgroup name. Fixed. smbfs 1.177 (27.8.2018) - Implemented ACTION_CURRENT_VOLUME correctly. - Updated the documentation again. - Replacement stack should not be allocated as public memory. Fixed. - Clarified how Action_Parent(), Action_FreeLock() and Action_ChangeMode() are supposed to work. - Action_CopyDir() now tests for an invalid lock much earlier, which avoids testing the access mode first and then acting upon it. - Action_SameLock() now uses case-sensitive path name comparison if smbfs is required to. Previously, it would always use case-insensitive comparison. - Unified and simplified commonly-used code. - Added more debug output in order to find that pesky AsyncWB batch rename problem :-/ smbfs 1.178 (29.8.2018) - Unified and simplified even more commonly-used code. - Debug output now includes how many packets are currently waiting to be processed and how much time it took to process each single packet. - Modified the string formatting code to respect buffer size limitations. smbfs 1.179 (2.9.2018) - Cleaned up the debug code, removing unnecessary line feed characters and fixing the broken protection flag output. smbfs 1.180 (15.9.2018) - The ACTION_INHIBIT packet is now rejected as "not known" since this file system cannot actually support it properly. - If you provided the file system with a volume name, then you can disable/enable the file system (as if the medium had been removed from a CD-ROM or floppy disk drive) with the [Ctrl]+D (= disable) and [Ctrl]+E (= enable) keys. smbfs 1.181 (15.9.2018) - ACTION_FREE_LOCK now correctly returns an error if the file lock in question cannot be freed. For example, this may happen if the file system is currently disabled. - Updated the documentation. smbfs 1.182 (19.9.2018) - Added the SETENV switch which should make it easier to stop, disable and re-enable smbfs through shell scripts. Please note that this feature only works if you start smbfs as a shell program. smbfs 1.183 (13.10.2018) - Simplified the path name resolution code yet again, making it more robust and integrating support for corner cases such as an unnecessary "/" at the end of a path name. Verified that this actually produces the results I expected. - All packet handling functions now set the secondary packet result code to 0 if they succeed. This should not be necessary, but some software unfortunately consults the secondary result to find out if the file system operation was entirely successful rather than first checking the primary result. - ACTION_INFO failed to properly indicate failure and also failed to return a proper error code. Fixed. - Added support for the ACTION_FILESYSTEM_ATTR packet type. smbfs 1.184 (3.11.2018) - The maximum file name length reported by ACTION_FILESYSTEM_ATTR returned the file name length limit, not the actual maximum length. Fixed. - If raw SMB transport is disabled and the NetBIOS session setup procedure is used, the packet sent now has the correct length. Thanks go to Robert Kidd who found the problem and provided a patch. - smbfs used to convert the user name provided to all-upper case characters. As Robert Kidd could demonstrate, this is not a requirement for all SMBv1/CIFS servers. The server can even deny access if the user name does not match exactly, which is what the Solaris/OpenSolaris/OpenIndiana SMB server dos. smbfs can now be told not to change the user name through the CHANGEUSERNAMECASE=NO option. If omitted, this option defaults to CHANGEUSERNAMECASE=YES, which used to be the default for all previous smbfs versions. - For consistency the new CHANGEPASSWORDCASE option replaces and overrides the old CHANGECASE option. If you omit the CHANGEPASSWORDCASE option, the CHANGECASE option value will be used instead, which defaults to NO. smbfs 2.1 (25.11.2018) - Even though not all the known issues have been addressed and resolved, in particular the AsyncWB/AmigaOS4 oddities which were hard to reproduce, it's time to finally make a release. smbfs 2.2 (1.12.2018) - The OS4 version could crash if no user name was provided and the builtin default ("GUEST") was used by smbfs instead. Because this built-in default was not meant to be modified by converting it to all-upper-case characters, smbfs would crash. The default string remains, but it is no longer stored as read-only. - Passwords, as processed by the SMB/NT encryption methods, cannot be longer than 23 characters. Note that plain text passwords may still be longer. Whether or not password encryption is supported cannot be guessed/detected before the protocol negotiation has concluded. Note that you will probably only ever encounter SMB servers which require password encryption, so a sensible upper limit appears to be 23 characters. smbfs 2.3 (8.12.2018) - Added the ADDVOLUME option, which defaults to "yes". If no volume name is provided, smbfs will use the service name as the template, e.g. if you connect to //server-name/pictures then the default volume name will be "pictures". The idea is that if the file server allows this, you should not need to start the smbfs program with any parameter other than the service/share name and it should work out of the box. - Preparations for showing error messages when running as a Workbench program would corrupt memory once the message was ready for display, but this only happened in the AmigaOS4 build. As far as I can tell this never worked correctly on AmigaOS4. Thanks go to Matthew Kille who reported the problem! - Simplified the icon parameter processing used when running smbfs as a Workbench program. The reworked code is now basically limited to processing and setting up the same configuration data which the shell command use employs. Both paths share the same configuration data checking and handling. - Turns out that the ACTION_CURRENT_VOLUME function does need to return the volume node, not the device node. Note to self: a 'struct DeviceList' refers to a volume (DLT_VOLUME), whereas a 'struct DeviceNode' refers to a device (DLT_DEVICE). See? This could have been easily been avoided :-/ - Added more code documentation, especially for the various constants and data structures defined and used in "main.c". - Reading from the file name translation file now performs better error detection and reporting. If read errors should crop up, the error message will now say so. If the file is shorter than required the error message will reflect this. - Reworked the smb_proc_reconnect() function so that it does not end up truncating the password before it is encrypted. This means that up to 63 characters of the password can be used to produce the encrypted form, resolving problems with longer server passwords not quite matching what you entered. However, since this long encrypted password is still accompanied by the legacy encrypted form which truncates the password to 14 characters (which are converted to all-upper-case letters) there is no actual gain in terms of security... smbfs 2.4 (15.12.2018) - Added const qualifiers to the parameters used by the functions in "crypt.c". This in turn revealed that the smb_encrypt() function did not in fact modify the password string passed to it, which allowed the smb_proc_reconnect() function in "proc.c" to be simplified. - Augmented the file handle, file lock and SMB file access operations with splay trees to improve performance for validation and lookup. Instead of having to walk the entire list of file, lock or SMB file entries, comparing the list entries by name or address, the entire process should have to check 1-5 entries only. This splay tree functionality is a compile time option which has to be enabled in the "splay.h" header file. - If there is a port number given as part of the share name which is out of range, smbfs now reports this as a specific error rather than just stating that the service is not valid. - Replaced duplicate code in "smb_abstraction.c" which built path names from a parent directory name and a file/directory name with a single common solution. - Revised the build makefiles to create the standard smbfs variant rather than the one with full debugging support enabled. The AmigaOS4 variant specifically avoids using cross-compilation options which would have to be enabled first, if needed. smbfs 2.5 (16.12.2018) - This version fixes the instant crash in the fully optimized 68k/020+ builds, which was cased by a missing __saveds keyword. smbfs 2.6 (16.12.2018) - Added the WRITETHRESHOLD parameter which can be used to disable the separate transmission of the SMB message header and its payload if the combined sizes of both are smaller than or equal to the threshold value. This is intended to improve write performance for small amounts of data which would otherwise linger in the transmission queue. smbfs 2.7 (17.12.2018) - Added the READTHRESHOLD counterpart to WRITETHRESHOLD which affects the read operations. - The smb_receive_raw() function in "sock.c" no longer copies the NetBIOS header into the receive buffer separately, but makes sure that the initial receive operation takes care of it. - The allocate_path_name() function in "smb_abstraction.c" failed to put the path separator character where it should be, resulting in the path name and the file/directory name to get lumped together. This affected creation of files and directories both. smbfs 2.8 (19.12.2018) - The default values for READTHRESHOLD and WRITETHRESHOLD now have the effect of transmitting the SMB header and the payload separately, just like it was introduced in version 2.1. Use something like READTHRESHOLD=1500 and WRITETHRESHOLD=1500 to send packets smaller than or equal to 1500 bytes as a combined lump of data, and data larger than 1500 bytes as separate SMB header and payload. - When processing the share name the limitations on the individual components (server name, share, port number/IP service name) are no longer verified using hard-coded lengths, but use the respective buffer limits instead. The port number/IP service name length check is new. - Added more debug log output to the code which now performs the file and lock name/address lookups instead of walking through the entire file/lock lists. smbfs 2.9 (24.12.2018) - Added the TCP_NODELAY, SO_RCVBUF and SO_SNDBUF tuning options which serve the same purposes as their Samba configuration option counterparts. smbfs 2.10 (29.12.2018) - The smb_receive_raw() function in "sock.c" again copies the NetBIOS header into the receive buffer separately, rolling back an earlier change which did not seem to be sound, and also served to make complicated code even more complicated :-/ - Added the SCATTERGATHER tuning option which defaults to "no". Instead of breaking down write operations into two separate send() calls (one short, one very large), setting SCATTERGATHER=yes can call sendmsg() instead which allows the entire operation to be completed in one single step. This approach was suggested by Patrik Axelsson. Currently, I am uncertain if all AmiTCP V3/V4 TCP/IP stacks implement sendmsg() for TCP sockets in the same consistent manner, which is why this feature is not enabled by default. smbfs 2.11 (31.12.2018) - The ACTION_SETDATE operation again changes both the file/directory creation date/time and the last modification date/time. Because some SMB servers will not return a valid modification date/time, the creation date/time will be substituted when directory entry information is converted into the appropriate AmigaDOS data structures. This is problematic if only the modification time/dated is updated by the ACTION_SETDATE operation because the change may appear not to "stick". - The SMB function which would be used to update both the modification and the creation time stamps did not take care to preserve the creation time stamp. This might have contributed to the ACTION_SETDATE operation not having a noticeable effect. - The debug code no longer uses FORMAT_DEF for converting AmigaDOS time stamp information into readable text, but uses FORMAT_DOS instead. This is an attempt to track down a hard to detect bug in the debug code which might be related to locale.library date conversion. Because the buffer size for the date and time information is limited, the locale settings might just produce too much text to fit into the buffers. But that's only a theory so far... - The functions which the debug code uses to prepare 64 bit integers and strings for display are now a bit more paranoid in watching the lengths of the resulting strings, reporting possible buffer overflows. - Went over all the debug output text format strings with a fine-toothed comb and actually found a few instances of the formatting parameters not being entirely correct. - The assert.c code makes a bit more of an effort to handle NULL strings for display. - The non-debug builds of smbfs now complain again if any of the debug parameters are being used. smbfs 2.12 (5.1.2019) - Found a couple more cases in which debug output did not use the correct parameter information. This happened, for example, in the SMB write operation (which did not correctly report the 64 bit seek offset) and the ACTION_SET_COMMENT implementation which did not print the comment string correctly. - Added a proper string length limit check for the text buffers used by the DateToStr() function. - Enabled profiling support for SAS/C to learn more about the most frequently-used functions and their respective running times. Added inline qualifiers to these functions, or copied the respective function to where it was called, allowing it to be inlined. - The main file system processing loop no longer calls WaitSelect() every time it needs to wait for a new packet to arrive, or for a NetBIOS "keep alive" message to come along. It now defaults to calling Wait(), which has a much lower overhead than WaitSelect(). However, periodic calls to WaitSelect() and the associated NetBIOS "keep alive" handling are scheduled regularly every 10 seconds. That way the "keep alive" messages are dealt with without spending too much time with WaitSelect(). smbfs 2.13 (9.2.2019) - The ACTION_CREATE_DIR, ACTION_DELETE_OBJECT, ACTION_FINDOUTPUT, ACTION_RENAME_OBJECT, ACTION_SET_DATE, ACTION_SET_FILE_SIZE, ACTION_SET_PROTECT and ACTION_WRITE operations now set use more appropriate error codes instead of always translating an unspecific "access denied" error into "ERROR_READ_PROTECTED". For example, for ACTION_DELETE_OBJECT the new translation of "access denied" will be "ERROR_DELETE_PROTECTED". - Added the ErrorOutput option, which can be either "stderr" (default) or "stdout". Its purpose is to allow error messages written by smbfs to be redirected to a file, which will not work for AmigaDOS shell versions 36-40 if smbfs uses "stderr". Use ErrorOutput=stdout to be able to redirect all smbfs output, including any error messages, to a file. - Updated the copyright text. - Output to console or log files is now line-buffered. smbfs 2.14 (15.2.2019) - Documented the directory cache a bit better, including the reason why the cache may have been invalidated while the directory contents were being read. - The directory read operation now verifies that it does not run out of cache entries while it is processing new directory records it received from the server. - The directory read operation now both detects whether or not the last entry has been read, this information is now also provided to the function which retrieved the directory entries. This change is in support of improved directory entry caching. - The directory cache now keeps better track of what's actually in it. If a directory entry could not be extracted and decoded, the number of directory entries read would not match the number of entries available from the cache, for example. - A flag now tracks if the directory cache is valid or not. Previously, checking for a valid cache involved looking at a NULL pointer. - If allocating memory for the directory cache failed partly, then there may have been invalid string pointers in the cache table, leading to a crash when trying to release the cache. Fixed. - Adding another entry to the cache, invalidating the cache or resetting the cache now all use dedicated functions instead of directly manipulating the assorted data structures. smbfs 2.15 (16.2.2019) - Added more debug output to the cache free/invalidate/fill functionality. - The Action_ExamineNext() function could omit the last directory entry. Oops. smbfs 2.16 (17.2.2019) - Simplified the directory cache size change functionality. - Added the CACHETABLES option, which tells smbfs how many individual directory caches it should be using (default: 1). Each directory cache can be used by one directory at a time. If you are deleting a directory tree, including subdirectories, etc. then smbfs will be limited in keeping track of what it deleted, and what directory is next up for deletion. With only a single directory cache, it will be limited to deleting a subdirectory's contents, but forget about its parent directory, for example, and thereby end up skipping entries which should have been deleted. This can be annoying because you will have to repeat the delete operation several times over until everything has been deleted. Increasing the number of cache tables can help, at the expense of extra memory. Increasing the number of cache tables can also improve performance if several programs are examining the contents of directories at the same time. smbfs 2.17 (18.2.2019) - Simplified the cache table "aging", removing duplicate code. - Verified that the CACHETABLE settings do have a positive effect on the problematic "delete directory-name all" case which almost always failed to delete the entire directory tree. smbfs 2.18 (21.2.2019) - The ERROROUTPUT option as released in version 2.17 did not work at all. I wonder how I managed to test it successfully :-/ - Rewrote the smb_proc_readdir_short() and smb_proc_readdir_long() functions so that they tell the server exactly how many directory entries they are able to receive. Previously, the server could deliver more, with interesting consequences. - smb_proc_readdir_long() now verifies that the server's response parameter and data are in order, and it also makes sure not to read more from the response data buffer than there is available when decoding directory entries. - smb_proc_readdir_long() now updates the scan resume information for every directory entry it can process. - smb_proc_readdir_long() now actually uses the scan resume information when asked to resume scanning. This means, for example, if the directory cache only has room for 60 entries, then smb_proc_readdir_long() will read up to 60 entries, get called again, and resume filling the cache with the next entry provided by the server. This never worked anywhere near correctly before. smbfs 2.19 (23.2.2019) - smb_proc_readdir_short() now updates the scan resume information for every directory entry it can process and actually uses the scan resume information when asked to resume scanning. - If the directory cache becomes stale before the contents have been processed, scanning will have to be restarted. smbfs now tells the server that the scan operation has been aborted before it is started again. - Directory scanning in combination with deletion operations can collapse if the directory cache becomes stale before all the relevant entries have been processed. You can now tune how long the cache will remain active, which previously was a period of 5 seconds. The current default is 10 seconds, which definitely helps. Use the new CACHEEXPIRES option to change how long the cache is considered good enough. smbfs 2.20 (27.2.2019) - If the Examine/ExNext/ExAll functions need to restart directory scanning, the cache maintained by the smbfs directory reader is now always cleared. - Removed the directory cache expiration time feature, along with the just-introduced CACHEEXPIRES option. The context in which the expiration time was used did not justify it as a feature. It looked more like a bug... - Rewrote the smba_readdir() function to perform its only task in a much simpler manner. It now either fills the directory cache or retrieves the cache entries to be delivered to the caller, resuming the retrieval at a predefined position if required. smbfs 2.21 (9.3.2019) - Added more diagnostic output and debug functionality, e.g. regarding how many directory caches are currently being used. - Long name directory scanning is a bit more paranoid when retrying a scan operation which might have been triggered by the server connection getting dropped. - Added the new READONLY option (why stop at 47 options when you can have 48?) which makes the file system read-only by default and does not require you to use the "Lock" shell command to achieve the same effect. Note that the shell "Lock" command cannot be used to turn the read-only mode off again. - Added support for the smb:// URI scheme, which means that instead of using "smbfs username=barney password=secret domain=workgroup //nas:445/share" you can now use "smbfs smb://workgroup;barney:secret()nas:445/share" instead. It is a bit shorter than the alternative and has an advantage in allowing you to reuse smb:// URLs which you know work well on other systems. smbfs 2.22 (9.3.2019) - The memory pool initialization should have happened after having initialized the command line argument data, not before it. - I broke the automatic device name ("smbfs0:" .. "smbfs99:") initialization at some point. Ouch :-( The revised code now starts with "smbfs:", then tries "smbfs0:" through "smbfs99:" until it has picked a unique file system device name. This is consistent with the old behaviour of trying to use "smbfs:" if no device specific name has been requested. |
Copyright (c) 2004-2024 by Björn Hagström All Rights Reserved Amiga OS and its logos are registered trademarks of Hyperion Entertainment |