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
Post a Comment