IOS-1784 Separate concerns. IOS-1784
authorDirk Zimmermann <dz@pep.security>
Fri, 06 Sep 2019 11:03:27 +0200
branchIOS-1784
changeset 12256d89f5f624db
parent 1224 dd09a3ede1d0
child 1226 e808633de8ea
IOS-1784 Separate concerns.
pEpObjCAdapter/PEPObjCAdapter.m
     1.1 --- a/pEpObjCAdapter/PEPObjCAdapter.m	Fri Sep 06 11:03:27 2019 +0200
     1.2 +++ b/pEpObjCAdapter/PEPObjCAdapter.m	Fri Sep 06 11:03:27 2019 +0200
     1.3 @@ -60,7 +60,12 @@
     1.4  + (void)initialize
     1.5  {
     1.6      s_homeURL = [self createApplicationDirectory];
     1.7 -    [self setPerMachineDirectory:s_homeURL]; // Important, defines $HOME for the engine
     1.8 +
     1.9 +    // The engine will put its per_user_directory under this directory.
    1.10 +    setenv("HOME", [[s_homeURL path] cStringUsingEncoding:NSUTF8StringEncoding], 1);
    1.11 +
    1.12 +    // This informs the engine's per_machine_directory.
    1.13 +    [self setPerMachineDirectory:s_homeURL];
    1.14  }
    1.15  
    1.16  + (NSURL *)homeURL
    1.17 @@ -117,9 +122,6 @@
    1.18  + (void)setPerMachineDirectory:(NSURL *)homeDir
    1.19  {
    1.20  #if TARGET_OS_IPHONE
    1.21 -    // Set HOME, which is also important for the perUser directory later
    1.22 -    setenv("HOME", [[homeDir path] cStringUsingEncoding:NSUTF8StringEncoding], 1);
    1.23 -
    1.24      if (perMachineDirectory) {
    1.25          free((void *) perMachineDirectory);
    1.26      }