AuthorizationExecuteWithPrivileges pipe?
嗯,我有这样一些代码:AuthorizationExecuteWithPrivileges pipe?
FILE *file; AuthorizationRef authorizationRef; 
OSStatus status; 
... 
status = AuthorizationExecuteWithPrivileges(authorizationRef, "/sbin/mount_hfs", kAuthorizationFlagDefaults, args, &file); 
... 
也是我收到预期的错误“mount_hfs:无效的参数”,同时执行。 有没有简单的方法来跟踪这个错误? 喜欢:
return NO; //if error is "mount_hfs: Invalid argument" 和
return YES; //if no errors 我已经试过这
if(file != NULL)     { 
     while(fgets(buffer,255,file) != NULL) 
     { 
      printf("%s",buffer); 
     } 
     pclose(file); 
    } 
文件不为空,但没有打印:|
回答:
Google for SMJobless。这就是你应该使用的,但我还没有想到如何使用该模型中的命令参数。
以上是 AuthorizationExecuteWithPrivileges pipe? 的全部内容, 来源链接: utcz.com/qa/265145.html

