The branch, master has been updated
       via  e13983870f00f83420cca554a541165214dc4e06 (commit)
      from  7b77ac5365a05d5de359e1e8d8ca7ac7e40a09f0 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e13983870f00f83420cca554a541165214dc4e06
Author: Jeremy Allison <[email protected]>
Date:   Tue Jan 6 16:05:28 2009 -0800

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

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

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


Changeset truncated at 500 lines:

diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index f91f1fc..a6dff20 100644
--- a/source3/smbd/close.c
+++ b/source3/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