On Monday 16 May 2005 11:25, Russell Howe wrote: > 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.
That is *exactly* what I said above. > > 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". No, see below. > The current code does not distinguish > between the two, as it uses strncmp. I'm having trouble explaining > myself clearly here, I know :) /servicehelper is an old artifact that should not be used, unless you want to have all kinds of problems -- see below. > > > 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? The bacula-fd runs both the daemon and the systray icon. They are just two different threads of the same program. > >> > >>HKLM\Software\Microsoft\Windows\CurrentVersion\Run has this: > >> > >>Name: Bacula > >>Value: "c:\bacula\bin\bacula-fd.exe" /servicehelper If that is how you are starting Bacula, then you are starting it incorrectly. This is probably just some other key that the original code setup that is not used by Bacula. Bacula should always be started as /service. I have no idea what the service helper code does. It is old original code that is not functional as best I know, and I just didn't bother to rip it out. > >> > >>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?). I could be wrong, but I think you are going in a completely wrong direction. As I previously stated, most likely it has something to do with interacting with the user. If it is not that then it is some new requirement that Microsoft has added in the past few years to interact with the Service Manager that Bacula does not understand. -- Best regards, Kern ("> /\ V_V ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users