The branch, v3-2-test has been updated
       via  4af1d077915c7bbe5268b78bde71b102861a2b98 (commit)
      from  148437fcd0896591ebbf6c2808723575d025123f (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 4af1d077915c7bbe5268b78bde71b102861a2b98
Author: Jeremy Allison <[email protected]>
Date:   Tue Jan 6 16:06:43 2009 -0800

    Fix bug #6017, - magic script does not work. based on a patch from 
[email protected].
    Jeremy.

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

Summary of changes:
 source/smbd/close.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/close.c b/source/smbd/close.c
index 8c0fa99..7637ffb 100644
--- a/source/smbd/close.c
+++ b/source/smbd/close.c
@@ -67,10 +67,20 @@ static void check_magic(struct files_struct *fsp)
                return;
        }
 
-       chmod(fsp->fsp_name,0755);
-       ret = smbrun(fsp->fsp_name,&tmp_fd);
+       /* Ensure we don't depend on user's PATH. */
+       p = talloc_asprintf(ctx, "./%s", fsp->fsp_name);
+       if (!p) {
+               TALLOC_FREE(ctx);
+               return;
+       }
+
+       if (chmod(fsp->fsp_name,0755) == -1) {
+               TALLOC_FREE(ctx);
+               return;
+       }
+       ret = smbrun(p,&tmp_fd);
        DEBUG(3,("Invoking magic command %s gave %d\n",
-               fsp->fsp_name,ret));
+               p,ret));
 
        unlink(fsp->fsp_name);
        if (ret != 0 || tmp_fd == -1) {


-- 
Samba Shared Repository

Reply via email to