osx - Mac app: want to copy system files out of the protected location, and failed -


in mac program, want copy file located in /private/var/db/dslocal/nodes/default/users/xx.plist to disc.

presumably failed, , is. use api of copyitematpath:topath:error: this, , nslog out error infomation: says /private/var/db/dslocal/nodes/default/users/xx.plist this file couldn't opened because don't have permission view it. operation couldn't completed, permission denied.

and can introduce me documentations or sample codes should read solve problem? please!

you're trying requires user administrator (or root), requires elevated access. way go in osx factor out privileged code separate executable run elevated permissions, after having prompted user administrator's credentials.

take @ osx authorization services prompting user: https://developer.apple.com/library/mac/#documentation/security/reference/authorization_ref/reference/reference.html

and smjobbless creating application elevated rights: - https://developer.apple.com/library/mac/#samplecode/smjobbless/introduction/intro.html


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -