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 <[email protected]>
Date: Tue Jan 6 16:06:22 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 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