From 2f0d253eef40476b0b35828c04fbadbcd1589dd2 Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Tue, 14 Apr 2009 11:33:05 +0000 Subject: [PATCH] smbfs 1.72 (14.4.2009) - In proc.c, smb_setup_header() initialized the SMB header length field with a number which was too large by four bytes. Consequently, what was later committed to the wire would have four trailing data bytes which could contain random values. This often didn't do much harm, but it seems that Samba 3.2.4 and Windows Vista don't like the looks of the trailing junk bytes. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/amiga-smbfs/trunk@20 26594b9e-b914-4e86-b7a1-9402bd427170 --- documentation/history.doc | 14 ++++++++++++-- documentation/smbfs.doc | 2 +- documentation/smbfs.html | 2 +- source_code/GNUmakefile.68k | 4 ++-- source_code/GNUmakefile.os4 | 4 ++-- source_code/assert.c | 4 ++-- source_code/assert.h | 4 ++-- source_code/main.c | 4 ++-- source_code/proc.c | 14 +++++++++----- source_code/quad_math.c | 4 ++-- source_code/quad_math.h | 4 ++-- source_code/smakefile | 4 ++-- source_code/smb_abstraction.c | 6 +++--- source_code/smb_abstraction.h | 8 ++++---- source_code/smbfs.h | 4 ++-- source_code/smbfs_rev.h | 10 +++++----- source_code/smbfs_rev.rev | 2 +- source_code/sock.c | 6 +++--- source_code/system_headers.c | 4 ++-- source_code/system_headers.h | 4 ++-- 20 files changed, 61 insertions(+), 47 deletions(-) diff --git a/documentation/history.doc b/documentation/history.doc index 97b64c8..31b5ca6 100644 --- a/documentation/history.doc +++ b/documentation/history.doc @@ -475,14 +475,14 @@ smbfs 1.58 (5.9.2002) data is read. -smbfs 1.59 (10.9.2003) [Harry Sintonen ] +smbfs 1.59 (10.9.2003) [Harry Sintonen ] - Fixed ACTION_DELETE_OBJECT to restart directory scanning, it searched for wrong object. Fixes the problem where every other file was skipped when deleting directory. -smbfs 1.60 (11.2.2004) [Peter Riede ] +smbfs 1.60 (11.2.2004) [Peter Riede ] - Fixed ACTION_SEEK, it doesn't works if followed by ACTION_WRITE. Fixes the problem by using the SMBlseek packet instead of just @@ -635,3 +635,13 @@ smbfs 1.71 (13.6.2005) - The DST option's time offset was added to rather than subtracted from the local time. Fixed. + + +smbfs 1.72 (14.4.2009) + +- In proc.c, smb_setup_header() initialized the SMB header length + field with a number which was too large by four bytes. Consequently, + what was later committed to the wire would have four trailing data + bytes which could contain random values. This often didn't do much + harm, but it seems that Samba 3.2.4 and Windows Vista don't like the + looks of the trailing junk bytes. diff --git a/documentation/smbfs.doc b/documentation/smbfs.doc index 171d506..4685f60 100644 --- a/documentation/smbfs.doc +++ b/documentation/smbfs.doc @@ -430,7 +430,7 @@ The 'Sharity-Light' source code was adapted and wrapped into an AmigaOS layer by Olaf `Olsen' Barthel. If you wish to contact me, please send e-mail to the following address: - olsen@sourcery.han.de + obarthel -at- gmx -dot- net Or, alternatively, you might want to contact me via my postal address: diff --git a/documentation/smbfs.html b/documentation/smbfs.html index 740a2e1..094c9fb 100755 --- a/documentation/smbfs.html +++ b/documentation/smbfs.html @@ -450,7 +450,7 @@ written by Andrew Tridgell and the Samba Team.

by Olaf `Olsen' Barthel. If you wish to contact me, please send e-mail to the following address:

-

olsen@sourcery.han.de

+

obarthel -at- gmx -dot- net

Or, alternatively, you might want to contact me via my postal address:

diff --git a/source_code/GNUmakefile.68k b/source_code/GNUmakefile.68k index 40b0f3d..e82a361 100644 --- a/source_code/GNUmakefile.68k +++ b/source_code/GNUmakefile.68k @@ -1,11 +1,11 @@ # -# $Id: GNUmakefile.68k,v 1.2 2005-05-27 09:48:26 obarthel Exp $ +# $Id: GNUmakefile.68k,v 1.3 2009-04-14 11:32:51 obarthel Exp $ # # :ts=8 # # SMB file system wrapper for AmigaOS, using the AmiTCP V3 API # -# Copyright (C) 2000-2005 by Olaf `Olsen' Barthel +# Copyright (C) 2000-2009 by Olaf `Olsen' Barthel # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/source_code/GNUmakefile.os4 b/source_code/GNUmakefile.os4 index d24f4bb..69646cd 100644 --- a/source_code/GNUmakefile.os4 +++ b/source_code/GNUmakefile.os4 @@ -1,11 +1,11 @@ # -# $Id: GNUmakefile.os4,v 1.3 2005-05-29 08:32:58 obarthel Exp $ +# $Id: GNUmakefile.os4,v 1.4 2009-04-14 11:32:51 obarthel Exp $ # # :ts=8 # # SMB file system wrapper for AmigaOS, using the AmiTCP V3 API # -# Copyright (C) 2000-2005 by Olaf `Olsen' Barthel +# * Copyright (C) 2000-2009 by Olaf `Olsen' Barthel # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/source_code/assert.c b/source_code/assert.c index df45b33..de95042 100644 --- a/source_code/assert.c +++ b/source_code/assert.c @@ -1,11 +1,11 @@ /* - * $Id: assert.c,v 1.2 2005-05-27 09:48:26 obarthel Exp $ + * $Id: assert.c,v 1.3 2009-04-14 11:32:51 obarthel Exp $ * * :ts=8 * * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API * - * Copyright (C) 2000-2005 by Olaf `Olsen' Barthel + * Copyright (C) 2000-2009 by Olaf `Olsen' Barthel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/source_code/assert.h b/source_code/assert.h index 10fb1be..1003b53 100644 --- a/source_code/assert.h +++ b/source_code/assert.h @@ -1,11 +1,11 @@ /* - * $Id: assert.h,v 1.3 2005-05-27 10:35:48 obarthel Exp $ + * $Id: assert.h,v 1.4 2009-04-14 11:32:51 obarthel Exp $ * * :ts=8 * * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API * - * Copyright (C) 2000-2005 by Olaf `Olsen' Barthel + * Copyright (C) 2000-2009 by Olaf `Olsen' Barthel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/source_code/main.c b/source_code/main.c index 0d63159..32132de 100644 --- a/source_code/main.c +++ b/source_code/main.c @@ -1,11 +1,11 @@ /* - * $Id: main.c,v 1.7 2005-06-13 19:34:25 obarthel Exp $ + * $Id: main.c,v 1.8 2009-04-14 11:32:51 obarthel Exp $ * * :ts=4 * * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API * - * Copyright (C) 2000-2005 by Olaf `Olsen' Barthel + * Copyright (C) 2000-2009 by Olaf `Olsen' Barthel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/source_code/proc.c b/source_code/proc.c index b0f6b47..f10569c 100644 --- a/source_code/proc.c +++ b/source_code/proc.c @@ -1,5 +1,5 @@ /* - * $Id: proc.c,v 1.6 2005-06-13 13:11:26 obarthel Exp $ + * $Id: proc.c,v 1.7 2009-04-14 11:32:51 obarthel Exp $ * * :ts=8 * @@ -10,7 +10,7 @@ * 28/06/96 - Fixed long file name support (smb_proc_readdir_long) by Yuri Per * * Modified for big endian support by Christian Starkjohann. - * Modified for use with AmigaOS by Olaf Barthel + * Modified for use with AmigaOS by Olaf Barthel */ #include "smbfs.h" @@ -241,7 +241,7 @@ date_unix2dos (int unix_date, unsigned short *time_value, unsigned short *date) dword smb_len (byte * packet) { - return (dword)( ((packet[1] & 0x1) << 16L) | (packet[2] << 8L) | (packet[3]) ); + return (dword)( (((dword)(packet[1] & 0x1)) << 16) | (((dword)packet[2]) << 8) | (packet[3]) ); } static INLINE word @@ -538,7 +538,11 @@ smb_setup_header (struct smb_server *server, byte command, word wct, word bcc) byte *p = server->packet; byte *buf = server->packet; - p = smb_encode_smb_length (p, xmit_len); + /* olsen: we subtract four bytes because smb_encode_smb_length() adds + four bytes which are not supposed to be included in the total + number of bytes to be sent */ + p = smb_encode_smb_length (p, xmit_len - 4); + /* p = smb_encode_smb_length (p, xmit_len); */ BSET (p, 0, 0xff); BSET (p, 1, 'S'); @@ -2517,7 +2521,7 @@ smb_proc_connect (struct smb_server *server) } /* error code stuff - put together by Merik Karman - merik@blackadder.dsh.oz.au */ + merik -at- blackadder -dot- dsh -dot- oz -dot- au */ typedef struct { char *name; diff --git a/source_code/quad_math.c b/source_code/quad_math.c index 777f99e..04189e5 100755 --- a/source_code/quad_math.c +++ b/source_code/quad_math.c @@ -1,11 +1,11 @@ /* - * $Id: quad_math.c,v 1.2 2005-05-29 08:32:58 obarthel Exp $ + * $Id: quad_math.c,v 1.3 2009-04-14 11:32:51 obarthel Exp $ * * :ts=4 * * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API * - * Copyright (C) 2000-2005 by Olaf `Olsen' Barthel + * Copyright (C) 2000-2009 by Olaf `Olsen' Barthel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/source_code/quad_math.h b/source_code/quad_math.h index 503c909..5f12000 100755 --- a/source_code/quad_math.h +++ b/source_code/quad_math.h @@ -1,11 +1,11 @@ /* - * $Id: quad_math.h,v 1.1 2005-05-27 09:48:26 obarthel Exp $ + * $Id: quad_math.h,v 1.2 2009-04-14 11:32:51 obarthel Exp $ * * :ts=4 * * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API * - * Copyright (C) 2000-2005 by Olaf `Olsen' Barthel + * Copyright (C) 2000-2009 by Olaf `Olsen' Barthel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/source_code/smakefile b/source_code/smakefile index e248081..51c41b7 100644 --- a/source_code/smakefile +++ b/source_code/smakefile @@ -1,11 +1,11 @@ # -# $Id: smakefile,v 1.3 2005-05-27 10:35:48 obarthel Exp $ +# $Id: smakefile,v 1.4 2009-04-14 11:32:51 obarthel Exp $ # # :ts=8 # # SMB file system wrapper for AmigaOS, using the AmiTCP V3 API # -# Copyright (C) 2000-2005 by Olaf `Olsen' Barthel +# Copyright (C) 2000-2009 by Olaf `Olsen' Barthel # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/source_code/smb_abstraction.c b/source_code/smb_abstraction.c index e32c57e..99daa8d 100644 --- a/source_code/smb_abstraction.c +++ b/source_code/smb_abstraction.c @@ -1,15 +1,15 @@ /* - * $Id: smb_abstraction.c,v 1.1.1.1 2005-05-24 13:22:13 obarthel Exp $ + * $Id: smb_abstraction.c,v 1.2 2009-04-14 11:32:51 obarthel Exp $ * * :ts=8 * * Name: smb_abstraction.c * Description: Smb abstraction layer. - * Author: Christian Starkjohann + * Author: Christian Starkjohann * Date: 1996-12-31 * Copyright: GNU-GPL * - * Modified for use with AmigaOS by Olaf Barthel + * Modified for use with AmigaOS by Olaf Barthel */ #include "smbfs.h" diff --git a/source_code/smb_abstraction.h b/source_code/smb_abstraction.h index b27fcb4..a66e7c7 100644 --- a/source_code/smb_abstraction.h +++ b/source_code/smb_abstraction.h @@ -1,16 +1,16 @@ /* - * $Id: smb_abstraction.h,v 1.1.1.1 2005-05-24 13:22:13 obarthel Exp $ + * $Id: smb_abstraction.h,v 1.2 2009-04-14 11:32:51 obarthel Exp $ * * :ts=8 * * Name: smb_abstraction.h * Description: Interface to the smb abstraction layer. - * Author: Christian Starkjohann + * Author: Christian Starkjohann * Date: 1996-12-31 * Copyright: GNU-GPL * - * Modified for use with AmigaOS by Olaf Barthel - * Modified to support record locking by Peter Riede + * Modified for use with AmigaOS by Olaf Barthel + * Modified to support record locking by Peter Riede */ #ifndef _SMB_ABSTRACTION_H diff --git a/source_code/smbfs.h b/source_code/smbfs.h index 20643ae..dce9cf8 100644 --- a/source_code/smbfs.h +++ b/source_code/smbfs.h @@ -1,11 +1,11 @@ /* - * $Id: smbfs.h,v 1.3 2005-06-13 08:04:15 obarthel Exp $ + * $Id: smbfs.h,v 1.4 2009-04-14 11:32:51 obarthel Exp $ * * :ts=4 * * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API * - * Copyright (C) 2000-2005 by Olaf `Olsen' Barthel + * Copyright (C) 2000-2009 by Olaf `Olsen' Barthel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/source_code/smbfs_rev.h b/source_code/smbfs_rev.h index 1383005..7fc7fce 100644 --- a/source_code/smbfs_rev.h +++ b/source_code/smbfs_rev.h @@ -1,6 +1,6 @@ #define VERSION 1 -#define REVISION 71 -#define DATE "13.6.2005" -#define VERS "smbfs 1.71" -#define VSTRING "smbfs 1.71 (13.6.2005)\r\n" -#define VERSTAG "\0$VER: smbfs 1.71 (13.6.2005)" +#define REVISION 72 +#define DATE "14.4.2009" +#define VERS "smbfs 1.72" +#define VSTRING "smbfs 1.72 (14.4.2009)\r\n" +#define VERSTAG "\0$VER: smbfs 1.72 (14.4.2009)" diff --git a/source_code/smbfs_rev.rev b/source_code/smbfs_rev.rev index 39f5b69..ea70ce0 100644 --- a/source_code/smbfs_rev.rev +++ b/source_code/smbfs_rev.rev @@ -1 +1 @@ -71 +72 diff --git a/source_code/sock.c b/source_code/sock.c index a4127f1..c514d2c 100644 --- a/source_code/sock.c +++ b/source_code/sock.c @@ -1,13 +1,13 @@ /* - * $Id: sock.c,v 1.1.1.1 2005-05-24 13:22:13 obarthel Exp $ + * $Id: sock.c,v 1.2 2009-04-14 11:32:51 obarthel Exp $ * * :ts=8 * * sock.c * * Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke - * Modified by Christian Starkjohann - * Modified for use with AmigaOS by Olaf Barthel + * Modified by Christian Starkjohann + * Modified for use with AmigaOS by Olaf Barthel */ #include "smbfs.h" diff --git a/source_code/system_headers.c b/source_code/system_headers.c index 09cb951..c8ac66d 100644 --- a/source_code/system_headers.c +++ b/source_code/system_headers.c @@ -1,11 +1,11 @@ /* - * $Id: system_headers.c,v 1.1.1.1 2005-05-24 13:22:13 obarthel Exp $ + * $Id: system_headers.c,v 1.2 2009-04-14 11:32:51 obarthel Exp $ * * :ts=4 * * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API * - * Copyright (C) 2000-2003 by Olaf `Olsen' Barthel + * Copyright (C) 2000-2009 by Olaf `Olsen' Barthel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/source_code/system_headers.h b/source_code/system_headers.h index b4fa440..24963fe 100644 --- a/source_code/system_headers.h +++ b/source_code/system_headers.h @@ -1,11 +1,11 @@ /* - * $Id: system_headers.h,v 1.1.1.1 2005-05-24 13:22:13 obarthel Exp $ + * $Id: system_headers.h,v 1.2 2009-04-14 11:32:51 obarthel Exp $ * * :ts=4 * * SMB file system wrapper for AmigaOS, using the AmiTCP V3 API * - * Copyright (C) 2000-2003 by Olaf `Olsen' Barthel + * Copyright (C) 2000-2009 by Olaf `Olsen' Barthel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by