mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
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>
This commit is contained in:
parent
defbc70b4a
commit
f8adf1a323
4 changed files with 69 additions and 24 deletions
|
@ -50,3 +50,18 @@ assert_migrated()
|
|||
setup_home
|
||||
trigger_migration
|
||||
assert_migrated
|
||||
|
||||
# Test with an existing private-keys-v1.d.
|
||||
setup_home
|
||||
mkdir "$GNUPGHOME/private-keys-v1.d"
|
||||
trigger_migration
|
||||
assert_migrated
|
||||
|
||||
# Test with an existing private-keys-v1.d with weird permissions.
|
||||
setup_home
|
||||
mkdir "$GNUPGHOME/private-keys-v1.d"
|
||||
chmod 0 "$GNUPGHOME/private-keys-v1.d"
|
||||
trigger_migration
|
||||
assert_migrated
|
||||
|
||||
# XXX Check a case where the migration fails.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue