* [devel] LD_LIBRARY_PATH, setgid, rpath
@ 2009-03-25 11:32 Boris Savelev
2009-03-25 11:53 ` Anton Farygin
0 siblings, 1 reply; 12+ messages in thread
From: Boris Savelev @ 2009-03-25 11:32 UTC (permalink / raw)
To: ALT Linux Team development discussions
Здравствуйте!
Есть некий демон, который слинкован с некоторыми либами, которые лежат
в /opt/daemon/lib.
Логично вызывать демона так:
LD_LIBRARY_PATH=/opt/daemon/lib /opt/daemon/daemon.bin
но это не работает, потому демон использует setgid и ругается что
setgid(): Can not set group ID (Operation not permitted)!
Пишут что LD_LIBRARY_PATH не работает с setuid/setgid. Что правда?-)
Другие 2 варианта:
1) rpath для линковки daemon.bin
с этим все понятно, но так делать крайне не хочется
2) Дописать /opt/daemon/lib в ld.so.conf
вариант не рассматривается-)
Какие еще существуют пути решения этой проблемы?..
--
С уважением, Борис Савельев
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-25 11:32 [devel] LD_LIBRARY_PATH, setgid, rpath Boris Savelev
@ 2009-03-25 11:53 ` Anton Farygin
2009-03-25 11:57 ` Boris Savelev
0 siblings, 1 reply; 12+ messages in thread
From: Anton Farygin @ 2009-03-25 11:53 UTC (permalink / raw)
To: ALT Linux Team development discussions
Boris Savelev пишет:
> Здравствуйте!
>
> Есть некий демон, который слинкован с некоторыми либами, которые лежат
> в /opt/daemon/lib.
> Логично вызывать демона так:
> LD_LIBRARY_PATH=/opt/daemon/lib /opt/daemon/daemon.bin
> но это не работает, потому демон использует setgid и ругается что
> setgid(): Can not set group ID (Operation not permitted)!
> Пишут что LD_LIBRARY_PATH не работает с setuid/setgid. Что правда?-)
>
> Другие 2 варианта:
> 1) rpath для линковки daemon.bin
> с этим все понятно, но так делать крайне не хочется
> 2) Дописать /opt/daemon/lib в ld.so.conf
> вариант не рассматривается-)
>
> Какие еще существуют пути решения этой проблемы?..
Положить библиотеки в более стандартные пути...
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-25 11:53 ` Anton Farygin
@ 2009-03-25 11:57 ` Boris Savelev
2009-03-25 11:58 ` Mikhail Gusarov
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Boris Savelev @ 2009-03-25 11:57 UTC (permalink / raw)
To: ALT Linux Team development discussions
25 марта 2009 г. 14:53 пользователь Anton Farygin <rider@altlinux.com> написал:
> Boris Savelev пишет:
>>
>> Здравствуйте!
>>
>> Есть некий демон, который слинкован с некоторыми либами, которые лежат
>> в /opt/daemon/lib.
>> Логично вызывать демона так:
>> LD_LIBRARY_PATH=/opt/daemon/lib /opt/daemon/daemon.bin
>> но это не работает, потому демон использует setgid и ругается что
>> setgid(): Can not set group ID (Operation not permitted)!
>> Пишут что LD_LIBRARY_PATH не работает с setuid/setgid. Что правда?-)
>>
>> Другие 2 варианта:
>> 1) rpath для линковки daemon.bin
>> с этим все понятно, но так делать крайне не хочется
>> 2) Дописать /opt/daemon/lib в ld.so.conf
>> вариант не рассматривается-)
>>
>> Какие еще существуют пути решения этой проблемы?..
>
> Положить библиотеки в более стандартные пути...
Они пересекаются по именам.
Это практически тоже самое что и ld.so.conf.
Среди библиотек присутствует libc-)
--
С уважением, Борис Савельев
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-25 11:57 ` Boris Savelev
@ 2009-03-25 11:58 ` Mikhail Gusarov
2009-03-25 12:45 ` Epiphanov Sergei
2009-03-27 11:19 ` Serge Ryabchun
2 siblings, 0 replies; 12+ messages in thread
From: Mikhail Gusarov @ 2009-03-25 11:58 UTC (permalink / raw)
To: ALT Linux Team development discussions
[-- Attachment #1: Type: text/plain, Size: 367 bytes --]
Twas brillig at 14:57:13 25.03.2009 UTC+03 when boris@altlinux.org did gyre and gimble:
BS> Они пересекаются по именам. Это практически тоже самое что и
BS> ld.so.conf. Среди библиотек присутствует libc-)
Ну и загнать всю эту гадость в чрут.
--
[-- Attachment #2: Type: application/pgp-signature, Size: 196 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-25 11:57 ` Boris Savelev
2009-03-25 11:58 ` Mikhail Gusarov
@ 2009-03-25 12:45 ` Epiphanov Sergei
2009-03-25 13:30 ` Boris Savelev
2009-03-27 11:19 ` Serge Ryabchun
2 siblings, 1 reply; 12+ messages in thread
From: Epiphanov Sergei @ 2009-03-25 12:45 UTC (permalink / raw)
To: ALT Linux Team development discussions
On Wednesday 25 March 2009 14:57:13 Boris Savelev wrote:
> > Положить библиотеки в более стандартные пути...
>
> Они пересекаются по именам.
> Это практически тоже самое что и ld.so.conf.
> Среди библиотек присутствует libc-)
Может, стоит перелинковать программу с нашей libc и с нашими же другими
библиотеками?
--
С уважением, Епифанов Сергей
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-25 12:45 ` Epiphanov Sergei
@ 2009-03-25 13:30 ` Boris Savelev
2009-03-26 15:49 ` Boris Savelev
0 siblings, 1 reply; 12+ messages in thread
From: Boris Savelev @ 2009-03-25 13:30 UTC (permalink / raw)
To: ALT Linux Team development discussions
25 марта 2009 г. 15:45 пользователь Epiphanov Sergei
<serpiph@nikiet.ru> написал:
> On Wednesday 25 March 2009 14:57:13 Boris Savelev wrote:
>> > Положить библиотеки в более стандартные пути...
>>
>> Они пересекаются по именам.
>> Это практически тоже самое что и ld.so.conf.
>> Среди библиотек присутствует libc-)
>
> Может, стоит перелинковать программу с нашей libc и с нашими же другими
> библиотеками?
это понятно-) но теряется переносимость, ради которой все эти грабли
--
С уважением, Борис Савельев
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-25 13:30 ` Boris Savelev
@ 2009-03-26 15:49 ` Boris Savelev
2009-03-26 15:54 ` Andrey Rahmatullin
2009-03-26 18:16 ` Sergey Vlasov
0 siblings, 2 replies; 12+ messages in thread
From: Boris Savelev @ 2009-03-26 15:49 UTC (permalink / raw)
To: ALT Linux Team development discussions
25 марта 2009 г. 16:30 пользователь Boris Savelev <boris@altlinux.org> написал:
> 25 марта 2009 г. 15:45 пользователь Epiphanov Sergei
> <serpiph@nikiet.ru> написал:
>> On Wednesday 25 March 2009 14:57:13 Boris Savelev wrote:
>>> > Положить библиотеки в более стандартные пути...
>>>
>>> Они пересекаются по именам.
>>> Это практически тоже самое что и ld.so.conf.
>>> Среди библиотек присутствует libc-)
>>
>> Может, стоит перелинковать программу с нашей libc и с нашими же другими
>> библиотеками?
> это понятно-) но теряется переносимость, ради которой все эти грабли
Товарищи, а может кто-нить пояснить, чем чревато линковатся с libc статически?
мне пишется вот такое:
make LDFLAGS="-static -static-libgcc" daemon
<skip>
warning: Using 'initgroups' in statically linked applications requires
at runtime the shared libraries from the glibc version used for
linking
warning: Using 'getpwnam' in statically linked applications requires
at runtime the shared libraries from the glibc version used for
linking
warning: Using 'gethostbyname' in statically linked applications
requires at runtime the shared libraries from the glibc version used
for linking
этому верить?-) оно без требуемой libc просто упадет?
--
С уважением, Борис Савельев
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-26 15:49 ` Boris Savelev
@ 2009-03-26 15:54 ` Andrey Rahmatullin
2009-03-26 18:16 ` Sergey Vlasov
1 sibling, 0 replies; 12+ messages in thread
From: Andrey Rahmatullin @ 2009-03-26 15:54 UTC (permalink / raw)
To: devel
On Thu, Mar 26, 2009 at 06:49:18PM +0300, Boris Savelev wrote:
> Товарищи, а может кто-нить пояснить, чем чревато линковатся с libc статически?
Не надо так делать.
> warning: Using 'initgroups' in statically linked applications requires
> at runtime the shared libraries from the glibc version used for
> linking
Правильно пишет.
> этому верить?-) оно без требуемой libc просто упадет?
Верить. Что именно произойдёт - не помню, но ничего хорошего. Можете
проверить в принципе.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-26 15:49 ` Boris Savelev
2009-03-26 15:54 ` Andrey Rahmatullin
@ 2009-03-26 18:16 ` Sergey Vlasov
1 sibling, 0 replies; 12+ messages in thread
From: Sergey Vlasov @ 2009-03-26 18:16 UTC (permalink / raw)
To: devel
[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]
On Thu, Mar 26, 2009 at 06:49:18PM +0300, Boris Savelev wrote:
> Товарищи, а может кто-нить пояснить, чем чревато линковатся с libc статически?
> мне пишется вот такое:
> make LDFLAGS="-static -static-libgcc" daemon
> <skip>
> warning: Using 'initgroups' in statically linked applications requires
> at runtime the shared libraries from the glibc version used for
> linking
> warning: Using 'getpwnam' in statically linked applications requires
> at runtime the shared libraries from the glibc version used for
> linking
> warning: Using 'gethostbyname' in statically linked applications
> requires at runtime the shared libraries from the glibc version used
> for linking
>
> этому верить?-) оно без требуемой libc просто упадет?
Скорее всего, именно упадёт. По крайней мере, в древние времена,
когда /bin/rpm собирался статически, именно это с ним и происходило
при попытке обновления glibc. Так что, как это ни парадоксально,
переносимость бинарника, слинкованного с glibc динамически,
существенно выше, чем у слинкованного статически (при динамической
линковке в glibc задействуется механизм symbol versioning, позволяющий
предоставить старым бинарникам совместимые с ними реализации функций
даже в случае, когда в новой версии glibc бинарный интерфейс этих
функций уже изменился). Правда, при этом будет требоваться версия
glibc не старее той, которая использовалась при сборке.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-25 11:57 ` Boris Savelev
2009-03-25 11:58 ` Mikhail Gusarov
2009-03-25 12:45 ` Epiphanov Sergei
@ 2009-03-27 11:19 ` Serge Ryabchun
2009-03-27 11:34 ` Boris Savelev
2 siblings, 1 reply; 12+ messages in thread
From: Serge Ryabchun @ 2009-03-27 11:19 UTC (permalink / raw)
To: ALT Linux Team development discussions
2009/3/25 Boris Savelev <boris@altlinux.org>:
> 25 марта 2009 г. 14:53 пользователь Anton Farygin <rider@altlinux.com> написал:
>> Boris Savelev пишет:
>>>
>>> Здравствуйте!
>>>
>>> Есть некий демон, который слинкован с некоторыми либами, которые лежат
>>> в /opt/daemon/lib.
>>> Логично вызывать демона так:
>>> LD_LIBRARY_PATH=/opt/daemon/lib /opt/daemon/daemon.bin
>>> но это не работает, потому демон использует setgid и ругается что
>>> setgid(): Can not set group ID (Operation not permitted)!
>>> Пишут что LD_LIBRARY_PATH не работает с setuid/setgid. Что правда?-)
>>>
>>> Другие 2 варианта:
>>> 1) rpath для линковки daemon.bin
>>> с этим все понятно, но так делать крайне не хочется
>>> 2) Дописать /opt/daemon/lib в ld.so.conf
>>> вариант не рассматривается-)
>>>
>>> Какие еще существуют пути решения этой проблемы?..
>>
>> Положить библиотеки в более стандартные пути...
> Они пересекаются по именам.
> Это практически тоже самое что и ld.so.conf.
> Среди библиотек присутствует libc-)
/opt/daemon/lib/ld-linux.so [--library-path /opt/daemon/lib]
/opt/daemon/bin/daemon
--
Рябчун Сергей <serge.ryabchun@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-27 11:19 ` Serge Ryabchun
@ 2009-03-27 11:34 ` Boris Savelev
2009-03-27 11:45 ` Serge Ryabchun
0 siblings, 1 reply; 12+ messages in thread
From: Boris Savelev @ 2009-03-27 11:34 UTC (permalink / raw)
To: ALT Linux Team development discussions
27 марта 2009 г. 14:19 пользователь Serge Ryabchun
<serge.ryabchun@gmail.com> написал:
> 2009/3/25 Boris Savelev <boris@altlinux.org>:
>> 25 марта 2009 г. 14:53 пользователь Anton Farygin <rider@altlinux.com> написал:
>>> Boris Savelev пишет:
>>>>
>>>> Здравствуйте!
>>>>
>>>> Есть некий демон, который слинкован с некоторыми либами, которые лежат
>>>> в /opt/daemon/lib.
>>>> Логично вызывать демона так:
>>>> LD_LIBRARY_PATH=/opt/daemon/lib /opt/daemon/daemon.bin
>>>> но это не работает, потому демон использует setgid и ругается что
>>>> setgid(): Can not set group ID (Operation not permitted)!
>>>> Пишут что LD_LIBRARY_PATH не работает с setuid/setgid. Что правда?-)
>>>>
>>>> Другие 2 варианта:
>>>> 1) rpath для линковки daemon.bin
>>>> с этим все понятно, но так делать крайне не хочется
>>>> 2) Дописать /opt/daemon/lib в ld.so.conf
>>>> вариант не рассматривается-)
>>>>
>>>> Какие еще существуют пути решения этой проблемы?..
>>>
>>> Положить библиотеки в более стандартные пути...
>> Они пересекаются по именам.
>> Это практически тоже самое что и ld.so.conf.
>> Среди библиотек присутствует libc-)
>
> /opt/daemon/lib/ld-linux.so [--library-path /opt/daemon/lib]
> /opt/daemon/bin/daemon
--library-path PATH
Переопределяет настройки переменной окружения LD_LIBRARY_PATH
Так что не вариант.
--
С уважением, Борис Савельев
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [devel] LD_LIBRARY_PATH, setgid, rpath
2009-03-27 11:34 ` Boris Savelev
@ 2009-03-27 11:45 ` Serge Ryabchun
0 siblings, 0 replies; 12+ messages in thread
From: Serge Ryabchun @ 2009-03-27 11:45 UTC (permalink / raw)
To: ALT Linux Team development discussions
2009/3/27 Boris Savelev <boris@altlinux.org>:
> 27 марта 2009 г. 14:19 пользователь Serge Ryabchun
> <serge.ryabchun@gmail.com> написал:
>> 2009/3/25 Boris Savelev <boris@altlinux.org>:
>>> 25 марта 2009 г. 14:53 пользователь Anton Farygin <rider@altlinux.com> написал:
>>>> Boris Savelev пишет:
>>>>>
>>>>> Здравствуйте!
>>>>>
>>>>> Есть некий демон, который слинкован с некоторыми либами, которые лежат
>>>>> в /opt/daemon/lib.
>>>>> Логично вызывать демона так:
>>>>> LD_LIBRARY_PATH=/opt/daemon/lib /opt/daemon/daemon.bin
>>>>> но это не работает, потому демон использует setgid и ругается что
>>>>> setgid(): Can not set group ID (Operation not permitted)!
>>>>> Пишут что LD_LIBRARY_PATH не работает с setuid/setgid. Что правда?-)
>>>>>
>>>>> Другие 2 варианта:
>>>>> 1) rpath для линковки daemon.bin
>>>>> с этим все понятно, но так делать крайне не хочется
>>>>> 2) Дописать /opt/daemon/lib в ld.so.conf
>>>>> вариант не рассматривается-)
>>>>>
>>>>> Какие еще существуют пути решения этой проблемы?..
>>>>
>>>> Положить библиотеки в более стандартные пути...
>>> Они пересекаются по именам.
>>> Это практически тоже самое что и ld.so.conf.
>>> Среди библиотек присутствует libc-)
>>
>> /opt/daemon/lib/ld-linux.so [--library-path /opt/daemon/lib]
>> /opt/daemon/bin/daemon
>
> --library-path PATH
> Переопределяет настройки переменной окружения LD_LIBRARY_PATH
> Так что не вариант.
Что не вариант? /opt/daemon/lib/ld-linux.so есть в наличии со своим
rpath внутри?
--
Рябчун Сергей <serge.ryabchun@gmail.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-03-27 11:45 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-25 11:32 [devel] LD_LIBRARY_PATH, setgid, rpath Boris Savelev
2009-03-25 11:53 ` Anton Farygin
2009-03-25 11:57 ` Boris Savelev
2009-03-25 11:58 ` Mikhail Gusarov
2009-03-25 12:45 ` Epiphanov Sergei
2009-03-25 13:30 ` Boris Savelev
2009-03-26 15:49 ` Boris Savelev
2009-03-26 15:54 ` Andrey Rahmatullin
2009-03-26 18:16 ` Sergey Vlasov
2009-03-27 11:19 ` Serge Ryabchun
2009-03-27 11:34 ` Boris Savelev
2009-03-27 11:45 ` Serge Ryabchun
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