Re: pgsql/src/bin/initdb initdb.sh

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: pgsql/src/bin/initdb initdb.sh
Дата
Msg-id Pine.LNX.4.30.0106241315250.900-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: pgsql/src/bin/initdb initdb.sh  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-committers
Bruce Momjian writes:

> This brings up a question.  If I have pid 333 and someone creates a file
> world-writable called /tmp/333, and I go and do:
>
>     cat file >/tmp/$$
>
> isn't another user now able to modify those temp file contents.  Is that
> the insecurity you mentioned Peter, and if so, how do you prevent this?

That is one possibility.  Another exploit is with a symlink from /tmp/333
to a file you want to overwrite.  This is more fun with root, but it's
still not a good idea here.

To securely create a temp file in shell you need to use mktemp(1), or do
something like (umask 077 && mkdir $TMPDIR/$$) to create a subdirectory.
Needless to say, it's tricky.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


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

Предыдущее
От: Bruce Momjian - CVS
Дата:
Сообщение: pgsql/src backend/parser/parse_coerce.c backen ...
Следующее
От: Bruce Momjian - CVS
Дата:
Сообщение: pgsql/src/interfaces/jdbc/org/postgresql/jdbc2 ...