diff options
| author | Ulrich Drepper <drepper@redhat.com> | 1998-03-29 17:03:23 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 1998-03-29 17:03:23 +0000 |
| commit | cb34385453717065a4bbfd9fae971b76c186df1e (patch) | |
| tree | e06251493cba024dca02e8dfb2aaebe888b296d5 | |
| parent | a44d23932dea41a56c4345394a973767af45cf02 (diff) | |
| download | glibc-cb34385453717065a4bbfd9fae971b76c186df1e.tar.xz glibc-cb34385453717065a4bbfd9fae971b76c186df1e.zip | |
Update.
1998-03-29 16:50 Ulrich Drepper <drepper@cygnus.com>
* config.make.in (ldd-rewrite-script): New variable.
* configure.in: Substitute ldd-rewrite-script.
* elf/Makefile: Rewrite rules to generate ldd script.
* elf/ldd.bash.in: Allow handling of non-ELF binaries.
* elf/ldd.sh.in: Likewise.
* sysdeps/unix/sysv/linux/Makefile: Remove rule to install lddlibc4.
* sysdeps/unix/sysv/linux/configure.in: Define ldd_rewrite_script to
point to sed script for libc4 handling insertion for ix86, m68, SPARC.
* sysdeps/unix/sysv/linux/i386/Makefile: Add rule to install lddlibc4.
1998-03-26 15:20 Zack Weinberg <zack@rabi.phys.columbia.edu>
* inet/rcmd.c (iruserok): Remain setuid to the local user
while .rhosts is actually read, to make .rhosts-over-NFS work
(PR libc/524). Use iruserfopen() for security checks on both
hosts.equiv and .rhosts. General cleanup.
(iruserfopen): New function, performs careful checking on
hosts.equiv/.rhosts files. Disallows all the old forbidden
stuff plus hard links to files.
1998-03-29 09:26 Ulrich Drepper <drepper@cygnus.com>
* setjmp/tst-setjmp.c: Don't test __setjmp, test _setjmp instead.
1998-03-29 02:02 H.J. Lu <hjl@gnu.org>
* sysdeps/i386/i486/bits/string.h: Fix typos.
* nss/nsswitch.c (__nss_lookup): Fix the bogus checking for
"adjusted for next function".
1998-03-28 00:13 H.J. Lu <hjl@gnu.org>
* sysdeps/unix/sysv/linux/alpha/readdir.c (__readdir64): New
strong alias.
* sysdeps/unix/sysv/linux/alpha/syscalls.list (socket): Added.
* libc.map (__ieee_get_fp_control, __ieee_set_fp_control):
Added. Used by libm.so on alpha.
1998-03-28 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
* intl/bindtextdom.c [_LIBC]: Define strdup only if not yet
defined.
1998-03-27 07:29 H.J. Lu <hjl@gnu.org>
* Makerules (object-suffixes-for-rules): Add .oS only for
building shared library.
Add ranlib rule for nonshared library.
(rmobjs): Fix typo.
* Makeconfig (libtype.oS, CFLAGS-.oS, CPPFLAGS-.oS): Moved
into for shared library only.
(CPPFLAGS-.oS): Add -DPIC.
(libtypes): Use $(object-suffixes-for-rules) instead of
$(object-suffixes).
1998-03-28 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/Makefile (inhibit-stdio_lim): Compile
and install lddlibc4.
1998-03-28 09:13 Zack Weinberg <zack@rabi.phys.columbia.edu>
* iconvdata/gap.pl: Gobble rest of line with a scalar, not a
hash.
* iconvdata/gaptab.pl: Likewise.
| -rw-r--r-- | ChangeLog | 72 | ||||
| -rw-r--r-- | Makeconfig | 17 | ||||
| -rw-r--r-- | Makerules | 17 | ||||
| -rw-r--r-- | config.make.in | 3 | ||||
| -rwxr-xr-x | configure | 15 | ||||
| -rw-r--r-- | configure.in | 4 | ||||
| -rw-r--r-- | elf/Makefile | 35 | ||||
| -rw-r--r-- | elf/ldd.bash.in | 15 | ||||
| -rw-r--r-- | elf/ldd.sh.in | 8 | ||||
| -rw-r--r-- | iconvdata/gap.pl | 2 | ||||
| -rw-r--r-- | iconvdata/gaptab.pl | 2 | ||||
| -rw-r--r-- | inet/rcmd.c | 168 | ||||
| -rw-r--r-- | intl/bindtextdom.c | 6 | ||||
| -rw-r--r-- | libc.map | 1 | ||||
| -rw-r--r-- | setjmp/tst-setjmp.c | 11 | ||||
| -rw-r--r-- | sysdeps/i386/i486/bits/string.h | 3 | ||||
| -rw-r--r-- | sysdeps/unix/sysv/linux/alpha/readdir.c | 3 | ||||
| -rw-r--r-- | sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 | ||||
| -rw-r--r-- | sysdeps/unix/sysv/linux/configure | 11 | ||||
| -rw-r--r-- | sysdeps/unix/sysv/linux/configure.in | 11 | ||||
| -rw-r--r-- | sysdeps/unix/sysv/linux/i386/Makefile | 5 |
21 files changed, 296 insertions, 114 deletions
@@ -1,3 +1,75 @@ +1998-03-29 16:50 Ulrich Drepper <drepper@cygnus.com> + + * config.make.in (ldd-rewrite-script): New variable. + * configure.in: Substitute ldd-rewrite-script. + * elf/Makefile: Rewrite rules to generate ldd script. + * elf/ldd.bash.in: Allow handling of non-ELF binaries. + * elf/ldd.sh.in: Likewise. + * sysdeps/unix/sysv/linux/Makefile: Remove rule to install lddlibc4. + * sysdeps/unix/sysv/linux/configure.in: Define ldd_rewrite_script to + point to sed script for libc4 handling insertion for ix86, m68, SPARC. + * sysdeps/unix/sysv/linux/i386/Makefile: Add rule to install lddlibc4. + +1998-03-26 15:20 Zack Weinberg <zack@rabi.phys.columbia.edu> + + * inet/rcmd.c (iruserok): Remain setuid to the local user + while .rhosts is actually read, to make .rhosts-over-NFS work + (PR libc/524). Use iruserfopen() for security checks on both + hosts.equiv and .rhosts. General cleanup. + (iruserfopen): New function, performs careful checking on + hosts.equiv/.rhosts files. Disallows all the old forbidden + stuff plus hard links to files. + +1998-03-29 09:26 Ulrich Drepper <drepper@cygnus.com> + + * setjmp/tst-setjmp.c: Don't test __setjmp, test _setjmp instead. + +1998-03-29 02:02 H.J. Lu <hjl@gnu.org> + + * sysdeps/i386/i486/bits/string.h: Fix typos. + + * nss/nsswitch.c (__nss_lookup): Fix the bogus checking for + "adjusted for next function". + +1998-03-28 00:13 H.J. Lu <hjl@gnu.org> + + * sysdeps/unix/sysv/linux/alpha/readdir.c (__readdir64): New + strong alias. + + * sysdeps/unix/sysv/linux/alpha/syscalls.list (socket): Added. + + * libc.map (__ieee_get_fp_control, __ieee_set_fp_control): + Added. Used by libm.so on alpha. + +1998-03-28 Thorsten Kukuk <kukuk@vt.uni-paderborn.de> + + * intl/bindtextdom.c [_LIBC]: Define strdup only if not yet + defined. + +1998-03-27 07:29 H.J. Lu <hjl@gnu.org> + + * Makerules (object-suffixes-for-rules): Add .oS only for + building shared library. + Add ranlib rule for nonshared library. + (rmobjs): Fix typo. + + * Makeconfig (libtype.oS, CFLAGS-.oS, CPPFLAGS-.oS): Moved + into for shared library only. + (CPPFLAGS-.oS): Add -DPIC. + (libtypes): Use $(object-suffixes-for-rules) instead of + $(object-suffixes). + +1998-03-28 Ulrich Drepper <drepper@cygnus.com> + + * sysdeps/unix/sysv/linux/Makefile (inhibit-stdio_lim): Compile + and install lddlibc4. + +1998-03-28 09:13 Zack Weinberg <zack@rabi.phys.columbia.edu> + + * iconvdata/gap.pl: Gobble rest of line with a scalar, not a + hash. + * iconvdata/gaptab.pl: Likewise. + 1998-03-27 22:46 Ulrich Drepper <drepper@cygnus.com> * Rules: Allow Makefiles to specify test-static for tests which diff --git a/Makeconfig b/Makeconfig index 18f978b900..e20056ecd4 100644 --- a/Makeconfig +++ b/Makeconfig @@ -571,7 +571,7 @@ endif # Various things use $(object-suffixes) to know what all to make. # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) # to pass different flags for each flavor. -libtypes = $(foreach o,$(object-suffixes),$(libtype$o)) +libtypes = $(foreach o,$(object-suffixes-for-rules),$(libtype$o)) all-object-suffixes := .o .os .op .og .ob .oS object-suffixes := ifeq (yes,$(build-static)) @@ -589,6 +589,13 @@ CFLAGS-.os = $(filter %frame-pointer,$(+cflags)) $(pic-ccflag) libtype.os := lib%_pic.a # This can be changed by a sysdep makefile pic-ccflag = -fPIC +# Special library that contains the static-only routines for libc. +libtype.oS = lib%_nonshared.a +# Must build the routines as PIC, though, because they can end up in (users') +# shared objects. We don't want to use CFLAGS-os because users may, for +# example, make that processor-specific. +CFLAGS-.oS = $(CFLAGS-.o) $(pic-ccflag) +CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC endif ifeq (yes,$(build-profile)) # Under --enable-profile, we will build a static library of profiled objects. @@ -618,14 +625,6 @@ CFLAGS-.ob = -g -fbounded-pointers libtype.ob = lib%_b.a endif -# Special library that contains the static-only routines for libc. -libtype.oS = lib%_nonshared.a -# Must build the routines as PIC, though, because they can end up in (users') -# shared objects. We don't want to use CFLAGS-os because users may, for -# example, make that processor-specific. -CFLAGS-.oS = $(CFLAGS-.o) $(pic-ccflag) -CPPFLAGS-.oS = $(CPPFLAGS-.o) - +gnu-stabs = $(shell echo>&2 '*** BARF ON ME') ifndef BUILD_CC @@ -172,7 +172,11 @@ endef $(common-objpfx)dummy.d: echo '# .s files cannot contain includes, so they need no deps.' > $@ -object-suffixes-for-rules = $(object-suffixes) .oS +object-suffixes-for-rules := $(object-suffixes) + +ifeq (yes,$(build-shared)) +object-suffixes-for-rules += .oS +endif # It matters that this set of rules, for compiling from sources in # the current directory (the $srcdir/$subdir) come before the @@ -571,6 +575,15 @@ $(subdirs-stamps): subdir_lib; endif object-suffixes-left = $(object-suffixes) include $(o-iterator) +ifeq (yes,$(build-shared)) +$(common-objpfx)$(patsubst %,$(libtype.oS),c)($(ar-symtab-name)): \ + $(common-objpfx)$(patsubst %,$(libtype.oS),c)(\ + $(patsubst %,%.oS,$(static-only-routines))) \ + $(wildcard $(foreach d,$(subdirs),$(common-objpfx)$d/stamp.oS)) + $(SHELL) $(..)./autolock.sh \ + $(common-objpfx)$(patsubst %,$(libtype.oS),c).lck \ + $(RANLIB) $(common-objpfx)$(patsubst %,$(libtype.oS),c) +endif # This makes all the object files. @@ -914,7 +927,7 @@ common-mostlyclean: define rmobjs $(foreach o,$(object-suffixes), -rm -f $(objpfx)stamp$o $(o-objects)) --rm -f $(objpfx)stamp.oS $(patsubst %,$(static-only-routines),$(objpfx)%.oS) +-rm -f $(objpfx)stamp.oS $(patsubst %,$(objpfx)%.oS,$(static-only-routines)) endef # Also remove the dependencies and generated source files. diff --git a/config.make.in b/config.make.in index 8006adb45c..4c989c8335 100644 --- a/config.make.in +++ b/config.make.in @@ -15,6 +15,9 @@ rootsbindir = @libc_cv_rootsbindir@ # in GNU libc. has-ldconfig = @has_ldconfig@ +# Maybe the `ldd' script must be rewritten. +ldd-rewrite-script = @ldd_rewrite_script@ + # System configuration. config-machine = @host_cpu@ base-machine = @base_machine@ @@ -2512,6 +2512,9 @@ esac libc_link_dests= libc_link_sources= +# They also can set these variables. +ldd_rewrite_script=no + # Iterate over all the sysdep directories we will use, running their # configure fragments, and looking for a uname implementation. uname= @@ -2547,7 +2550,7 @@ if test "$uname" = "sysdeps/generic"; then fi echo $ac_n "checking OS release for uname""... $ac_c" 1>&6 -echo "configure:2551: checking OS release for uname" >&5 +echo "configure:2554: checking OS release for uname" >&5 if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2569,7 +2572,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6 uname_release="$libc_cv_uname_release" echo $ac_n "checking OS version for uname""... $ac_c" 1>&6 -echo "configure:2573: checking OS version for uname" >&5 +echo "configure:2576: checking OS version for uname" >&5 if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2591,7 +2594,7 @@ else fi echo $ac_n "checking stdio selection""... $ac_c" 1>&6 -echo "configure:2595: checking stdio selection" >&5 +echo "configure:2598: checking stdio selection" >&5 case $stdio in libio) cat >> confdefs.h <<\EOF @@ -2603,7 +2606,7 @@ esac echo "$ac_t""$stdio" 1>&6 echo $ac_n "checking ldap selection""... $ac_c" 1>&6 -echo "configure:2607: checking ldap selection" >&5 +echo "configure:2610: checking ldap selection" >&5 case $add_ons in *ldap*) @@ -2620,6 +2623,7 @@ echo "$ac_t""$ldap" 1>&6 + if test $gnu_ld = yes; then cat >> confdefs.h <<\EOF @@ -2665,7 +2669,7 @@ if test $static = no && test $shared = yes; then fi echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6 -echo "configure:2669: checking whether -fPIC is default" >&5 +echo "configure:2673: checking whether -fPIC is default" >&5 if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2892,6 +2896,7 @@ s%@libc_cv_slibdir@%$libc_cv_slibdir%g s%@libc_cv_sysconfdir@%$libc_cv_sysconfdir%g s%@libc_cv_rootsbindir@%$libc_cv_rootsbindir%g s%@has_ldconfig@%$has_ldconfig%g +s%@ldd_rewrite_script@%$ldd_rewrite_script%g s%@gnu_ld@%$gnu_ld%g s%@gnu_as@%$gnu_as%g s%@elf@%$elf%g diff --git a/configure.in b/configure.in index adc3381cba..fa8231931c 100644 --- a/configure.in +++ b/configure.in @@ -1000,6 +1000,9 @@ esac libc_link_dests= libc_link_sources= +# They also can set these variables. +ldd_rewrite_script=no + # Iterate over all the sysdep directories we will use, running their # configure fragments, and looking for a uname implementation. uname= @@ -1108,6 +1111,7 @@ AC_SUBST(libc_cv_sysconfdir) AC_SUBST(libc_cv_rootsbindir) AC_SUBST(has_ldconfig) +AC_SUBST(ldd_rewrite_script) AC_SUBST(gnu_ld) AC_SUBST(gnu_as) AC_SUBST(elf) if test $gnu_ld = yes; then diff --git a/elf/Makefile b/elf/Makefile index 5e221ec352..33f60c52f1 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -164,23 +164,34 @@ $(inst_slibdir)/$(rtld-installed-name): \ .PHONY: ldso_install ldso_install: $(inst_slibdir)/$(rtld-installed-name) + +sh-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \ + -e 's%@VERSION@%$(version)%g' +bash-ldd-rewrite = $(sh-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \ + -e 's%@TEXTDOMAINDIR@%$(localedir)%g' + ifneq ($(have-bash2),yes) -$(objpfx)ldd: ldd.sh.in $(common-objpfx)version.mk \ - $(common-objpfx)soversions.mk $(common-objpfx)config.make - sed -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \ - -e 's%@VERSION@%$(version)%g' < $< > $@.new - chmod 555 $@.new - mv -f $@.new $@ +ldd-shell = bash +else +ldd-shell = sh +endif + +ifeq ($(ldd-rewrite-script),no) +define gen-ldd +sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new +endef else -$(objpfx)ldd: ldd.bash.in $(common-objpfx)version.mk \ +define gen-ldd +sed $($(ldd-shell)-ldd-rewrite) < $< | sed -f $(ldd-rewrite-script) > $@.new +endef +endif + +$(objpfx)ldd: ldd.$(ldd-shell).in $(common-objpfx)version.mk \ $(common-objpfx)soversions.mk $(common-objpfx)config.make - sed -e 's%@BASH@%$(BASH)%g' \ - -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \ - -e 's%@VERSION@%$(version)%g' \ - -e 's%@TEXTDOMAINDIR@%$(localedir)%g' < $< > $@.new + $(gen-ldd) chmod 555 $@.new mv -f $@.new $@ -endif + ifeq ($(build-shared),yes) $(objpfx)sprof: $(objpfx)libdl.so$(libdl.so-version) diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in index 54dc837d3e..5d4bb3cccc 100644 --- a/elf/ldd.bash.in +++ b/elf/ldd.bash.in @@ -87,6 +87,12 @@ Report bugs using the \`glibcbug' script to <bugs@gnu.org>." esac done +nonelf () +{ + # Maybe extra code for non-ELF binaries. + return 1; +} + add_env="LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now" add_env="$add_env LD_VERBOSE=$verbose" case $# in @@ -115,6 +121,8 @@ case $# in eval $add_env exec '"$file"' || exit 1 ;; 1) + # This can be a non-ELF binary or no binary at all. + nonelf $file || echo $" not a dynamic executable" exit 1 ;; @@ -154,8 +162,11 @@ warning: you do not have execution permission for" "\`$file'" eval $add_env '"$file"' || result=1 ;; 1) - echo $" not a dynamic executable" - result=1 + # This can be a non-ELF binary or no binary at all. + nonelf $file || { + echo $" not a dynamic executable" + result=1 + } ;; 2) eval $add_env ${RTLD} '"$file"' || result=1 diff --git a/elf/ldd.sh.in b/elf/ldd.sh.in index 884472f654..a82deb5cb7 100644 --- a/elf/ldd.sh.in +++ b/elf/ldd.sh.in @@ -83,6 +83,12 @@ Try \`ldd --help' for more information." esac done +nonelf () +{ + # Maybe extra code for non-ELF binaries. + return 1; +} + add_env="LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now" add_env="$add_env LD_VERBOSE=$verbose" case $# in @@ -113,6 +119,7 @@ Try \`ldd --help' for more information." eval $add_env exec '"$file"' || exit 1 ;; 1) + nonelf $file || echo ' not a dynamic executable' exit 1 ;; @@ -155,6 +162,7 @@ ldd: warning: you do not have execution permission for \`$file'" eval $add_env '"$file"' || result=1 ;; 1) + nonelf $file || echo ' not a dynamic executable' result=1 ;; diff --git a/iconvdata/gap.pl b/iconvdata/gap.pl index 01ee9b2829..ed2d295c90 100644 --- a/iconvdata/gap.pl +++ b/iconvdata/gap.pl @@ -1,6 +1,6 @@ $first=$last=$idx=0; while (<>) { - local($ucs,%rest) = split; + local($ucs,$rest) = split; local($u)=hex($ucs); if ($u - $last > 6) { if ($last != 0) { diff --git a/iconvdata/gaptab.pl b/iconvdata/gaptab.pl index 34eb2f9408..77df1c3aea 100644 --- a/iconvdata/gaptab.pl +++ b/iconvdata/gaptab.pl @@ -6,7 +6,7 @@ sub fmt { printf (" '\\x%02x',", $val); } while (<>) { - local($ucs,$char,%rest) = split; + local($ucs,$char,$rest) = split; local($u)=hex($ucs); local($c)=hex($char); if ($u - $last > 6) { diff --git a/inet/rcmd.c b/inet/rcmd.c index d496a7a8fa..05bd1d5e8b 100644 --- a/inet/rcmd.c +++ b/inet/rcmd.c @@ -287,6 +287,49 @@ ruserok(rhost, superuser, ruser, luser) return -1; } +/* Extremely paranoid file open function. */ +static FILE * +iruserfopen (char *file, uid_t okuser) +{ + struct stat st; + char *cp = NULL; + FILE *res = NULL; + + /* If not a regular file, if owned by someone other than user or + root, if writeable by anyone but the owner, or if hardlinked + anywhere, quit. */ + cp = NULL; + if (__lxstat (_STAT_VER, file, &st)) + cp = _("lstat failed"); + else if (!S_ISREG (st.st_mode)) + cp = _("not regular file"); + else + { + res = fopen (file, "r"); + if (!res) + cp = _("cannot open"); + else if (__fxstat (_STAT_VER, fileno (res), &st) < 0) + cp = _("fstat failed"); + else if (st.st_uid && st.st_uid != okuser) + cp = _("bad owner"); + else if (st.st_mode & (S_IWGRP|S_IWOTH)) + cp = _("writeable by other than owner"); + else if (st.st_nlink > 1) + cp = _("hard linked somewhere"); + } + + /* If there were any problems, quit. */ + if (cp != NULL) + { + __rcmd_errstr = cp; + if (res) + fclose (res); + return NULL; + } + + return res; +} + /* * New .rhosts strategy: We are passed an ip address. We spin through * hosts.equiv and .rhosts looking for a match. When the .rhosts only @@ -297,83 +340,60 @@ ruserok(rhost, superuser, ruser, luser) * Returns 0 if ok, -1 if not ok. */ int -iruserok(raddr, superuser, ruser, luser) - u_int32_t raddr; - int superuser; - const char *ruser, *luser; +iruserok (raddr, superuser, ruser, luser) + u_int32_t raddr; + int superuser; + const char *ruser, *luser; { - register char *cp; - struct stat sbuf; - struct passwd pwdbuf, *pwd; - FILE *hostf; - int first; - - first = 1; - hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r"); -again: - if (hostf) { - if (__ivaliduser(hostf, raddr, luser, ruser) == 0) { - (void)fclose(hostf); - return 0; - } - (void)fclose(hostf); - } - if (first == 1 && (__check_rhosts_file || superuser)) { - char *pbuf; - size_t dirlen; - size_t buflen = __sysconf (_SC_GETPW_R_SIZE_MAX); - char *buffer = __alloca (buflen); - - first = 0; - if (__getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0) - return -1; + FILE *hostf; + int isbad; |
