[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-4800-g8bd7b19

Jeremy Allison jra at samba.org
Wed Jan 7 00:07:12 GMT 2009


The branch, v3-3-test has been updated
       via  8bd7b19aaafe96ec6ac0bf700ec9dd337b598c03 (commit)
      from  e7433112f4f05aeaf9a3c03ec58962c4d9e16c7d (commit)

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


- Log -----------------------------------------------------------------
commit 8bd7b19aaafe96ec6ac0bf700ec9dd337b598c03
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 6 16:06:22 2009 -0800

    Fix bug #6017, - magic script does not work. based on a patch from monyo at samba.gr.jp.
    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 32231f4..25552e3 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


More information about the samba-cvs mailing list