How to fix corrupt keychain permissions
Make sure /Library/Keychains/System.keychain has correct permissions set.

Here is default permissions for /Library/Keychains folder on my Mac:

drwxr-xr-x    9 root  wheel   306 10 Jul 20:03 Keychains

and default permissions for /Library/Keychains/System.keychain

-rw-r--r--  1 root  wheel  124000  7 Jul 05:38 System.keychain

Also check permissions for your user keychain folder, mine are for the folder ~/Library/Keychains/:

drwxr-xr-x    9 username  staff    306 10 Jul 21:49 Keychains

and the user keychains itself:

drwx------  7 username  staff      238 25 Mar 13:36 A2676C22-A84E-5B3D-8711-0264BC3C8B96
-rw-r--r--  1 username  staff      277 21 Mar 07:28 E41FE5C0-3020-48C9-8829-344FF3E86407

Here is the default permission for /var on my Mac.

lrwxr-xr-x@   1 root  wheel    11 14 Jan 15:39 var -&gt; private/var

Here are the default permissions for everything inside of my /var folder.

drwx------     2 root       wheel          68 24 Oct  2015 agentx
drwxr-xr-x     8 daemon     wheel         272 14 Jan 13:00 at
drwx------  7107 root       wheel      241638 10 Jul 20:03 audit
drwx------     2 root       wheel          68 16 Sep  2015 backups
drwxr-xr-x    77 root       wheel        2618 10 Jul 20:03 db
drwxr-x---     3 _dovecot   mail          102  9 Mar 12:12 dovecot
drwxr-xr-x     2 root       sys            68 16 Sep  2015 empty
drwxr-xr-x     7 root       wheel         238  4 Jun 10:47 folders
drwxr-x---     3 _jabber    _jabber       102  9 Mar 12:12 jabberd
drwxr-xr-x     3 root       wheel         102  1 Aug  2015 lib
drwxr-xr-x   106 root       wheel        3604 10 Jul 20:03 log
drwxrwxr-x     2 root       mail           68 16 Sep  2015 mail
drwxr-xr-x     3 root       wheel         102 16 Sep  2015 msgs
drwxr-xr-x     2 root       wheel          68 16 Sep  2015 netboot
drwxr-xr-x     5 _networkd  _networkd     170 25 Mar 18:36 networkd
drwxrwxr-x     2 _postgres  _postgres      68 27 May 09:22 pgsql_socket
drwxr-x---     6 root       wheel         204 27 May 09:22 root
drwxr-xr-x     4 root       wheel         136 24 Oct  2015 rpc
drwxrwxr-x    49 root       daemon       1666 10 Jul 21:29 run
drwxr-xr-x     2 daemon     wheel          68 16 Sep  2015 rwho
drwxr-xr-x    37 root       wheel        1258 10 Jul 21:29 servermgrd
drwxr-xr-x     7 root       wheel         238 14 Jan 13:01 spool
drwxrwxrwt    16 root       wheel         544 10 Jul 21:29 tmp
drwxr-xr-x     4 root       wheel         136 10 Jul 20:32 vm
drwxr-xr-x     3 root       wheel         102 16 Sep  2015 yp