일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- WebAuthn
- 안드로이드
- fido
- git
- Xcode
- appres
- apple
- MFA
- 앱스토어
- openssl
- 애플
- Android
- css
- 앨범북
- albumbook
- SSL
- FIDO2
- kmip
- SwiftUI
- Nodejs
- OTP
- SSH
- otpkey
- MYSQL
- MSYS2
- SWIFT
- 앱리소스
- 인증
- 2FA
- OSX
- Today
- Total
목록AuthorizationExecuteWithPrivileges (2)
인디노트
// import 필요 #import // ... // 시스템 종료 함수 void ShutDown() { // 예약된 종료 요청을 만듭니다 AuthorizationRef authorizationRef; AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &authorizationRef); const char *tool = "/sbin/shutdown"; char *argv[3] = { "-h", "now", NULL }; FILE *pipe = NULL; OSStatus status = AuthorizationExecuteWithPrivileges(authorizationRef, tool, kAuthor..
MacOS 10.7 (Lion)부터 Apple은 AuthorizationExecuteWithPrivileges 함수를 더 이상 권장하지 않으며, 대신 SMJobBless 함수를 사용하도록 권장합니다. SMJobBless 함수는 권한이 필요한 작업을 수행하기 위해 Launch Services를 사용하여 승인된 helper 도구를 설치하고 실행하는 기능을 제공합니다. 아래는 SMJobBless 함수를 사용하여 승인된 helper 도구를 설치하고 실행하는 예시 코드입니다: // import 필요 #import // ... // helper 도구의 Bundle ID NSString *helperBundleID = @"com.example.helper"; // helper 도구를 설치하기 위한 인증 객체 생성 N..