From: Cynthia F. <1cy...@te...> - 2013-04-23 22:48:05
|
On 2013-04-23 9:14 AM, Christian Franke wrote: > Meantime I tested this with a fresh XP Prof SP3 (German) installation. > Smartd 6.1 and blat worked with plain SP3 and also after all security > patches were installed. > >>> If it works with "smartd -d" or "smartd -q onecheck" then could be a >>> problem related to PATH or account differences. >> >> Only if v6.1-1 requires a different system configuration from v5.4x. > > Smartd 6.1 requires that bat/cmd files could be run via "cmd.exe /c". > This apparently does not work on your system if smartd is run as a > service under SYSTEM account. Courtesy of PSTools from Sysinternals, I tried these to successfully confirm that I can get a SYSTEM shell and that it has C:\WINDOWS\system32 in its PATH: psexec -is cmd.exe /k set USER psexec -is cmd.exe /k set PATH and these to successfully confirm that the SYSTEM account itself can indeed run both executables and batch files indirectly by launching another shell itself: psexec -is cmd.exe /k cmd.exe /k mem psexec -is cmd.exe /c cmd.exe /c notepad echo "notepad" > d:\temp.bat psexec -is cmd.exe /c cmd.exe /c d:\temp.bat all of which tells me that the SYSTEM account has everything it needs to achieve what smartd requires, unless of course there's something different about a Windows service running as SYSTEM. > Older smartd versions (6.0, 5.43, ...) require this only if '-M exec' > specifies a path to such a file. > > So with 6.0 or 5.43 the following test probably would not work for you: > > smartd.conf: > .... -m ... -M exec C:\bin\test.cmd -M test > > C:\bin\test.cmd: > @echo off > C:\bin\blat %* I tried exactly that just now with smartd v5.43 and it actually does work as it should. This strongly suggests to me that the SYSTEM account really does have everything it needs to get the job done even when running as a service. Surely there must be another critical difference between v5.43 and v6.1 with regard to how the emailing functionality is handled. The very existence of smartd_warning.cmd is one obvious one. For example, is it possible that v6.1 is also seeking some other utility somewhere in the PATH prior or during cmd.exe/blat.exe/smartd_warning.cmd, or that PATH is being modified or cleared by smartd? I ask this because the most likely difference between my systems and yours are the PATH variable and because my experience says that services do well not to assume that PATH is reliable (nor even safe, given the excellent opportunity for users/malware to abuse it for privilege escalation security breaches). Cynthia |