Kern Sibbald wrote: > Hello, > > I suspect that it is not a question of bconsole.exe or bacula-fd.exe doing > anything, but rather any time a Windows console application is started, the > OS wants to run the tray application for that console. If it is not a local > graphical screen, but some tty console for doing maintenance, the tray > monitor is not going to be able to display itself or to interact with the > user, so it gets upset.
Which provides the tray icon? From what I can see, bconsole.exe isn't involved here, it's just bacula-fd. bacula.fd.exe seems to take several command line parameters. One of them is /service, which means "You're being run by the service controller. Do your service thing". Another is /servicehelper, which looks to mean "Display pretty system tray icon". The current code does not distinguish between the two, as it uses strncmp. I'm having trouble explaining myself clearly here, I know :) > Who knows. Anyway, if someone can supply a patch that does not break it on a > regular screen console, great -- otherwise, at the moment, it is not one of > my priorities. I can supply a patch, but I don't have a win32 build environment here, so I wouldn't be able to test it... As far as I can tell, the fix is to change line if (strncmp(&szCmdLine[i], BaculaRunService, \ strlen(BaculaRunService)) == 0) { to if (strcmp(&szCmdLine[i], BaculaRunService) == 0) { or to change the commandline parameters so that there is no conflict when comparing with strncmp (i.e. don't have any parameters where one is a substring of another, beginning at the 1st character). Changing the command line parameters would seem to break things, however. > On Friday 13 May 2005 18:33, Russell Howe wrote: >>Now, the question is what commandline is bacula-fd.exe being run with >>when starting at logon to provide the systray icon? >> >>HKLM\Software\Microsoft\Windows\CurrentVersion\Run has this: >> >>Name: Bacula >>Value: "c:\bacula\bin\bacula-fd.exe" /servicehelper >> >>The problem (as far as I can see - I haven't got the setup to build >>Windows programs here) is that strncmp(&szCmdLine[i], BaculaRunService, >>strlen(BaculaRunService)) is being called like this: >> >>strncmp("/servicehelper", "/service", 8) and is only matching on the 1st >>8 characters of "/servicehelper". >> >>"/service" is then seen as equal to "/servicehelper" >> >>Should it not be strcmp(&szCmdLine[i], BaculaRunService)? Is >>szCmdLine[i] trusted? Trusted to be null terminated, rather (otherwise it may be a potential vulnerability?). -- Russell Howe [EMAIL PROTECTED] Today's Nemi: http://www.metro.co.uk/img/pix/nemi_may16.jpg
smime.p7s
Description: S/MIME Cryptographic Signature