mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Disable SHOPT_DYNAMIC by default
Dynamically loadable built-ins do not work well with a statically linked ksh; they cannot use ksh's statically linked copies of libast and libshell, so they would need to bring their own, but multiple copies of those don't play well together. So dynamically loaded built-ins cannot interface with the shell. Only non-AST, non-SFIO built-ins are possible. Which is something that perhaps five people in the world know how to do as this is not documented anywhere (hint: your built-in needs the BLT_NOSFIO attribute to use stdio without problems). And those five people are also able to compile their own ksh with SHOPT_DYNAMIC reenabled. Plus, the SHOPT_DYNAMIC code causes strange $PATH search regressions on a few systems. The cause of that bug has eluded me so far, but disabling this is effectively a fix on those systems. src/cmd/ksh93/SHOPT.sh: - Turn off SHOPT_DYNAMIC by default. src/cmd/ksh93/data/builtins.c: - Do not compile in irrelevant sh_optbuiltin[] (builtin --man) documentation if SHOPT_DYNAMIC is disabled.
This commit is contained in:
parent
7c4418ccdc
commit
9ce426a8c4
3 changed files with 15 additions and 8 deletions
|
@ -59,7 +59,8 @@ The options have the following defaults and meanings:
|
|||
DEVFD Use the more secure /dev/fd mechanism instead of FIFOs for
|
||||
process substitutions. On by default on OSs with /dev/fd.
|
||||
|
||||
DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.)
|
||||
DYNAMIC off Dynamic loading of builtins. Requires dlopen() interface
|
||||
and dynamic libshell, libdll and libast libraries.
|
||||
|
||||
ECHOPRINT off Make echo equivalent to print.
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ SHOPT CMDLIB_HDR= # '<cmdlist.h>' # custom -lcmd list for path-bound builtins
|
|||
SHOPT CMDLIB_DIR= # '"/opt/ast/bin"' # virtual directory prefix for path-bound builtins
|
||||
SHOPT CRNL= # accept MS Windows newlines (<cr><nl>) for <nl>
|
||||
SHOPT DEVFD= # use /dev/fd instead of FIFOs for process substitutions
|
||||
SHOPT DYNAMIC=1 # dynamic loading for builtins
|
||||
SHOPT DYNAMIC=0 # dynamic loading for builtins
|
||||
SHOPT ECHOPRINT= # make echo equivalent to print
|
||||
SHOPT EDPREDICT=0 # History pattern search menu (type #<pattern>, then ESC <number> TAB). Experimental.
|
||||
SHOPT ESH=1 # emacs/gmacs edit mode
|
||||
|
|
|
@ -397,7 +397,7 @@ const char sh_optalias[] =
|
|||
;
|
||||
|
||||
const char sh_optbuiltin[] =
|
||||
"[-1c?\n@(#)$Id: builtin (AT&T Research) 2010-08-04 $\n]"
|
||||
"[-1c?\n@(#)$Id: builtin (ksh 93u+m) 2022-07-03 $\n]"
|
||||
"[--catalog?" SH_DICT "]"
|
||||
"[+NAME?builtin - add, delete, or display shell built-ins]"
|
||||
"[+DESCRIPTION?\bbuiltin\b can be used to add, delete, or display "
|
||||
|
@ -418,6 +418,7 @@ const char sh_optbuiltin[] =
|
|||
"the current list of built-ins, or just the special built-ins if \b-s\b "
|
||||
"is specified, on standard output. The full pathname for built-ins that "
|
||||
"are bound to pathnames are displayed.]"
|
||||
#if SHOPT_DYNAMIC
|
||||
"[+?Libraries containing built-ins can be specified with the \b-f\b "
|
||||
"option. If the library contains a function named \blib_init\b(), this "
|
||||
"function will be invoked with argument \b0\b when the library is "
|
||||
|
@ -426,20 +427,25 @@ const char sh_optbuiltin[] =
|
|||
"the C level function name.]"
|
||||
"[+?The C level function will be invoked with three arguments. The first "
|
||||
"two are the same as \bmain\b() and the third one is a pointer.]"
|
||||
#endif /* SHOPT_DYNAMIC */
|
||||
"[+?\bbuiltin\b cannot be invoked from a restricted shell.]"
|
||||
"[d?Deletes each of the specified built-ins. Special built-ins cannot be "
|
||||
"deleted.]"
|
||||
"[f]:[lib?On systems with dynamic linking, \alib\a names a shared "
|
||||
"library to load and search for built-ins. Libraries are searched for "
|
||||
"in \b../lib/ksh\b and \b../lib\b on \b$PATH\b and in system dependent "
|
||||
"library directories. The system "
|
||||
"dependent shared library prefix and/or suffix may be omitted. Once a "
|
||||
#if SHOPT_DYNAMIC
|
||||
"[f]:[lib?\alib\a names a shared library to load and search for built-ins. "
|
||||
"Libraries are searched for in \b../lib/ksh\b and \b../lib\b on \b$PATH\b "
|
||||
"and in system-dependent library directories. The system-dependent "
|
||||
"shared library prefix and/or suffix may be omitted. Once a "
|
||||
"library is loaded, its symbols become available for the current and "
|
||||
"subsequent invocations of \bbuiltin\b. Multiple libraries can be "
|
||||
"specified with separate invocations of \bbuiltin\b. Libraries are "
|
||||
"searched in the reverse order in which they are specified.]"
|
||||
"[l?List the library base name, plugin YYYYMMDD version stamp, and full "
|
||||
"path for \b-f\b\alib\a on one line on the standard output.]"
|
||||
#else
|
||||
"[f]:[lib?Not supported.]"
|
||||
"[l?No effect.]"
|
||||
#endif /* SHOPT_DYNAMIC */
|
||||
"[s?Display only the special built-ins.]"
|
||||
"\n"
|
||||
"\n[pathname ...]\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue