Index: trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm =================================================================== --- trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm (revision 379) +++ trunk/ChameleonPrefPane/Sources/ChameleonPrefPane.mm (revision 380) @@ -76,16 +76,19 @@ //-------------------------------------------------------------------------- -(bool) savePreferences: (NSDictionary*) dict { - std::string sPath = [kPreferencesFilePath UTF8String]; - if(dict==nil || sPath.length()==0) return false; + if(dict==nil) return false; AuthorizationRef auth = [self isUnlocked] ? [[authView authorization] authorizationRef] : NULL; + if (!auth) return false; - PropertyList::chmodFile(sPath.c_str(), "0777", auth); - [dict writeToFile:kPreferencesFilePath atomically:YES]; - PropertyList::chmodFile(sPath.c_str(), "0644", auth); - return true; + NSString* tmpPropName = @"/tmp/chamPrefPane.plist"; + BOOL ret = [dict writeToFile:tmpPropName atomically:YES]; + if (!ret) return false; + NSString* args = [NSString stringWithFormat:@"%@ %@", tmpPropName, kPreferencesFilePath]; + const char * cArgs = [args UTF8String]; + ret = executePrivilegedCmd(auth, "/bin/cp", cArgs , NULL); + return ret; } //-------------------------------------------------------------------------- Index: trunk/ChameleonPrefPane/Sources/PropertyList.cpp =================================================================== --- trunk/ChameleonPrefPane/Sources/PropertyList.cpp (revision 379) +++ trunk/ChameleonPrefPane/Sources/PropertyList.cpp (revision 380) @@ -138,6 +138,9 @@ std::string args = chmodMask; args += ' '; args += path; + struct stat st; + if (stat(path,&st)!=0) + executePrivilegedCmd(auth, "/usr/bin/touch", path, flags); if(!executePrivilegedCmd(auth, "/bin/chmod", args.c_str(), flags)) return false; } Index: trunk/ChameleonPrefPane/bin/OSX106/Chameleon.zip =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/ChameleonPrefPane/bin/version =================================================================== --- trunk/ChameleonPrefPane/bin/version (revision 379) +++ trunk/ChameleonPrefPane/bin/version (revision 380) @@ -1 +1 @@ -r378 +r380