Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution (exec.c)

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution (exec.c)
Дата
Msg-id 87efkih4gi.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution (exec.c)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 >> On systems with openat(), would it not be possible to resolve
 >> symlinks without ever needing chdir?

 Tom> Um ... AFAICS, openat() just opens a file, it doesn't give back a
 Tom> resolved path. Did you mean readlinkat()?

No, what I meant was that if you have openat() (and fstatat() and
fdopendir()), you can do what getcwd does except starting with some
arbitrary directory other than the current one. So the current logic of
"chdir through all symlinks, then do getcwd to find where we landed"
would not be necessary.

-- 
Andrew (irc:RhodiumToad)


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

Предыдущее
От: Petar Bogdanovic
Дата:
Сообщение: Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution(exec.c)
Следующее
От: Christoph Berg
Дата:
Сообщение: Re: BUG #15120: use of getcwd(3)/chdir(2) during path resolution(exec.c)