Imported from ../bash-2.02.tar.gz.
[platform/upstream/bash.git] / NOTES
1 Platform-Specific Configuration and Operation Notes
2 ===================================================
3
4 1.  configure --without-gnu-malloc on:
5
6         alpha running OSF/1
7         alpha running Linux
8
9         next running NeXT/OS
10
11         all machines running SunOS YP code: SunOS4, SunOS5, HP/UX
12
13         linux (optional, but don't do it if you're using Doug Lea's malloc)
14
15         QNX 4.2
16         other OSF/1 machines (KSR/1, HP, IBM AIX/ESA)
17         AIX
18         sparc SVR4, SVR4.2 (ICL reference port)
19         DG/UX
20         Cray
21
22         NetBSD/sparc (malloc needs 8-byte alignment; GNU malloc has 4-byte)
23
24         BSD/OS 2.1 if you want to use loadable builtins
25
26         If you are using GNU libc, especially on a linux system
27
28 (Configuring --without-gnu-malloc will still result in lib/malloc/libmalloc.a
29 being built and linked against, but there is only a stub file in the archive.)
30
31 2.  configure using shlicc on BSD/OS 2.1 to use loadable builtins
32
33 3.  Bash cannot be built in a directory separate from the source directory
34     using configure --srcdir=... unless the version of `make' you're using
35     does $VPATH handling right.  The script support/mkclone can be used to
36     create a `build tree' using symlinks to get around this.
37
38 4.  I've had reports that username completion (as well as tilde expansion
39     and \u prompt expansion) does not work on IRIX 5.3 when linking with
40     -lnsl.  This is only a problem when you're running NIS, since
41     apparently -lnsl supports only /etc/passwd and not the NIS functions
42     for retrieving usernames and passwords.  Editing the Makefile after
43     configure runs and removing the `-lnsl' from the assignment to `LIBS'
44     fixes the problem.
45
46 5.  There is a problem with Red Hat Linux's `makewhatis' script.
47     Running `makewhatis' with bash-2.0 results in error messages
48     like this:
49
50     /usr/sbin/makewhatis: cd: manpath: No such file or directory
51     /usr/sbin/makewhatis: manpath/whatis: No such file or directory
52     chmod: manpath/whatis: No such file or directory
53     /usr/sbin/makewhatis: cd: catpath: No such file or directory
54     /usr/sbin/makewhatis: catpath/whatis: No such file or directory
55     chmod: catpath/whatis: No such file or directory
56
57     The problem is with `makewhatis'.  Red Hat (and possibly other
58     Linux distributors) uses a construct like this in the code:
59
60         eval path=$"$pages"path
61
62     to do indirect variable expansion.  This `happened to work' in
63     bash-1.14 and previous versions, but that was more an accident
64     of implementation than anything else -- it was never supported
65     and certainly is not portable.
66
67     Bash-2.0 has a new feature that gives a new meaning to $"...".
68     This is explained more completely in item 1 in the COMPAT file.
69
70     The three lines in the `makewhatis' script that need to be changed
71     look like this:
72
73              eval $topath=$"$topath":$name
74     [...]
75        eval path=$"$pages"path
76     [...]
77     eval path=$"$pages"path
78
79     The portable way to write this code is
80
81              eval $topath="\$$topath":$name
82        eval path="\$$pages"path
83     eval path="\$$pages"path
84
85     You could also experiment with another new bash feature: ${!var}.
86     This does indirect variable expansion, making the use of eval
87     unnecessary.
88
89 6.  There is a problem with syslogd on many Linux distributions (Red Hat
90     and Slackware are two that I have received reports about).  syslogd
91     sends a SIGINT to its parent process, which is waiting for the daemon
92     to finish its initialization.  The parent process then dies due to
93     the SIGINT, and bash reports it, causing unexpected console output
94     while the system is booting that looks something like
95
96         starting daemons: syslogd/etc/rc.d/rc.M: line 29: 38 Interrupt ${NET}/syslogd
97
98     Bash-2.0 reports events such as processes dying in scripts due to
99     signals when the standard output is a tty.  Bash-1.14.x and previous
100     versions did not report such events.
101
102     This should probably be reported as a bug to whatever Linux distributor
103     people see the problem on.  In my opinion, syslogd should be changed to
104     use some other method of communication, or the wrapper function (which
105     appeared to be `daemon' when I looked at it some time ago) or script
106     (which appeared to be `syslog') should catch SIGINT, since it's an
107     expected event, and exit cleanly.
108
109 7.  Several people have reported that `dip' (a program for SLIP/PPP
110     on Linux) does not work with bash-2.0 installed as /bin/sh.
111
112     I don't run any Linux boxes myself, and do not have the dip
113     code handy to look at, but the `problem' with bash-2.0, as
114     it has been related to me, is that bash requires the `-p'
115     option to be supplied at invocation if it is to run setuid
116     or setgid. 
117
118     This means, among other things, that setuid or setgid programs
119     which call system(3) (a horrendously bad practice in any case)
120     relinquish their setuid/setgid status in the child that's forked
121     to execute /bin/sh. 
122
123     The following is an *unofficial* patch to bash-2.0 that causes it
124     to not require `-p' to run setuid or setgid if invoked as `sh'.
125     It has been reported to work on Linux.  It will make your system
126     vulnerable to bogus system(3) calls in setuid executables.
127
128 --- ../bash-2.0.orig/shell.c    Wed Dec 18 14:16:30 1996
129 +++ shell.c     Fri Mar  7 13:12:03 1997
130 @@ -347,7 +347,7 @@
131    if (posixly_correct)
132      posix_initialize (posixly_correct);
133
134 -  if (running_setuid && privileged_mode == 0)
135 +  if (running_setuid && privileged_mode == 0 && act_like_sh == 0)
136      disable_priv_mode ();
137
138    /* Need to get the argument to a -c option processed in the
139
140 8.  Some people have asked about binding all of the keys in a PC-keyboard-
141     style numeric keypad to readline functions.  Here's something I
142     received from the gnu-win32 list that may help.  Insert the following
143     lines into ~/.inputrc:
144
145 # home key
146 "\e[1~":beginning-of-line
147 # insert key
148 "\e[2~":kill-whole-line
149 # del key
150 "\e[3~":delete-char
151 # end key
152 "\e[4~":end-of-line
153 # pgup key
154 "\e[5~":history-search-forward
155 # pgdn key
156 "\e[6~":history-search-backward
157
158 9.  Hints for building under Minix 2.0 (Contributed by Terry R. McConnell,
159     <tmc@barnyard.syr.edu>)
160
161    The version of /bin/sh distributed with Minix is not up to the job of
162    running the configure script. The easiest solution is to swap /bin/sh
163    with /usr/bin/ash. Then use chmem(1) to increase the memory allocated
164    to /bin/sh. The following settings are known to work:
165
166    text         data     bss   stack  memory
167    63552  9440          3304   65536  141832  /bin/sh
168
169    If you have problems with make or yacc it may be worthwhile first to
170    install the GNU versions of these utilities before attempting to build
171    bash. (As of this writing, all of these utilities are available for the
172    i386 as pre-built binaries via anonymous ftp at math.syr.edu in the
173    pub/mcconnell/minix directory. Note that the GNU version of yacc is called
174    bison.)
175
176    Unless you want to see lots of warnings about old-style declarations,
177    do LOCAL_CFLAGS=-wo; export LOCAL_CFLAGS before running configure.
178    (These warnings are harmless, but annoying.)
179
180    configure will insist that you supply a host type. For example, do
181    ./configure --host=i386-pc-minix.
182
183    Minix does not support the system calls required for a proper 
184    implementation of ulimit().  The `ulimit' builtin will not be available.
185
186    Configure will fail to notice that many things like uid_t are indeed
187    typedef'd in <sys/types.h>, because it uses egrep for this purpose
188    and minix has no egrep. You could try making a link /usr/bin/egrep -->
189    /usr/bin/grep. Better is to install the GNU version of grep in
190    /usr/local/bin and make the link /usr/local/bin/egrep -->/usr/local/bin/grep.
191    (These must be hard links, of course, since Minix does not support
192    symbolic links.)
193
194    You will see many warnings of the form:
195    warning: unknown s_type: 98
196    I have no idea what this means, but it doesn't seem to matter.