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