Some comments about the Synology version of Samba

Richard Sharpe realrichardsharpe at gmail.com
Sat Apr 20 08:26:50 MDT 2013


On Fri, Apr 19, 2013 at 6:40 PM, Richard Sharpe
<realrichardsharpe at gmail.com> wrote:
> Out of curiosity I downloaded the synology source code from here:
> http://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/3201branch/synogpl-3201-x64.tbz/download
>
> The Samba code consists the Samba source as modified by Synology.
> There are no patches that I can find.
>
> There are 146 modified files.
>
> Modifications are surounded with #ifdef MY_ABC_HERE or #ifndef
> MY_ABC_HERE. Weird symbols.
>
> More when I get a better look at the differences.

One of the more curious pair of changes are these two. They consist
solely of white-space removal and an indentation change. Perhaps they
originally had a change in these files but in removing their changes,
went overboard.

diff -uNr samba-3.6.9/source3/smbd/smb2_negprot.c
samba-3.6.x/source3/smbd/smb2_negprot.c
--- samba-3.6.9/source3/smbd/smb2_negprot.c     2012-10-29
02:05:46.000000000 -0700
+++ samba-3.6.x/source3/smbd/smb2_negprot.c     2013-02-24
23:21:39.000000000 -0800
@@ -23,6 +23,7 @@
 #include "smbd/globals.h"
 #include "../libcli/smb/smb_common.h"

+
 /*
  * this is the entry point if SMB2 is selected via
  * the SMB negprot
@@ -97,18 +98,16 @@
                return smbd_smb2_request_error(req,
NT_STATUS_INVALID_PARAMETER);
        }
        indyn = (const uint8_t *)req->in.vector[i+2].iov_base;
-
-       for (c=0; c < dialect_count; c++) {
-               dialect = SVAL(indyn, c*2);
-               if (dialect == SMB2_DIALECT_REVISION_202) {
-                       break;
+               for (c=0; c < dialect_count; c++) {
+                       dialect = SVAL(indyn, c*2);
+                       if (dialect == SMB2_DIALECT_REVISION_202) {
+                               break;
+                       }
                }
-       }

        if (dialect != SMB2_DIALECT_REVISION_202) {
                return smbd_smb2_request_error(req,
NT_STATUS_INVALID_PARAMETER);
        }
-
        set_Protocol(PROTOCOL_SMB2);

        if (get_remote_arch() != RA_SAMBA) {
@@ -140,7 +139,6 @@
         * 0x10000 (65536) is the maximum allowed message size
         */
        max_limit = 0x10000;
-
        max_trans = MIN(max_limit, max_trans);
        max_read  = MIN(max_limit, max_read);
        max_write = MIN(max_limit, max_write);
diff -uNr samba-3.6.9/source3/smbd/smb2_read.c
samba-3.6.x/source3/smbd/smb2_read.c
--- samba-3.6.9/source3/smbd/smb2_read.c        2012-10-29
02:05:46.000000000 -0700
+++ samba-3.6.x/source3/smbd/smb2_read.c        2013-02-24
23:21:39.000000000 -0800
@@ -437,7 +437,6 @@
                tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
                return tevent_req_post(req, ev);
        }
-
        status = schedule_smb2_aio_read(fsp->conn,
                                smbreq,
                                fsp,
@@ -464,7 +463,6 @@
                tevent_req_nterror(req, NT_STATUS_FILE_CLOSED);
                return tevent_req_post(req, ev);
        }
-
        /* Fallback to synchronous. */

        init_strict_lock_struct(fsp,



-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)


More information about the samba-technical mailing list