This is the mail archive of the libc-hacker@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: linuxconf complexity


>>>>> Jack Howarth writes:

Jack> Andreas,
Jack>    Uli's test program runs fine on my machine but I think I see a flaw in
Jack> how we are going at this. Uli's program cascades down through the shared
Jack> lib modules opening each successively with dlopen commands. On my machine
Jack> this works fine with the symbols from p.so being exported all the way back
Jack> to the m main program. However, linuxconf/pam are a bit different. I
Jack> think the correct diagram for that is...

Jack> linuxconf -> redhat.so -> libpam.so ->  pam_pwdb.so

Jack> this is different from

Jack> m -> n.so -> o.so -> p.so

Jack> in that linuxconf uses a dlopen with RTLD_GLOBAL to access the functions in
Jack> redhat.so. However redhat.so doesn't use dlopen at all but is linked against
Jack> libpam.so directly. Now libpam.so does use dlopen with RTLD_NOW to access
Jack> its modules including pam_pwdb.so. So what we need is a variation on Uli's
Jack> test program that has m opening n.so with RTLD_GLOBAL, n.so accessing
Jack> the functions in o.so with a direct link against o.so and finally o.so
Jack> accessing the functions in p.so with dlopen using RTLD_NOW. That should
Jack> closely emulate the linuxconf/pam situation. I fear that the failure to
Jack> use dlopen in redhat.so to access libpam.so may be breaking the chain
Jack> by which symbols are exported back from pam_pwdb.so via the dl methods.
Jack> Is that possible?
Jack>                 Jack

Hi Jack, Uli et.al,

I've changed Uli's programs according to Jack's description (hopefully 
- please verify!) and now it seems that the program does what Jack
want it to do;-):

$ LD_LIBRARY_PATH=. ./m
This is main
This is foo
This is bar
./p.so: undefined symbol: xyzzy

I'm not sure if the program is correct.  Please tell me if and why
not.

Andreas

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1998-11-01 17:51 CET by <aj@arthur>.
# Source directory was `/tmp/dl-test-uli'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#    165 -rw-r--r-- m.c
#     95 -rw-r--r-- n.c
#    275 -rw-r--r-- o.c
#     82 -rw-r--r-- p.c
#    287 -rw-r--r-- Makefile
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
if mkdir _sh15795; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= m.c ==============
if test -f 'm.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'm.c' '(file already exists)'
else
  $echo 'x -' extracting 'm.c' '(gzipped)'
  sed 's/^X//' << 'SHAR_EOF' | uudecode &&
begin 600 _sh15795/gzi
M'XL(`'R./#8"`S6-P0K",!B#[_]3A'IIQZC>I\)$\#(09'>1=66%[6]9.T'$
M=W>;"#D$\B79.&[ZR;38F]XVK+LCD>-$P\.Q5/0FX.F=069P@.E]:!E2Z"WK
MZ$6.6UV=[Y?J>BHK5?Q9F=F@(!>OUE9\#9`FA[#>BY4+4XKS3MVYB%G+VR^P
4`7(U8YNFD;$KZ$-??XQ-[*4```"O
`
end
SHAR_EOF
  $echo 'gunzipping file' 'm.c' &&
  gzip -d < _sh15795/gzi > 'm.c' &&
  $shar_touch -am 1101173898 'm.c' &&
  chmod 0644 'm.c' ||
  $echo 'restore of' 'm.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'm.c:' 'MD5 check failed'
3992d53c00e7b9515501769d3ad7df9a  m.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'm.c'`"
    test 165 -eq "$shar_count" ||
    $echo 'm.c:' 'original size' '165,' 'current size' "$shar_count!"
  fi
fi
# ============= n.c ==============
if test -f 'n.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'n.c' '(file already exists)'
else
  $echo 'x -' extracting 'n.c' '(gzipped)'
  sed 's/^X//' << 'SHAR_EOF' | uudecode &&
begin 600 _sh15795/gzi
M'XL(`)&//#8"`U/.S$O.*4U)5;!)R4E+SM/+L./B2JTH22W*4RC+STQ12$HL
M4M``L32MN;A`-%=:?KZ"AB97-9>"0D%I2;&"AE)(1F:Q`A`!992`RA0@FH"L
+6BX``V+%_U\```!:
`
end
SHAR_EOF
  $echo 'gunzipping file' 'n.c' &&
  gzip -d < _sh15795/gzi > 'n.c' &&
  $shar_touch -am 1101174298 'n.c' &&
  chmod 0644 'n.c' ||
  $echo 'restore of' 'n.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'n.c:' 'MD5 check failed'
0a9e4f157267b49555cc17ce005d7eb8  n.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'n.c'`"
    test 95 -eq "$shar_count" ||
    $echo 'n.c:' 'original size' '95,' 'current size' "$shar_count!"
  fi
fi
# ============= o.c ==============
if test -f 'o.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'o.c' '(file already exists)'
else
  $echo 'x -' extracting 'o.c' '(gzipped)'
  sed 's/^X//' << 'SHAR_EOF' | uudecode &&
begin 600 _sh15795/gzi
M'XL(`".0/#8"`UU/T0J",!1]WU=<ULL68A]0]M2C&(318ZC;4%ANN(Q4_/?N
MID$TQKB[Y]QS[MDT;:5[(>$@M*K:N#X2\C*-(&71`?,5)Q,!\!5LQ1Y+VS\=
M,)K7C0.\2*3<]P4D(+2QLD4TWMG8&1K!)4]/]^Q\"Y1&`4-:`MDU33DVOFI"
MRZXSZ,@#3VHG`SJ%=[5G6V7YNE3P<L,#1R.@93$N._BC+,HLGYG,:YSW,([#
2;Z"_%`'W&C/Y`-UPK#@3`0``
`
end
SHAR_EOF
  $echo 'gunzipping file' 'o.c' &&
  gzip -d < _sh15795/gzi > 'o.c' &&
  $shar_touch -am 1101174598 'o.c' &&
  chmod 0644 'o.c' ||
  $echo 'restore of' 'o.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'o.c:' 'MD5 check failed'
55f715c2907c898e2ded7624736c80e6  o.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'o.c'`"
    test 275 -eq "$shar_count" ||
    $echo 'o.c:' 'original size' '275,' 'current size' "$shar_count!"
  fi
fi
# ============= p.c ==============
if test -f 'p.c' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'p.c' '(file already exists)'
else
  $echo 'x -' extracting 'p.c' '(gzipped)'
  sed 's/^X//' << 'SHAR_EOF' | uudecode &&
begin 600 _sh15795/gzi
M'XL(`%@G.S8"`TNM*$DMRE,HR\],4:BHK*JJ5-``L36MN4`45U)B%52`JYI+
D0:&@M*1804,I)".S6`&(@+)*0)4*,)U`=BT7``N8H[U2````
`
end
SHAR_EOF
  $echo 'gunzipping file' 'p.c' &&
  gzip -d < _sh15795/gzi > 'p.c' &&
  $shar_touch -am 1031160698 'p.c' &&
  chmod 0644 'p.c' ||
  $echo 'restore of' 'p.c' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'p.c:' 'MD5 check failed'
2872f5458a93f64446a8fad1b7ec0111  p.c
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'p.c'`"
    test 82 -eq "$shar_count" ||
    $echo 'p.c:' 'original size' '82,' 'current size' "$shar_count!"
  fi
fi
# ============= Makefile ==============
if test -f 'Makefile' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Makefile' '(file already exists)'
else
  $echo 'x -' extracting 'Makefile' '(gzipped)'
  sed 's/^X//' << 'SHAR_EOF' | uudecode &&
begin 600 _sh15795/gzi
M'XL(`-"//#8"`Y60P0K",`R&S\M3Y-"#.[0/T)-24`=#!YZ\"+6;**1+Z=X?
MS.;J62\A(=^?\/^>R&+$T4R,20I`E-DP5&KC7(V:46U1W5!33P`S9X4.2*\[
MSWSAIJ?/0[_R^M$U#F6S;W>'2UWTJ%LCC3Q9U1;9A+].`*1%EW[7`9CN>#Y=
>+08:_`A+M5#E*'`6\V+W$P"7%+[NWO\2=FH?`0``
`
end
SHAR_EOF
  $echo 'gunzipping file' 'Makefile' &&
  gzip -d < _sh15795/gzi > 'Makefile' &&
  $shar_touch -am 1101174498 'Makefile' &&
  chmod 0644 'Makefile' ||
  $echo 'restore of' 'Makefile' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'Makefile:' 'MD5 check failed'
0abb71111c6cd89d9de820cf51278dd5  Makefile
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Makefile'`"
    test 287 -eq "$shar_count" ||
    $echo 'Makefile:' 'original size' '287,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh15795
exit 0

-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de


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