This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fwd: Bug#48120: gconv-modules would not be loaded properly whensetgid


I've tested this problem, but I don't have a clue well.

From: Joel Klecker <espy@debian.org>
Subject: Fwd: Bug#48120: gconv-modules would not be loaded properly whensetgid
> [ `gconv-modules' is the Debian package which contains /usr/lib/gconv ]
> I assume this behavior is intentional, but is it truly necessary?
>
> >Subject: Bug#48120: gconv-modules would not be loaded properly when setgid
> >Reply-To: Fumitoshi UKAI <ukai@debian.or.jp>, 48120@bugs.debian.org
> >Date: Sun, 24 Oct 1999 03:59:09 +0900
> >From: Fumitoshi UKAI <ukai@debian.or.jp>
> >To: submit@bugs.debian.org
> >
> >Package: gconv-modules
> >Version: 2.1.2-5
> >Severity: important
> >
> >In debian-users (for Japense) mailing-list, someone found
> >that gconv-modules would not be loaded if it was setgid program.
> >For examples, `LANG=ja_JP.eucJP /usr/games/same-gnome'
> >(in gnome-same-gnome package) would not show any menu strings
> >(of course, it should be Japanese).
> >
> >It can be fixed by adding /usr/lib/gconv to /etc/ld.so.conf.
> >If /usr/lib/gconv in /etc/ld.so.conf, `LANG=ja_JP.eucJP /usr/games/same-gnome'
> >would works fine with Japanese menu strings.

> >However, I suspect this is bugs of glibc/icongdata/Makefile.
> >In this file, LDFLAGS for libJIS.so (and libKSC,libGB,libCNS) are
> >`-Wl,-soname,$(@F)' only, however others (such as EUC-JP.so) are
> >`-Wl,-rpath,'$$ORIGIN''.  When we checked same-gnome with strace,
> >it find "EUC-JP.so", but failed to find "libJIS.so".  So, it might be
> >fixed by adding -rpath,'$$ORIGIN' for LDFLAGS for libJIS.so,libKSC.so,
> >libGB.so and libCNS.so, but I've not yet checked it.

If setgid application start running, ld.so doesn't expand the $ORIGIN,
and applying to the name 'as it is' for the location of libJIS.so. it 
is easy to observe using 'strace'. (Note that LANG environment are
ja_JP.ujis).

I changed Makefile as same as described above, and tested,
but the result is the same badly.

> This solution was proposed in a separate message:
> >Subject: Bug#48120: $ORIGIN and setuid/setgid
> >Reply-To: Kaz Sasayama <Kaz.Sasayama@hypercore.co.jp>,
> >   48120-maintonly@bugs.debian.org
> >To: 48120-maintonly@bugs.debian.org
> >From: Kaz Sasayama <Kaz.Sasayama@hypercore.co.jp>
> >Date: 29 Oct 1999 17:21:03 +0900
> >
> >I found this bug report in BTS.  I hope this problem can be
> >fixed by replacing '$$ORIGIN' with $(gconvdir) in the
> >Makefile, or adding another rpath option with $(gconvdir).
> >
> >Because $ORIGIN in rpath is expanded by glibc 2.1.2 only if
> >non-setuid and non-setgid, use of $ORIGIN is not appropriate
> >in this case.
> >
> >Omitting $ORIGIN in rpath will not be a problem until
> >someone copies those modules and tries to replace underlying
> >libraries with his own versions, I hope.

I think that this method that replace '$$ORIGIN' with $(gnocdir)
is not a good idea because it is only 'quick hack', and be hidden
latent problem. But adding another rpath is considerable.

Regards,
--
GOTO Masanori
Department of Computational Intelligence and Systems Science,
Tokyo Institute of Technology.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]