objective c - SecPKCS12Import function doesn't work properly if run agent/daemon under root -


i have osx agent should read data p12 file placed in project. there function secpkcs12import security.framework that. problem if run agent under root right after installing appropriated folder following function doesn't return certificate's data (&items parameter) returns status error "0".

sudo launchctl load com.myagent.agent.plist 

but after osx reboot agent startups under root , works fine.

if run agent under user permissions works fine without osx reboot.

here plist file:

<?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict>     <key>username</key>     <string>root</string>     <key>standarderrorpath</key>     <string>/usr/local/myagent/agent.log</string>     <key>standardoutpath</key>     <string>/usr/local/myagent/agent.log</string>     <key>label</key>     <string>com.myagent.agent</string>     <key>programarguments</key>     <array>         <string>/applications/agent.app/contents/macos/agent</string>     </array>     <key>keepalive</key>     <true/> </dict> </plist> 

i use osx 10.8

how solve problem above?


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -