Changes to Keychains in macOS Sierra


This article is related to macOS Sierra 10.12.1 and 10.12.2. Because i am still working on 10.12.3 beta update to find out all keychain changes.
Recently i upgraded my macbook from El Capitan to Sierra and found that my keychain update script has stopped working. Which really made me too confused about its functionality.
My script had a function in which i mentioned the manual path of the login keychain with the $user variable which was like :
1
\Users\$user\Library\Keychains\login.keychain
But after upgrade to macOS Sierra, it has stopped working because they have change the login.keychain name.
1
\Users\$user\Library\Keychains\login.keychain-db
This change has some issues right now. Like your old script with manual path would not work and it can cause some AD account lockout issues.
For AD account lockout issues, it has some rumours that it will be fixed in 10.12.3. Hoping for the best.
For your shell scripts in which you need to give the login keychain path. I made a small change in the script and it is working fine with macOS sierra and El Capitan as well. Here is the change in the script which i created.
1
2
3
currentLoginKeychain=`security login-keychain`
grepCurrentLoginKeychain=`echo $currentLoginKeychain | tr -d '"'`
echo $grepCurrentLoginKeychain
Now there is not need to user $user variable with manual keychain path. This script will fetch the current login keychain of the user.

Thanks for your reading, if you like it please comment.

0 comments:

Post a Comment