The branch, v4-5-test has been updated
       via  5d740e4 s3: libsmb: Fix use-after-free when accessing pointer *p.
       via  5659328 s3/notifyd: ensure notifyd doesn't return from 
smbd_notifyd_init
       via  dbb2814 vfs_fruit: don't use MS NFS ACEs with Windows clients
       via  35cba47 vfs_fruit: add fruit:model = <modelname> parametric option
      from  6512059 selftest:Samba3: call "net primarytrust dumpinfo" 
setup_nt4_member() after the join

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-5-test


- Log -----------------------------------------------------------------
commit 5d740e45c4ecb8d6acdb6e429bd35d0e9f91e1be
Author: Thomas Jarosch <[email protected]>
Date:   Sat Jul 22 09:36:18 2017 -0700

    s3: libsmb: Fix use-after-free when accessing pointer *p.
    
    talloc_asprintf_append() might call realloc()
    and therefore move the memory address of "path".
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12927
    
    Signed-off-by: Thomas Jarosch <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    Reviewed-by: Ralph Böhme <[email protected]>
    
    Autobuild-User(master): Jeremy Allison <[email protected]>
    Autobuild-Date(master): Sat Jul 22 22:45:05 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 890137cffedcaf88a9ff808c01335ee14fcfd8da)
    
    Autobuild-User(v4-5-test): Karolin Seeger <[email protected]>
    Autobuild-Date(v4-5-test): Mon Jul 24 06:24:58 CEST 2017 on sn-devel-144

commit 565932852ee486b981d462ca24dadf531a2cb704
Author: Ralph Boehme <[email protected]>
Date:   Fri Jul 14 16:38:36 2017 +0200

    s3/notifyd: ensure notifyd doesn't return from smbd_notifyd_init
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12910
    
    Signed-off-by: Ralph Boehme <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    (cherry picked from commit 7f4e7cfd1b0bd917395c631a1a8195fffd13bbad)

commit dbb28145f0259465f520c80e10c96a23e72ab3b1
Author: Ralph Boehme <[email protected]>
Date:   Wed Jul 12 09:33:59 2017 +0200

    vfs_fruit: don't use MS NFS ACEs with Windows clients
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12897
    
    Signed-off-by: Ralph Boehme <[email protected]>
    Reviewed-by: Guenther Deschner <[email protected]>
    
    Autobuild-User(master): Günther Deschner <[email protected]>
    Autobuild-Date(master): Thu Jul 13 22:21:08 CEST 2017 on sn-devel-144
    
    (cherry picked from commit df0db9d8f893f9245c6289200303b94a6e2d48d0)

commit 35cba471582be47b040e057ea875200c6d0ff1d9
Author: Günther Deschner <[email protected]>
Date:   Wed Jun 28 18:10:28 2017 +0200

    vfs_fruit: add fruit:model = <modelname> parametric option
    
    fruit:model = iMac
    fruit:model = MacBook
    fruit:model = MacPro
    fruit:model = Xserve
    
    will all display a different icon inside Finder.
    
    Formerly, we used "Samba" which resulted in a "?" icon in Finder, with
    the new default "MacSamba" we appear with a computer box icon at least.
    
    Guenther
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12840
    
    Signed-off-by: Guenther Deschner <[email protected]>
    Signed-off-by: Ralph Boehme <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>
    
    Autobuild-User(master): Günther Deschner <[email protected]>
    Autobuild-Date(master): Wed Jul 12 03:17:57 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 259e1706e3206b215e136ea9d5beef4c9e3fcdee)

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages/vfs_fruit.8.xml |  9 +++++++++
 source3/libsmb/libsmb_dir.c       |  6 +++---
 source3/modules/vfs_fruit.c       | 12 +++++++++++-
 source3/smbd/server.c             |  8 +++++++-
 source4/torture/vfs/fruit.c       |  8 +++++++-
 5 files changed, 37 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_fruit.8.xml 
b/docs-xml/manpages/vfs_fruit.8.xml
index e2e696c..08b8700 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -162,6 +162,15 @@
            </listitem>
          </varlistentry>
 
+         <varlistentry>
+           <term>fruit:model = MacSamba</term>
+           <listitem>
+             <para>This option defines the model string inside the AAPL
+             extension and will determine the appearance of the icon 
representing the
+             Samba server in the Finder window.</para>
+             <para>The default is <emphasis>MacSamba</emphasis>.</para>
+           </listitem>
+         </varlistentry>
        </variablelist>
 </refsect1>
 
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 97ecaa4..5734f42 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -379,9 +379,9 @@ SMBC_opendir_ctx(SMBCCTX *context,
         char *options = NULL;
        char *workgroup = NULL;
        char *path = NULL;
+       size_t path_len = 0;
         uint16_t mode;
        uint16_t port = 0;
-        char *p = NULL;
        SMBCSRV *srv  = NULL;
        SMBCFILE *dir = NULL;
        struct sockaddr_storage rem_ss;
@@ -801,7 +801,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
 
                        /* Now, list the files ... */
 
-                        p = path + strlen(path);
+                        path_len = strlen(path);
                        path = talloc_asprintf_append(path, "\\*");
                        if (!path) {
                                if (dir) {
@@ -843,7 +843,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
                                          * got would have been EINVAL rather
                                          * than ENOTDIR.
                                          */
-                                        *p = '\0'; /* restore original path */
+                                        path[path_len] = '\0'; /* restore 
original path */
 
                                         if (SMBC_getatr(context, srv, path,
                                                         &mode, NULL,
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index a03f454..c73e3ae 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -138,6 +138,7 @@ struct fruit_config_data {
        bool veto_appledouble;
        bool posix_rename;
        bool aapl_zero_file_id;
+       const char *model;
 
        /*
         * Additional options, all enabled by default,
@@ -1589,6 +1590,9 @@ static int init_fruit_config(vfs_handle_struct *handle)
        config->readdir_attr_max_access = lp_parm_bool(
                SNUM(handle->conn), "readdir_attr", "aapl_max_access", true);
 
+       config->model = lp_parm_const_string(
+               -1, FRUIT_PARAM_TYPE_NAME, "model", "MacSamba");
+
        SMB_VFS_HANDLE_SET_DATA(handle, config,
                                NULL, struct fruit_config_data,
                                return -1);
@@ -2212,7 +2216,7 @@ static NTSTATUS check_aapl(vfs_handle_struct *handle,
        if (req_bitmap & SMB2_CRTCTX_AAPL_MODEL_INFO) {
                ok = convert_string_talloc(req,
                                           CH_UNIX, CH_UTF16LE,
-                                          "Samba", strlen("Samba"),
+                                          config->model, strlen(config->model),
                                           &model, &modellen);
                if (!ok) {
                        return NT_STATUS_UNSUCCESSFUL;
@@ -2542,6 +2546,9 @@ static NTSTATUS check_ms_nfs(vfs_handle_struct *handle,
                                struct fruit_config_data,
                                return NT_STATUS_UNSUCCESSFUL);
 
+       if (!global_fruit_config.nego_aapl) {
+               return NT_STATUS_OK;
+       }
        if (psd->dacl == NULL || !config->unix_info_enabled) {
                return NT_STATUS_OK;
        }
@@ -5121,6 +5128,9 @@ static NTSTATUS fruit_fget_nt_acl(vfs_handle_struct 
*handle,
        /*
         * Add MS NFS style ACEs with uid, gid and mode
         */
+       if (!global_fruit_config.nego_aapl) {
+               return NT_STATUS_OK;
+       }
        if (!config->unix_info_enabled) {
                return NT_STATUS_OK;
        }
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 6d0c664..a9aa796 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -383,6 +383,7 @@ static bool smbd_notifyd_init(struct messaging_context 
*msg, bool interactive,
        struct tevent_req *req;
        pid_t pid;
        NTSTATUS status;
+       bool ok;
 
        if (interactive) {
                req = notifyd_req(msg, ev);
@@ -424,7 +425,12 @@ static bool smbd_notifyd_init(struct messaging_context 
*msg, bool interactive,
        messaging_send(msg, pid_to_procid(getppid()), MSG_SMB_NOTIFY_STARTED,
                       NULL);
 
-       return tevent_req_poll(req, ev);
+       ok = tevent_req_poll(req, ev);
+       if (!ok) {
+               DBG_WARNING("tevent_req_poll returned %s\n", strerror(errno));
+               exit(1);
+       }
+       exit(0);
 }
 
 static void notifyd_init_trigger(struct tevent_req *req);
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c
index 6c3fee9..1eb5eff 100644
--- a/source4/torture/vfs/fruit.c
+++ b/source4/torture/vfs/fruit.c
@@ -1252,7 +1252,13 @@ static bool enable_aapl(struct torture_context *tctx,
        torture_assert_goto(tctx, aapl != NULL, ret, done, "missing AAPL 
context");
 
        if (!is_osx_server) {
-               torture_assert_goto(tctx, aapl->data.length == 50, ret, done, 
"bad AAPL size");
+               size_t exptected_aapl_ctx_size;
+
+               exptected_aapl_ctx_size = strlen("MacSamba") * 2 + 40;
+
+               torture_assert_goto(
+                       tctx, aapl->data.length == exptected_aapl_ctx_size,
+                       ret, done, "bad AAPL size");
        }
 
        aapl_server_caps = BVAL(aapl->data.data, 16);


-- 
Samba Shared Repository

Reply via email to