Allow root ownership of client certificate key

Поиск
Список
Период
Сортировка
От David Steele
Тема Allow root ownership of client certificate key
Дата
Msg-id f4b7bc55-97ac-9e69-7398-335e212f7743@pgmasters.net
обсуждение исходный текст
Ответы Re: Allow root ownership of client certificate key  (David Steele <david@pgmasters.net>)
Re: Allow root ownership of client certificate key  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
Hackers,

I noticed recently that permissions checking is done differently for the 
server certificate key than the client key. Specifically, on the server 
the key can have 640 perms if it is owned by root.

On the server side this change was made in 9a83564c and I think the same 
rational applies equally well to the client key. At the time managed 
keys on the client may not have been common but they are now.

Attached is a patch to make this change.

I was able to this this manually by hacking 001_ssltests.pl like so:

-    chmod 0640, "ssl/${key}_tmp.key"
+    chmod 0600, "ssl/${key}_tmp.key"
        or die "failed to change permissions on ssl/${key}_tmp.key: $!";
-    system_or_bail("sudo chown root ssl/${key}_tmp.key");

But this is clearly not going to work for general purpose testing. The 
server keys also not tested for root ownership so perhaps we do not need 
that here either.

I looked at trying to make this code common between the server and 
client but due to the differences in error reporting it seemed like more 
trouble than it was worth.

Regards,
-- 
-David
david@pgmasters.net
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: XTS cipher mode for cluster file encryption
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Experimenting with hash tables inside pg_dump