mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
Fix bug #6017, - magic script does not work. based on a patch from monyo@samba.gr.jp.
Jeremy.
This commit is contained in:
parent
7b77ac5365
commit
e13983870f
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user