1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mac を起動すると「アプリケーション"ksadmin"を使用するためのアクセス権がありません。」ダイアログ

Last updated at Posted at 2018-11-01

macOS HighSierra で、セキュリティを強化した(アプリケーションの制限をかけた)ら、起動時に「アプリケーション使用するためのアクセス権がありません」エラーメッセージが出ました。

スクリーンショット 2018-10-26 21.31.11.png

「許可」すればいいだけなのですが、"ksadmin" とは何のアプリか気になったので調べてみました。

  • 動作/検証環境
    • macOS HighSierra(OSX 10.13.6)
    • Google Chrome 70.0.3538.77(Official Build) (64 ビット)

TL;DR(概要)

ksadmin」は、Google Chrome の不具合情報の確認・報告などの管理コマンド・アプリです。

Google のサービス(監視アプリ)が、起動時に不具合の最新チケット情報を確認しようとするも、ksadmin に許可がないためエラーが表示されます。

このエラーメッセージを非表示にしたい場合は、GoogleSoftwareUpdateAgent も許可する必要があります。(表示される確認メッセージで、関連するアプリを「常に許可...」でも可)

スクリーンショット 2018-10-28 0.25.38.png

関連アプリ

ksadmin 以外にも、以下のアプリで「アプリケーション "xxx" を使用するためのアクセス権がありません」エラーが発生する場合があります。

  1. ksadmin
  2. ksfetch
  3. crashpad_handler
  4. GoogleSoftwareUpdateDaemon

ディレクトリで許可出来る場合は下記ディレクトリ以下を許可します。

/Library/Google/GoogleSoftwareUpdate

TS;DR(詳細)

ksadmin は、アプリのクラッシュや予期せぬエラーなどが発生した場合、Google に送るチケット(障害報告)の発行、もしくは発行済みの確認を行うコマンドで、デーモンcrashpad_handler コマンドなどが呼び出して Google に通知します。(両者のコマンドについては下記を参照)

しかし、この ksadmin コマンドは GoogleSoftwareUpdate バンドル(アプリ)に内包されています。

該当アプリの設置先ディレクトリ

ksadmin, ksfetch, crashpad_handler, GoogleSoftwareUpdateDaemon などは下記ディレクトリに設置されています。(GoogleSoftwareUpdate.bundleの中)

上記アプリのディレクトリ・パス
/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/
$ cd /Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle
$ cd /Contents/MacOS/
$ ls -la
total 1544
drwxr-xr-x  6 root  wheel     192  6  7 06:43 .
drwxr-xr-x  7 root  wheel     224  6  7 06:43 ..
-rwxr-xr-x  1 root  wheel  235088  6  7 06:43 GoogleSoftwareUpdateDaemon
-rwxr-xr-x  1 root  wheel  353680  6  7 06:43 crashpad_handler
-rwxr-xr-x  1 root  wheel  130672  6  7 06:43 ksadmin
-rwxr-xr-x  1 root  wheel   63936  6  7 06:43 ksfetch

つまり、ペアレンタル・コントロールやセキュリティ・アプリなどで、起動できるアプリに制限をかけている場合で、Google Chrome のみを許可した場合に、GoogleSoftwareUpdate も許可しておかないと、ksadmin などの必要な関連する機能が起動/実行できない旨、エラーメッセージとして表示されます。

これは OS 起動時に、Google Chrome の既存の障害情報(チケット情報)の確認が行われるため、ksadmin が呼び出されるからです。

アプリの役割

Google Chrome は、障害/クラッシュ/不具合などの報告に、Chromium の Crashpad システムを利用しています。この Crashpad システムの通知サーバが crashpad_handler です。

スクリーンショット 2018-11-01 16.20.19_1200x.png

crashpad_handler は、受け取った諸障害報告から Google に報告すべきバグであると判断した場合「チケット」と呼ばれる、作業タスクのようなものを発行し、Google のサーバーに送信します。

そして、ksadmin はそのチケットの発行および確認用のコマンドです。

スクリーンショット 2018-10-26 21.31.11.png

crashpad_handler ksadmin どちらも、コマンドからの呼び出しが可能で、パスが通っていないので絶対パスで直打ち+ヘルプ(-helpオプション)でオプションや引数を確認できます

また、バンドルされているアプリ名の「Google Software Update」からわかる通り、ksadmin はソフトウェア・アップデート関連の一部ということがわかります。

問題は、Google Chrome 自体は、自身の「Google Chrome について」メニューを開かないと最新バージョンの確認とアップグレード(バージョンアップ)を実行しません。

つまり、逆に言うと、バージョンの確認をしない限り Google Software Update は呼び出されないのです。

それなのに「OS 起動時にエラーがでるのは何故か」とデーモンが囁いたので気になりました。

呼び出されるタイミング

OS の起動時に表示されるということは、スタートアップ、サービスやデーモン類で呼び出されているということです。

しかし、スタートアップには追加されていなかったので、macOS のサービス登録を確認すると、いました。アプリをインストールした際にサービスに登録されてたようです。

launchctl
$ launchctl list | grep -e google -e Google
730	0	com.google.Chrome.41272
-	0	com.google.keystone.system.agent
$ ls -ld /Library/Launch*
drwxr-xr-x   9 root  wheel  288 10 25 19:06 /Library/LaunchAgents
drwxr-xr-x  14 root  wheel  448 11  1 08:41 /Library/LaunchDaemons
$
$ ls -la /Library/Launch* | grep -e google -e Google
-rw-r--r--@  1 root   wheel   792  7 18 07:46 com.google.keystone.agent.plist
-rw-r--r--@  1 root  wheel   818  7 18 07:46 com.google.keystone.daemon.plist

ksadmin コマンドの詳細

`ksadmin --help`
$ cd /Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/
$ ./ksadmin --help
Usage: ksadmin [options]
  --delete,-d         Delete a ticket as specified by option --productid
  --list,-l           List the available updates, but don't install any
  --print-brand,-D    Get the brand code for a particular product.  Requires -P
  --print-tag,-G      Get the tag for a particular product.  Requires -P.
  --print-tickets,-p  Print all tickets and exit.  Can be abbreviated --print
  --print-version,-o  Evaluate the version version path, and version tag, and print the effective version.  Requires -P
  --register,-r       Register a new ticket as specified by options.
                      Register requires 4 ticket options: -P, -v, -u, and an --xcsomething
  --brand-key,-b      Set the brand code path key.  Requires -P and -B
  --brand-path,-B     Set the brand code path.  Requires -P and -b.  Specify empty string to remove
  --creation-date,-c  Set the creation date of the ticket
                      Format should be like '1/13/1961 1:13 PM'
  --tag,-g TAG        Set the ticket's tag.  Specify empty string to remove existing tag
  --tag-path,-H       Set the tag path.  Requires -P and -K.  Specify empty string to remove
  --tag-key,-K        Set the tag path key.  Requires -P and -H
  --version,-v VERS   You can also specify -P id and -v VERS to update an existing ticket's version
  --version-path,-a   Set the version path.  Requires -P and -e.  Specify empty string to remove
  --version-key,-e    Set the version path key.  Requires -P and -a
  --productid,-P id   ProductID; can be a GUID or a BundleID
  --store,-s FILE     Use FILE instead of the default ticket store.
                      Default means the system-wide if running as root, or
                      a per-user one if running as non-root
                      (either a per-user or system-wide one)
  --system-store,-S   Use the system-wide ticket store
  --user-store,-U     Use a per-user ticket store
  --user-initiated,-F This operation is initiated by a user; sets the ondemand tag for update checks
  --xcpath,-x PATH    Specify an existence checker that checks for the existence
                      of the given path
  --xclsbundle,-X BID Specify an existence checker that asks LaunchServices whether an
                      application exists with the given Bundle ID
  --xcquery, -q query Specify an existence checker that checks whether the given Spotlight
                      query returns any results
  --url,-u URL        You can also specify -P id and -u URL to update an existing ticket's url
  --cohortHint, -C hint Hint to the update server to move the application to the specified cohort
  --verbose,-V        Print activities verbosely
  --help,-h           Print this message

crashpad_handler コマンドの詳細

`$ crashpad_handler --help`
$ cd /Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/
$ ./crashpad_handler --help
Usage: crashpad_handler [OPTION]...
Crashpad's exception handler server.

      --annotation=KEY=VALUE  set a process annotation in each crash report
      --database=PATH         store the crash report database at PATH
      --handshake-fd=FD       establish communication with the client over FD
      --mach-service=SERVICE  register SERVICE with the bootstrap server
      --no-rate-limit         don't rate limit crash uploads
      --reset-own-crash-exception-port-to-system-default
                              reset the server's exception handler to default
      --url=URL               send crash reports to this Breakpad server URL,
                              only if uploads are enabled for the database
      --help                  display this help and exit
      --version               output version information and exit

Report crashpad_handler bugs to
https://crashpad.chromium.org/bug/new
Crashpad home page: <https://crashpad.chromium.org/>

所感

macOS をインターネットカフェの PC ように再起動で初期化させたかった

シェアハウスに共同で触れるマシンとして、永らく寝ていた iMac をクリーン・インストールしてシェアしようと思いました。

その際、macOS をインターネットカフェの PC ように再起動でユーザー作業を「なかったこと」にさせるために、ゲスト・アカウントでペアレンタルコントロールを有効にしました。

スクリーンショット 2018-10-26 18.03.05.png

利用できるアプリも制限され、Finder 含め非常に良い感じにシンプルになりました。問題は起動時にアクセス権のメッセージが出るようになったことです。

スクリーンショット 2018-11-01 16.19.45_1200x.png

まぁ、これでメッセージの内容はわかったので、安心して「常に許可...」することにしました。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?