bugGNUstep - Bugs: bug #29012, Service executable cannot read the...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #29012: Service executable cannot read the service's info dictionary

Submitted by:  Wolfgang Lux <wlux>
Submitted on:  Fri 26 Feb 2010 02:22:00 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 26 Feb 2010 04:57:29 PM UTC, comment #2:

Reported as working.

Richard Frith-Macdonald <CaS>
Project Member
Fri 26 Feb 2010 03:16:50 PM UTC, comment #1:

Thanks.
I applied the suggested fix.

Richard Frith-Macdonald <CaS>
Project Member
Fri 26 Feb 2010 02:22:00 PM UTC, original submission:

E.g., add the following lines to the main function of GSspell.service

NSLog(@"mainBundle = %@", [NSBundle mainBundle]);
NSLog(@"resourcePath = %@", [[NSBundle mainBundle] resourcePath]);
NSLog(@"infoDictionary = %@", [[NSBundle mainBundle] infoDictionary]);

Running the modified service executable yields the output

2010-02-26 14:34:40.278 GSspell[28696] mainBundle = <NSBundle: 0x33d1e08> </usr/GNUstep/System/Library/Services/GSspell.service/Resources/GSspell>
2010-02-26 14:34:40.310 GSspell[28696] resourcePath = /usr/GNUstep/System/Library/Services/GSspell.service/Resources/GSspell/Resources
2010-02-26 14:34:40.313 GSspell[28696] infoDictionary = {}

The problem is caused by NSBundle's -mainBundle method, which IMO implements a wrong search order. It assumes that the executable is part of a bundle only when the parent directory ends in one of the known application suffixes and .service is not one of them. Of course, one could trivially add .service to the list of known suffixes, but I think this is just a stop gap measure, since it will break immediately when an application introduces its own kind of executable plugin bundles. The inclusion of .gswa and .woa in the list of known extensions looks to me a witness of this shortcoming.

I think that -mainBundle really should first check whether the executable is part of a bundle regardless of the parent directory's extension, i.e., check whether there is a Resources directory containing an Info.plist or Info-gnustep.plist file in the same directory as the executable. Only if that check fails, -mainBundle should look for a Resources directory in another place.

Wolfgang Lux <wlux>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by wlux (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 26 Feb 2010 04:57:29 PM UTCCaSOpen/ClosedIn Test=>Closed
    Fri 26 Feb 2010 03:16:50 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test

    Back to the top


    Powered by Savane 3.1-cleanup1