agent: Sanitize permissions of the private key directory.
authorJustus Winter <justus@g10code.com>
Wed, 20 Apr 2016 12:55:45 +0000 (14:55 +0200)
committerJustus Winter <justus@g10code.com>
Wed, 20 Apr 2016 13:02:37 +0000 (15:02 +0200)
commitf8adf1a3234655877a4f985d627d98567507002c
treefc52acddf11211860bdfa2608c376bf783884d3a
parentdefbc70b4a16264e067daf76678ecfb9d030dee4
agent: Sanitize permissions of the private key directory.

* agent/gpg-agent.c (create_private_keys_directory): Set permissions.
* common/sysutils.c (modestr_to_mode): New function.
(gnupg_mkdir): Use new function.
(gnupg_chmod): New function.
* common/sysutils.h (gnupg_chmod): New prototype.
* tests/migrations/from-classic.test: Test migration with existing
directory.

GnuPG-bug-id: 2312
Signed-off-by: Justus Winter <justus@g10code.com>
agent/gpg-agent.c
common/sysutils.c
common/sysutils.h
tests/migrations/from-classic.test