IOKitカーネル拡張内でTrustedBSDのMACポリシーを使用するにはどうすればよいですか?IOKitとTrustedBSDのポリシー
すでにIOKit拡張機能があり、いくつかのポリシーを追加したいと思います。
テストのために、私は2つのダミー拡張を書きました.1つはIOKitと一般的なものを使用していました。
IOKitがシンボルmac_policy_register
とmac_policy_unregister
のリンクエラーを生成している間は、汎用拡張機能は完璧に動作しています。
$ sudo kextutil -tn /tmp/MACPolicy.kext
kxld[com.Test.MACPolicy]: The following symbols are unresolved for this kext:
kxld[com.Test.MACPolicy]: mac_policy_register(mac_policy_conf*, unsigned int*, void*)
kxld[com.Test.MACPolicy]: mac_policy_unregister(unsigned int)
Link failed (error code 5).
Check library declarations for your kext with kextlibs(8).
$ sudo kextlibs -v 6 -undef-symbols /tmp/MACPolicy.kext
Kext user-space log filter changed from 0xff2 to 0xfff.
Kext kernel-space log filter changed from 0xff2 to 0xfff.
Kext library architecture set to x86_64.
Kext library architecture is x86_64 (unchanged).
For all architectures:
com.apple.kpi.iokit = 15.4
com.apple.kpi.libkern = 15.4
For x86_64:
2 symbols not found in any library kext:
__Z21mac_policy_unregisterj
__Z19mac_policy_registerP15mac_policy_confPjPv
は、私はすでにいない成功を収めて、com.apple.kpi.dsep
、com.apple.kpi.unsupported
、com.apple.kpi.mach
またはそれらの任意の組み合わせだけでなく、私のInfo.plist
に指定されたライブラリを追加しました。
これについて私が知ることができるすべての情報は、thread on the darwin-kernelディスカッションリストです。
私は現在、OS X 10.11をターゲットにしています。
これはまた、この[コメント](http://stackoverflow.com/questions/27702967/mount-approval-callback-on-mac-os-x#comment53763572_27754917) – MathPlayer