Re: Depency on ld-linux.so.2(GLIBC_PRIVATE)



Hello Leonard, Pavel,

On Tue, 2005-11-15 at 21:05 +0100, Leonard den Ottolander wrote:
> Hi Pavel,
> 
> On Tue, 2005-11-15 at 14:22 -0500, Pavel Roskin wrote:
> > "nm mc" shows that the only symbol from GLIBC_PRIVATE is
> > __libc_enable_secure.  Search for __libc_enable_secure finds it in two
> > places:
> > 
> > intl/dcigettext.c - it's only used if that file is compiled as part of
> > libc, which is not the case.

Unfortunately there are more of glibc private symbols used there. No app
should use internal glibc symbols! In most cases there exist a way how
to avoid usage of them.

> > slang/slcommon.c - this one uses __libc_enable_secure when glibc 2.x and
> > newer is used.  So, I guess it's upgrading S-Lang that introduced this
> > problem.
> 
> He he. I see the same issue indeed exists with my 2005-11-10 CVS
> checkout + slang2. Any suggestions on how to fix this?

The __libc_enable_secure usage in slcommon.c is easy to fix as there's a
sufficient workaround present in the code (the getuid () != geteuid ()
and getgid () != getegid () checks). Just getting rid of the external
reference to __libc_enable_secure removes the dependency to
ld-linux.so.2(GLIBC_PRIVATE).

The patch is attached.

Jindrich
-- 
Jindrich Novy <jnovy redhat com>, http://people.redhat.com/jnovy/
(o_                                                           _o)
//\      The worst evil in the world is refusal to think.     //\
V_/_                                                         _\_V

--- mc-4.6.1a/slang/slcommon.c.mcslang	2005-11-12 20:47:49.000000000 +0100
+++ mc-4.6.1a/slang/slcommon.c	2005-11-15 21:40:51.000000000 +0100
@@ -191,19 +191,11 @@ char *SLcalloc (unsigned int nelems, uns
    return p;
 }
 
-#if !defined(HAVE_ISSETUGID) && defined(__GLIBC__) && (__GLIBC__ >= 2)
-extern int __libc_enable_secure;
-# define HAVE___LIBC_ENABLE_SECURE 1
-#endif
-
 int _pSLsecure_issetugid (void)
 {
 #ifdef HAVE_ISSETUGID
    return (1 == issetugid ());
 #else
-# ifdef HAVE___LIBC_ENABLE_SECURE
-   return __libc_enable_secure;
-# else
 #  if defined(HAVE_GETUID) && defined(HAVE_GETEUID) && defined(HAVE_GETGID) && defined(HAVE_GETEUID)
    static int enable_secure;
    if (enable_secure == 0)
@@ -218,7 +210,6 @@ int _pSLsecure_issetugid (void)
 #  else
    return 0;
 #  endif
-# endif
 #endif
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]