saltstack/salt — pull request #1560 by SEJeff (2012-07-01 23:57:16+00:00)
Title: Unify user check

This request unifies the code for checking that a user has access to read the keys for ```salt```, ```salt-call```, and ```salt-run```. It fixes bugs #1554 and #1555 that @KB1JWQ reported at the salt sprint yesterday.

```bash

$ whoami
jeff
$ grep ^user: /etc/salt/master
user: jeff
$ ./salt '*' test.ping
Could not access directory /var/cache/salt. Please give jeff read permissions.
$ ./salt-run manage.up
Could not access directory /var/cache/salt. Please give jeff read permissions.
$ ./salt-call state.highstate
Could not access directory /etc/salt/pki. Please give jeff read permissions.
$ sudo vim /etc/salt/minion
$ grep ^user: /etc/salt/master
user: root
$ ./salt-call state.highstate
Could not access directory /etc/salt/pki. Try running as user root.
```