Re: Concurrent psql patch

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Concurrent psql patch
Дата
Msg-id 464D9808.5000701@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Concurrent psql patch  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Список pgsql-patches
Pavan Deolasee wrote:
> --- 1179,1189 ----
>                              dbname, user, password);
>
>        /* We can immediately discard the password -- no longer needed */
> !       if (password)
> !       {
> !           memset(password, '\0', strlen(password));
>            free(password);
> +       }
>
>
> Any reason why we do this ? "password" is anyways freed.  I think you
> might have left it behind after some debugging exercise.

I believe it's for security reasons. If that memory page is for example
swapped to disk after freeing the field, the password would be written
to the swapfile. Someone who steals your laptop would be able to recover
it from there. Clearing passwords from memory when they're no longer
needed is a good practice.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Maintaining cluster order on insert
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Updateable cursors patch