sens pdksh jako /bin/sh
Arkadiusz Miskiewicz
arekm w pld-linux.org
Pią, 2 Kwi 2004, 03:07:20 CEST
Witam,
Czy jest sens używania w AC jako /bin/sh pakietu pdksh? Pytam z prostej
przyczyny - pakiet jest kompletnie niemaintainowany, nie wychodzą na niego
łatki, a bugów jest od czorta... u nas nikt nie ma serca poprawiać tego...
Masę zmian jest za to w wersji OpenBSDowej pdksh, do poczytania tu:
http://www.openbsd.org/cgi-bin/cvsweb/src/bin/ksh/
Swego czasu w PLD były niesamowite wręcz przygody z allocatorem pamięci
używanym przez pdksh (zakęconym jak ruski słoik) - co zrobili ludzie z
OpenBSD? - ano wywalili tamten kilkuset linijkowy (~ ok 700 linii) alokator
zastępując go własnym mieszczącym się w ... niecałych 100 linijkach.
Debian ciągnie ostro z OpenBSD, poprawek jest mnóstwo.
Propozycja jest zsh jako /bin/sh, mały fajny shell i co najważniejsze -
aktywnie rozwijany. Ewentualnie kto chętny na sportowanie BSDowych poprawek
dla pdksh?
Oto co Debian pozabierał z OpenBSD:
+ * More patches from OpenBSD:
+ + vi.c: Buffers are not strings so use memcpy(), not strlcpy() to copy
+ them. Also add some further bounds checks in the name of paranoia.
+ + exec.c: Unbreak parameter assignment when calling bourne style
+ functions.
+ + exec.c: For the >& and <& operators, add a check for "dup from" ==
+ "dup to" and just return success if they are the same. Fixes the
+ "ls 2>&2" problem.
+ + eval.c, exec.c, io.c, jobs.c: If "from fd" == "to fd" don't call
+ dup2() or close "from fd".
+ * More patches from OpenBSD:
+ + c_test.c: The special case code for "test -x" over NFS was
+ incorrect. The right thing to do is to try access(2) first
+ (since that occurs on the NFS server side) and only check for the
+ absence of an execute bit when access(2) succeeds.
+ + edit.c: in word location, fix forward scanning so it correctly
+ account for any escaped char and not only spaces. for "foo
+ (bar.a)" and "foo (bar a)", cd foo\ \(bar.<tab> will correctly
+ expand to foo\ \(bar.a\).
+ + alloc.c: Don't allow alloc() and aresize() to fail. Their return
+ value was only checked in two place (both in conjunction with
+ str_save). Upon malloc/realloc failure we call internal_errorf()
+ which pops throws and error and pops back to the last good state.
+ * Don't do tilde expansion after `=' sign in non-assignments.
+ Patch stolen from the posh package (closes: #187839).
* Merge many patches from OpenBSD:
+ + Introduce FSH flag, which is set when the shell is called as `sh'.
+ + alloc.c: Kill hand-made memory allocation code, that is definitely
+ buggy. Replace with simple wrapper around malloc, at least this works,
+ and it's easier to debug anyways.
+ + tree.c: Fix three off-by-one errors.
+ + c_sh.c: don't set close-on-exec flag on file descriptors in FSH mode
+ (closes: #154540). Documented the change in ksh(1).
+ + history.c: Compare the return from mmap with MAP_FAILED, do not cast it
+ to int and compare with -1.
+ + main.c: set edit mode to emacs by default, may be overridden by the
+ environment or the user. Also, we want tab completion in vi by
default.
+ + misc.c: use strtol() in getn().
+ + emacs.c:
+ - bind TAB (^I) to complete-list by default
+ - complete-list first completes; if that does not work, it lists
+ - fix a memleak in do_complete()
+ + edit.c:
+ - completion now works after '=' (dd), and ':' (ssh) and ` (backtick)
+ - add '#' to the list of escaped characters during vi/emacs filename
+ completion
+
+ * exec.c: Found and fixed yet another problem with `set -e' scripts
+ (see a changelog entry for 5.2.14-3), which caused `dpkg-buildpackage -B'
+ to fail on systems where /bin/sh is ksh.
+
+ * c_sh.c: Make `set' command return 0 always, not only in the POSIX mode.
+ According to Jeff Sheinberg <jeffsh w localnet.com>, this new behaviour
+ is more compatible with SUSv2 standard and other shells (esp. ksh93)
+ (closes: #118476). Documented the change in ksh(1) man page.
--
Arkadiusz Miśkiewicz CS at FoE, Wroclaw University of Technology
arekm.pld-linux.org, 1024/3DB19BBD, JID: arekm.jabber.org, PLD/Linux
Więcej informacji o liście dyskusyjnej pld-devel-pl