Re: bash cores if nscd disabled on Solaris LDAP sasl/gssapi client
Hi Chet, Serge Dussud wrote: On 12/ 8/08 03:00 PM, Chet Ramey wrote: Serge Dussud wrote: Indeed, ld(1)'s -z interpose option is a rather big hammer, as it establishes that the application can interpose on *all* of the symbols that it offers, rather than just the few related to malloc. That might be a problem if there are some public symbols in libc that bash happens to use, but bash is pretty careful to replace libc functions only if they're missing or somehow substandard. OK. Not sure I am willing to take the risk at this point. Also, note that the linker issue is being investigated at the moment. FYI, the linker issue [1] was the root cause of all this, and was fixed in recent OpenSolaris build (snv_106). We're working on fixing it to previous version of Solaris, when/if applicable. Bottom line, we're not applying any patch to the way we build our bash delivery bundled to [Open]Solaris :) Thanks for the help/chat on this one, serge [1] http://bugs.opensolaris.org/view_bug.do?bug_id=6778453
Declaring variables as local effects command status $?
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS -I. -I. -I./include -I./lib -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables uname output: Linux nmhd-bs2 2.6.18-92.1.22.el5 #1 SMP Tue Dec 16 12:03:43 EST 2008 i686 i686 i386 GNU/Linux Machine Type: i686-redhat-linux-gnu Bash Version: 3.2 Patch Level: 25 Release Status: release Description: Declaring a variable as local appears to prevent $? from being set; see script below. Repeat-By: script: #!/bin/sh testFunc() { local x=$( echo hi; exit 20); ret=$? echo local var status: ret=($ret) y=$( echo there; exit 21); ret=$? echo non-local var status: ret=($ret) } testFunc echo done... script output: local var status: ret=(0) non-local var status: ret=(21) done...
Re: Declaring variables as local effects command status $?
Michael Rendell mich...@cs.mun.ca wrote: local x=$( echo hi; exit 20); ret=$? Here you're getting the exit status of local itself, which is 0. If you want the exit status of the command substitution, make that a separate command: local x x=$( echo hi; exit 20); paul
Re: Declaring variables as local effects command status $?
Michael Rendell wrote: Bash Version: 3.2 Patch Level: 25 Release Status: release Description: Declaring a variable as local appears to prevent $? from being set; see script below. `local' is a builtin command; you asked for and received its exit status. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/