mirror of
https://github.com/obarthel/amiga-smbfs.git
synced 2025-12-08 14:58:35 +00:00
Long overdue fixes for typos and such
This commit is contained in:
+2
-2
@@ -72,7 +72,7 @@ static void mdfour (unsigned char *out, const unsigned char *in, int n);
|
||||
the minimum necessary for SMB authentication, as used by all SMB
|
||||
products (including every copy of Microsoft Windows95 ever sold)
|
||||
|
||||
In particular, it can only do a unchained forward DES pass. This
|
||||
In particular, it can only do an unchained forward DES pass. This
|
||||
means it is not possible to use this code for encryption/decryption
|
||||
of data, instead it is only useful as a "hash" algorithm.
|
||||
|
||||
@@ -426,7 +426,7 @@ E_P24 (const unsigned char *p21, const unsigned char *c8, unsigned char *p24)
|
||||
/****************************************************************************/
|
||||
|
||||
/* This implements the X/Open SMB password encryption
|
||||
It takes a password, a 8 byte "crypt key" and puts 24 bytes of
|
||||
It takes a password, an 8 byte "crypt key" and puts 24 bytes of
|
||||
encrypted password into p24 */
|
||||
void
|
||||
smb_encrypt (const unsigned char *passwd, const unsigned char *c8, unsigned char *p24)
|
||||
|
||||
@@ -59,7 +59,7 @@ struct smb_dskattr
|
||||
};
|
||||
|
||||
/*
|
||||
* Contains all relevant data on a SMB networked file.
|
||||
* Contains all relevant data on an SMB networked file.
|
||||
*/
|
||||
struct smb_dirent
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ struct smb_server
|
||||
/* olsen (2018-06-01): UTF-16LE Unicode strings are used for path names. */
|
||||
int unicode_enabled;
|
||||
|
||||
/* olsen (2018-08-12): Path names are case sensitive. */
|
||||
/* olsen (2018-08-12): Path names are case-sensitive. */
|
||||
int case_sensitive;
|
||||
|
||||
/* olsen (2018-08-12): Delay the use of Unicode strings during session setup. */
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
#define smb_vwv15 67
|
||||
#define smb_vwv16 69
|
||||
|
||||
/* these are the trans2 sub fields for primary requests */
|
||||
/* these are the trans2 sub-fields for primary requests */
|
||||
#define smb_tpscnt smb_vwv0
|
||||
#define smb_tdscnt smb_vwv1
|
||||
#define smb_mprcnt smb_vwv2
|
||||
|
||||
+14
-14
@@ -83,7 +83,7 @@ TEXT Version[] = VERSTAG;
|
||||
/****************************************************************************/
|
||||
|
||||
/* Difference between January 1st 1970 and January 1st 1978 in seconds,
|
||||
* which is needed because the Amiga system time base uses 1978 and we
|
||||
* which is needed because the Amiga system time base uses 1978, and we
|
||||
* have to deal with Unix time information.
|
||||
*/
|
||||
#define UNIX_TIME_OFFSET 252460800
|
||||
@@ -145,7 +145,7 @@ struct FileNode
|
||||
*/
|
||||
|
||||
QUAD fn_OffsetQuad; /* Current file read/write position,
|
||||
* as an unsigned 64 bit integer.
|
||||
* as an unsigned 64-bit integer.
|
||||
*/
|
||||
LONG fn_Mode; /* File access mode, e.g. MODE_NEWFILE,
|
||||
* MODE_OLDFILE, MODE_READWRITE.
|
||||
@@ -1443,7 +1443,7 @@ main(void)
|
||||
ASSERT( args.Service != NULL );
|
||||
|
||||
/* Set up the name of the program, as it will be
|
||||
* displayed in the proces status list.
|
||||
* displayed in the process status list.
|
||||
*/
|
||||
name = FilePart(program_name);
|
||||
|
||||
@@ -2086,7 +2086,7 @@ host_strerror(int error)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Compare two strings, either case sensitive or not
|
||||
/* Compare two strings, either case-sensitive or not
|
||||
* sensitive to the case of the letters. How this is
|
||||
* to be done is controlled by a global option. This
|
||||
* routine is called whenever two SMB file names are
|
||||
@@ -2275,7 +2275,7 @@ add_error_message(const TEXT * fmt,APTR args)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Report an error that has occured; if the program was not launched
|
||||
/* Report an error that has occurred; if the program was not launched
|
||||
* from Shell, error messages will be accumulated for later display.
|
||||
*/
|
||||
void VARARGS68K
|
||||
@@ -2892,7 +2892,7 @@ BroadcastNameQuery(const char *name, const char *scope, UBYTE *address)
|
||||
result = ENOENT;
|
||||
n = 0;
|
||||
|
||||
/* Send the query packet; retry five times with a one second
|
||||
/* Send the query packet; retry five times with a one-second
|
||||
* delay in between.
|
||||
*/
|
||||
for(i = 0 ; i < 5 ; i++)
|
||||
@@ -3074,7 +3074,7 @@ SendNetBIOSStatusQuery(
|
||||
result = ENOENT;
|
||||
n = 0;
|
||||
|
||||
/* Send the query packet; retry five times with a one second
|
||||
/* Send the query packet; retry five times with a one-second
|
||||
* delay in between.
|
||||
*/
|
||||
for(i = 0 ; i < 5 ; i++)
|
||||
@@ -4728,8 +4728,8 @@ remove_lock_node(struct LockNode * ln)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Truncate an file size or position which cannot be represented by a
|
||||
* single 32 bit integer and substitute it with something vaguely more
|
||||
/* Truncate a file size or position which cannot be represented by a
|
||||
* single 32-bit integer and substitute it with something vaguely more
|
||||
* sensible (which probably isn't so sensible in the first place, but
|
||||
* we keep trying).
|
||||
*/
|
||||
@@ -7245,7 +7245,7 @@ Action_ExamineObject(
|
||||
}
|
||||
|
||||
/* If the ZERO lock is involved, it stands in for the
|
||||
* root directory. Otherwise it might be a lock on a
|
||||
* root directory. Otherwise, it might be a lock on a
|
||||
* file or directory.
|
||||
*/
|
||||
if(lock != NULL)
|
||||
@@ -8158,7 +8158,7 @@ dir_scan_callback_func_exall(
|
||||
|
||||
/* If this was the last entry to be delivered (eof != FALSE)
|
||||
* make sure that the next invocation of this function will
|
||||
* cease delivering more directory entries. Otherwise allow
|
||||
* cease delivering more directory entries. Otherwise, allow
|
||||
* the next call to ExAll() to resume reading more directory
|
||||
* entries.
|
||||
*/
|
||||
@@ -9901,7 +9901,7 @@ Action_ChangeMode(
|
||||
* as SHARED_LOCK and EXCLUSIVE_LOCK. This works because these five modes
|
||||
* are represented by different numbers.
|
||||
*
|
||||
* For locks we only accept SHARED_LOCK and EXCLUSIVE_LOCK.
|
||||
* For locks, we only accept SHARED_LOCK and EXCLUSIVE_LOCK.
|
||||
*/
|
||||
if(type == CHANGE_FH)
|
||||
{
|
||||
@@ -10168,7 +10168,7 @@ Action_SetComment(
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* All this work and we're only doing something very silly... */
|
||||
/* All this work, and we're only doing something very silly... */
|
||||
result = DOSTRUE;
|
||||
error = OK;
|
||||
|
||||
@@ -11257,7 +11257,7 @@ file_system_handler(
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Convert an unsigned 64 bit integer into a string. The
|
||||
/* Convert an unsigned 64-bit integer into a string. The
|
||||
* conversion uses a local static buffer and returns a pointer
|
||||
* to the first digit of the string.
|
||||
*/
|
||||
|
||||
@@ -75,7 +75,7 @@ allocate_smb_url_args(void)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Allocate enough memory to hold a a NUL-terminated copy of the substring
|
||||
/* Allocate enough memory to hold a NUL-terminated copy of the substring
|
||||
* whose start/end position is provided, then copy its contents. Returns
|
||||
* NULL on failure. Note that the start/end positions are expected to be
|
||||
* start <= end.
|
||||
|
||||
+10
-10
@@ -220,7 +220,7 @@ static const err_code_struct hard_msgs[] =
|
||||
{"ERRbadunit", 20, "Unknown unit"},
|
||||
{"ERRnotready", 21, "Drive not ready"},
|
||||
{"ERRbadcmd", 22, "Unknown command"},
|
||||
{"ERRdata", 23, "A problem has occured in the physical I/O"},
|
||||
{"ERRdata", 23, "A problem has occurred in the physical I/O"},
|
||||
{"ERRbadreq", 24, "Bad request structure length"},
|
||||
{"ERRseek", 25, "Seek error"},
|
||||
{"ERRbadmedia", 26, "Unknown media type"},
|
||||
@@ -277,7 +277,7 @@ static void convert_time_t_to_long_date(time_t t, QUAD * long_date);
|
||||
* returns how many bytes were written to the buffer, including the
|
||||
* null-termination.
|
||||
*
|
||||
* To be on the safe side (the path name length can be a 32 bit
|
||||
* To be on the safe side (the path name length can be a 32-bit
|
||||
* integer), the whole copying operation stops as soon as the
|
||||
* output buffer is filled.
|
||||
*/
|
||||
@@ -330,7 +330,7 @@ copy_latin1_to_utf16le(byte * to,int to_size, const byte * from,int len)
|
||||
* returns how many bytes were written to the buffer, including the
|
||||
* null-termination.
|
||||
*
|
||||
* To be on the safe side (the path name length can be a 32 bit
|
||||
* To be on the safe side (the path name length can be a 32-bit
|
||||
* integer), the whole copying operation stops as soon as the
|
||||
* output buffer is filled.
|
||||
*/
|
||||
@@ -591,7 +591,7 @@ local2utc (int time_value)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Convert a MS-DOS time/date pair to a UNIX date (seconds since January 1st 1970). */
|
||||
/* Convert an MS-DOS time/date pair to a UNIX date (seconds since January 1st 1970). */
|
||||
static int
|
||||
date_dos2unix (unsigned short time_value, unsigned short date)
|
||||
{
|
||||
@@ -816,7 +816,7 @@ smb_errno (int errcls, int error)
|
||||
{ ERRfilexists, EEXIST },
|
||||
{ ERRinvalidparam, EINVAL },
|
||||
{ 145, ENOTEMPTY}, /* Directory is not empty; this is what Samba reports (2016-04-23) */
|
||||
{ 183, EEXIST }, /* This next error seems to occur on an mv when the destination exists ("object name collision") */
|
||||
{ 183, EEXIST }, /* This next error seems to occur on a "mv" when the destination exists ("object name collision") */
|
||||
{ -1, -1 }
|
||||
};
|
||||
|
||||
@@ -1324,7 +1324,7 @@ smb_proc_open (
|
||||
}
|
||||
|
||||
/* Allows others to read, write and delete the file just created.
|
||||
* This may be useful if smbfs hangs or you need to restart your
|
||||
* This may be useful if smbfs hangs, or you need to restart your
|
||||
* System and you need to clean up after the file you just
|
||||
* created.
|
||||
*/
|
||||
@@ -1768,13 +1768,13 @@ smb_proc_write_raw (
|
||||
* 8(securityfeatures)+2(reserved)+2(tid)+2(pidlow)+2(uid)+2(mid)
|
||||
* = 32 bytes
|
||||
*
|
||||
* The parameters of a SMB_COM_WRITE_RAW command account for
|
||||
* The parameters of an SMB_COM_WRITE_RAW command account for
|
||||
* 1(wordcount)+2(fid)+2(countofbytes)+2(reserved1)+4(offset)+
|
||||
* 4(timeout)+2(writemode)+4(reserved2)+2(datalength)+2(dataoffset)+
|
||||
* 4(offset high)
|
||||
* = 29 bytes
|
||||
*
|
||||
* The data part of a SMB_COM_WRITE_RAW command account for
|
||||
* The data part of an SMB_COM_WRITE_RAW command account for
|
||||
* 2(bytecount)+0(pad) = 2 bytes, not including
|
||||
* the actual payload
|
||||
*
|
||||
@@ -4377,7 +4377,7 @@ smb_proc_reconnect (struct smb_server *server, int * error_ptr)
|
||||
SHOWMSG("Passed SESSION REQUEST.");
|
||||
}
|
||||
|
||||
/* Now we are ready to send a SMB Negotiate Protocol packet. */
|
||||
/* Now we are ready to send an SMB Negotiate Protocol packet. */
|
||||
plength = 0;
|
||||
for (i = 0; i < num_prots ; i++)
|
||||
plength += 1 + strlen (prots[i].name) + 1;
|
||||
@@ -4741,7 +4741,7 @@ smb_proc_reconnect (struct smb_server *server, int * error_ptr)
|
||||
WSET (packet, smb_vwv3, 2); /* maximum mpx count; should be copied from server */
|
||||
WSET (packet, smb_vwv4, 0); /* server->pid */
|
||||
DSET (packet, smb_vwv5, server_sesskey);
|
||||
WSET (packet, smb_vwv7, oem_password_len); /* case sensitive password length */
|
||||
WSET (packet, smb_vwv7, oem_password_len); /* case-sensitive password length */
|
||||
WSET (packet, smb_vwv8, 0); /* no encrypted password */
|
||||
|
||||
p = SMB_BUF (packet);
|
||||
|
||||
@@ -67,12 +67,12 @@ static ULONG mulhu (ULONG u, ULONG v)
|
||||
return u1 * v1 + w2 + (w1 >> 16);
|
||||
}
|
||||
|
||||
/* Multiply two 32 bit numbers, yielding a 64 bit result value. */
|
||||
/* Multiply two 32-bit numbers, yielding a 64 bit result value. */
|
||||
void
|
||||
multiply_32_by_32_to_64(ULONG ab,ULONG cd,QUAD * product)
|
||||
{
|
||||
product->High = mulhu(ab,cd);
|
||||
product->Low = ab * cd;
|
||||
product->Low = ab * cd;
|
||||
}
|
||||
|
||||
/* Multiply an unsigned 64 bit quantity by a 32 bit quantity, yielding a 64
|
||||
@@ -111,8 +111,8 @@ multiply_64_by_32_to_64(const QUAD * const abcd,ULONG ef,QUAD * abcdef)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Divide a 64 bit integer by a 32 bit integer, filling in a 64 bit quotient
|
||||
* and returning a 32 bit remainder.
|
||||
/* Divide a 64-bit integer by a 32-bit integer, filling in a 64 bit quotient
|
||||
* and returning a 32-bit remainder.
|
||||
*/
|
||||
ULONG
|
||||
divide_64_by_32(const QUAD * const dividend,ULONG divisor,QUAD * quotient)
|
||||
@@ -217,9 +217,9 @@ add_64_plus_64_to_64(const QUAD * const a,const QUAD * const b,QUAD * ab)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Subtract a 64 bit integer from another 64 bit integer, producing a
|
||||
* 64 bit integer difference, returning a 32 bit integer that indicates
|
||||
* whether or not an underflow occured.
|
||||
/* Subtract a 64-bit integer from another 64-bit integer, producing a
|
||||
* 64-bit integer difference, returning a 32-bit integer that indicates
|
||||
* whether an underflow occurred.
|
||||
*/
|
||||
ULONG
|
||||
subtract_64_from_64_to_64(const QUAD * const minuend,const QUAD * const subtrahend,QUAD * difference)
|
||||
@@ -262,7 +262,7 @@ subtract_64_from_64_to_64(const QUAD * const minuend,const QUAD * const subtrahe
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Compare two unsigned 64 bit integers in the manner of strcmp(). */
|
||||
/* Compare two unsigned 64-bit integers in the manner of strcmp(). */
|
||||
int
|
||||
compare_64_to_64(const QUAD * const a,const QUAD * const b)
|
||||
{
|
||||
|
||||
@@ -1087,13 +1087,13 @@ smba_read (smba_file_t * f, char *data, long len, const QUAD * const offset, int
|
||||
* 8(securityfeatures)+2(reserved)+2(tid)+2(pidlow)+2(uid)+2(mid)
|
||||
* = 32 bytes
|
||||
*
|
||||
* The parameters of a SMB_COM_READ_ANDX response account for
|
||||
* The parameters of an SMB_COM_READ_ANDX response account for
|
||||
* 1(wordcount)+1(andxcommand)+1(andxreserved)+2(andxoffset)+
|
||||
* 2(available)+2(datacompactionmode)+2(reserved)+2(datalength)+
|
||||
* 2(dataoffset)+10(reserved2)
|
||||
* = 25 bytes
|
||||
*
|
||||
* The data part of a SMB_COM_READ_ANDX response account for
|
||||
* The data part of an SMB_COM_READ_ANDX response account for
|
||||
* 2(bytecount)+1(pad) = 3 bytes,
|
||||
* not including the actual payload
|
||||
*
|
||||
@@ -1194,11 +1194,11 @@ smba_read (smba_file_t * f, char *data, long len, const QUAD * const offset, int
|
||||
* 8(securityfeatures)+2(reserved)+2(tid)+2(pidlow)+2(uid)+2(mid)
|
||||
* = 32 bytes
|
||||
*
|
||||
* The parameters of a SMB_COM_READ response account for
|
||||
* The parameters of an SMB_COM_READ response account for
|
||||
* 1(wordcount)+2(countofbytesreturned)+8(reserved)
|
||||
* = 11 bytes
|
||||
*
|
||||
* The data part of a SMB_COM_READ response account for
|
||||
* The data part of an SMB_COM_READ response account for
|
||||
* 2(bytecount)+1(bufferformat)+2(countofbytesread) = 5 bytes,
|
||||
* not including the actual payload
|
||||
*
|
||||
@@ -1288,13 +1288,13 @@ smba_write (smba_file_t * f, const char *data, long len, const QUAD * const offs
|
||||
* 8(securityfeatures)+2(reserved)+2(tid)+2(pidlow)+2(uid)+2(mid)
|
||||
* = 32 bytes
|
||||
*
|
||||
* The parameters of a SMB_COM_WRITE_ANDX command account for
|
||||
* The parameters of an SMB_COM_WRITE_ANDX command account for
|
||||
* 1(word_count)+1(and_x_command)+1(and_x_reserved)+2(and_x_offset)+
|
||||
* 2(fid)+4(offset)+4(timeout)+2(write_mode)+2(remaining)+2(reserved)+
|
||||
* 2(data_length)+2(data_offset)+4(offset_high)
|
||||
* = 29 bytes
|
||||
*
|
||||
* The data part of a SMB_COM_WRITE_ANDX command account for
|
||||
* The data part of an SMB_COM_WRITE_ANDX command account for
|
||||
* 2(byte_count)+1(pad) = 3 bytes, not including
|
||||
* the actual payload
|
||||
*
|
||||
@@ -1347,12 +1347,12 @@ smba_write (smba_file_t * f, const char *data, long len, const QUAD * const offs
|
||||
* 8(securityfeatures)+2(reserved)+2(tid)+2(pidlow)+2(uid)+2(mid)
|
||||
* = 32 bytes
|
||||
*
|
||||
* The parameters of a SMB_COM_WRITE_RAW command account for
|
||||
* The parameters of an SMB_COM_WRITE_RAW command account for
|
||||
* 1(wordcount)+2(fid)+2(countofbytes)+2(reserved1)+4(offset)+
|
||||
* 4(timeout)+2(writemode)+4(reserved2)+2(datalength)+
|
||||
* 2(dataoffset)+4(offset high) = 29 bytes
|
||||
*
|
||||
* The data part of a SMB_COM_WRITE_RAW command accounts for
|
||||
* The data part of an SMB_COM_WRITE_RAW command accounts for
|
||||
* 2(bytecount) = 2 bytes
|
||||
*
|
||||
* This leaves 'max_buffer_size' - 63 for the payload.
|
||||
@@ -1403,11 +1403,11 @@ smba_write (smba_file_t * f, const char *data, long len, const QUAD * const offs
|
||||
* 8(securityfeatures)+2(reserved)+2(tid)+2(pidlow)+2(uid)+2(mid)
|
||||
* = 32 bytes
|
||||
*
|
||||
* The parameters of a SMB_COM_WRITE command account for
|
||||
* The parameters of an SMB_COM_WRITE command account for
|
||||
* 1(wordcount)+2(fid)+2(countofbytestowrite)+4(writeoffsetinbytes)+
|
||||
* 2(estimateofremainingbytestobewritten) = 11 bytes
|
||||
*
|
||||
* The data part of a SMB_COM_WRITE command account for
|
||||
* The data part of an SMB_COM_WRITE command account for
|
||||
* 2(bytecount)+1(bufferformat)+2(datalength) = 5 bytes, not including
|
||||
* the actual payload
|
||||
*
|
||||
@@ -1452,7 +1452,7 @@ smba_write (smba_file_t * f, const char *data, long len, const QUAD * const offs
|
||||
f->attr_time = 0;
|
||||
|
||||
/* Even if one write access failed, we may have succeeded
|
||||
* at writing some data. Hence we update the cached file
|
||||
* at writing some data. Hence, we update the cached file
|
||||
* size here and take note of the change made.
|
||||
*/
|
||||
if(num_bytes_written > 0)
|
||||
@@ -1803,7 +1803,7 @@ smba_readdir (smba_file_t * f, int offs, int restart, void *callback_data, smba_
|
||||
D(("cachefill returned %ld entries", num_entries));
|
||||
|
||||
/* The cache may have been invalidated because an error
|
||||
* occured (e.g. server connection was terminated), or if
|
||||
* occurred (e.g. server connection was terminated), or if
|
||||
* the cache size was changed.
|
||||
*/
|
||||
if (f->dircache == NULL || !f->dircache->is_valid)
|
||||
@@ -2557,7 +2557,7 @@ smba_start(
|
||||
|
||||
host_name[i] = '\0';
|
||||
|
||||
/* Make sure the hostname is 16 characters or less (for NetBIOS) */
|
||||
/* Make sure the hostname is 16 characters in size, of less (for NetBIOS) */
|
||||
if (!opt_raw_smb && strlen (host_name) > 16)
|
||||
{
|
||||
report_error("Server name '%s' is too long (%ld characters are possible).", host_name, 16);
|
||||
|
||||
+1
-1
@@ -341,7 +341,7 @@ splay_tree_find(struct splay_tree * tree, const splay_key_t key)
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Initialize a splay tree to be empty. By default duplicate keys
|
||||
/* Initialize a splay tree to be empty. By default, duplicate keys
|
||||
* are not allowed.
|
||||
*/
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user