From: "Konstantin S. Uvarin" <khedin@mail.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: [devel] [JT] glibc: обработка пустых подстрок в PATH, LD_PRELOAD etc
Date: Thu, 27 Mar 2008 13:26:42 +0300
Message-ID: <200803271326.42171.khedin@mail.ru> (raw)
Приветствую.
Давно не дает мне покоя один вопрос: для чего glibc интерпретирует пустую
подстроку в $PATH, $LD_PRELOAD и т.п. как текущий каталог? Ведь если
пользователю нужно именно текущий каталог указать, он и укажет PATH=$PATH:.
А так получается, что команда PATH=$PATH:$SOMEVAR делает не то, что
задумывалось, если SOMEVAR неопределена.
Причем я смотрел код, это специально выделено в отдельный случай и написан
комментарий даже. Зачем, зачем это сделано? Не понимаю...
In elf/dl-load.c, function fillin_rpath:
/* `strsep' can pass an empty string. This has to be
interpreted as `use the current directory'. */
if (len == 0)
{
static const char curwd[] = "./";
cp = (char *) curwd;
}
--
Konstantin S. Uvarin
Главный редактор, крякнув, осушил стопку. Новости радостно закрякали в ответ.
next reply other threads:[~2008-03-27 10:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-27 10:26 Konstantin S. Uvarin [this message]
2008-03-27 10:38 ` Slava Semushin
2008-03-29 1:03 ` [devel] " Dmitry V. Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200803271326.42171.khedin@mail.ru \
--to=khedin@mail.ru \
--cc=devel@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git